You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17126 lines
4.3 MiB
17126 lines
4.3 MiB
/**
|
|
* @license
|
|
* Cesium - https://github.com/CesiumGS/cesium
|
|
* Version 1.140.0
|
|
*
|
|
* Copyright 2011-2022 Cesium Contributors
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*
|
|
* Columbus View (Pat. Pend.)
|
|
*
|
|
* Portions licensed separately.
|
|
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
|
|
*/
|
|
|
|
var hve=Object.create;var q5=Object.defineProperty;var mve=Object.getOwnPropertyDescriptor;var pve=Object.getOwnPropertyNames;var Ave=Object.getPrototypeOf,gve=Object.prototype.hasOwnProperty;var _ve=(e,t,n)=>t in e?q5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var rM=(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 Xd=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var yve=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of pve(t))!gve.call(e,o)&&o!==n&&q5(e,o,{get:()=>t[o],enumerable:!(i=mve(t,o))||i.enumerable});return e};var Na=(e,t,n)=>(n=e!=null?hve(Ave(e)):{},yve(t||!e||!e.__esModule?q5(n,"default",{value:e,enumerable:!0}):n,e));var vn=(e,t,n)=>_ve(e,typeof t!="symbol"?t+"":t,n);var aM=Xd((FLt,Kte)=>{var $p=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)};$p.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}};$p.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};$p.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};$p.prototype.random_int31=function(){return this.random_int()>>>1};$p.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};$p.prototype.random=function(){return this.random_int()*(1/4294967296)};$p.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};$p.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Kte.exports=$p});var yne=Xd((TI,SI)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof TI=="object"&&TI&&!TI.nodeType&&TI,n=typeof SI=="object"&&SI&&!SI.nodeType&&SI,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,a=36,s=1,c=26,u=38,f=700,h=72,p=128,A="-",m=/^xn--/,_=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,C={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},E=a-s,I=Math.floor,x=String.fromCharCode,S;function w(k){throw new RangeError(C[k])}function v(k,z){for(var F=k.length,H=[];F--;)H[F]=z(k[F]);return H}function R(k,z){var F=k.split("@"),H="";F.length>1&&(H=F[0]+"@",k=F[1]),k=k.replace(y,".");var Y=k.split("."),$=v(Y,z).join(".");return H+$}function N(k){for(var z=[],F=0,H=k.length,Y,$;F<H;)Y=k.charCodeAt(F++),Y>=55296&&Y<=56319&&F<H?($=k.charCodeAt(F++),($&64512)==56320?z.push(((Y&1023)<<10)+($&1023)+65536):(z.push(Y),F--)):z.push(Y);return z}function L(k){return v(k,function(z){var F="";return z>65535&&(z-=65536,F+=x(z>>>10&1023|55296),z=56320|z&1023),F+=x(z),F}).join("")}function g(k){return k-48<10?k-22:k-65<26?k-65:k-97<26?k-97:a}function b(k,z){return k+22+75*(k<26)-((z!=0)<<5)}function T(k,z,F){var H=0;for(k=F?I(k/f):k>>1,k+=I(k/z);k>E*c>>1;H+=a)k=I(k/E);return I(H+(E+1)*k/(k+u))}function B(k){var z=[],F=k.length,H,Y=0,$=p,W=h,K,Z,pe,ge,re,ye,Ce,ve,Ne;for(K=k.lastIndexOf(A),K<0&&(K=0),Z=0;Z<K;++Z)k.charCodeAt(Z)>=128&&w("not-basic"),z.push(k.charCodeAt(Z));for(pe=K>0?K+1:0;pe<F;){for(ge=Y,re=1,ye=a;pe>=F&&w("invalid-input"),Ce=g(k.charCodeAt(pe++)),(Ce>=a||Ce>I((r-Y)/re))&&w("overflow"),Y+=Ce*re,ve=ye<=W?s:ye>=W+c?c:ye-W,!(Ce<ve);ye+=a)Ne=a-ve,re>I(r/Ne)&&w("overflow"),re*=Ne;H=z.length+1,W=T(Y-ge,H,ge==0),I(Y/H)>r-$&&w("overflow"),$+=I(Y/H),Y%=H,z.splice(Y++,0,$)}return L(z)}function M(k){var z,F,H,Y,$,W,K,Z,pe,ge,re,ye=[],Ce,ve,Ne,Le;for(k=N(k),Ce=k.length,z=p,F=0,$=h,W=0;W<Ce;++W)re=k[W],re<128&&ye.push(x(re));for(H=Y=ye.length,Y&&ye.push(A);H<Ce;){for(K=r,W=0;W<Ce;++W)re=k[W],re>=z&&re<K&&(K=re);for(ve=H+1,K-z>I((r-F)/ve)&&w("overflow"),F+=(K-z)*ve,z=K,W=0;W<Ce;++W)if(re=k[W],re<z&&++F>r&&w("overflow"),re==z){for(Z=F,pe=a;ge=pe<=$?s:pe>=$+c?c:pe-$,!(Z<ge);pe+=a)Le=Z-ge,Ne=a-ge,ye.push(x(b(ge+Le%Ne,0))),Z=I(Le/Ne);ye.push(x(b(Z,0))),$=T(F,ve,H==Y),F=0,++H}++F,++z}return ye.join("")}function O(k){return R(k,function(z){return m.test(z)?B(z.slice(4).toLowerCase()):z})}function G(k){return R(k,function(z){return _.test(z)?"xn--"+M(z):z})}if(o={version:"1.3.2",ucs2:{decode:N,encode:L},decode:B,encode:M,toASCII:G,toUnicode:O},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(SI.exports==t)n.exports=o;else for(S in o)o.hasOwnProperty(S)&&(t[S]=o[S]);else e.punycode=o})(TI)});var Ene=Xd((Cne,TM)=>{/*!
|
|
* 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 TM=="object"&&TM.exports?TM.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(Cne,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),a=r.split(":"),s=a.length,c=8;a[0]===""&&a[1]===""&&a[2]===""?(a.shift(),a.shift()):a[0]===""&&a[1]===""?a.shift():a[s-1]===""&&a[s-2]===""&&a.pop(),s=a.length,a[s-1].indexOf(".")!==-1&&(c=7);var u;for(u=0;u<s&&a[u]!=="";u++);if(u<c)for(a.splice(u,1,"0000");a.length<c;)a.splice(u,0,"0000");for(var f,h=0;h<c;h++){f=a[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);a[h]=f.join("")}var A=-1,m=0,_=0,y=-1,C=!1;for(h=0;h<c;h++)C?a[h]==="0"?_+=1:(C=!1,_>m&&(A=y,m=_)):a[h]==="0"&&(C=!0,y=h,_=1);_>m&&(A=y,m=_),m>1&&a.splice(A,m,""),s=a.length;var E="";for(a[0]===""&&(E=":"),h=0;h<s&&(E+=a[h],h!==s-1);h++)E+=":";return a[s-1]===""&&(E+=":"),E}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var bne=Xd((Ine,SM)=>{/*!
|
|
* 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 SM=="object"&&SM.exports?SM.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(Ine,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 a=n.list[i.slice(o+1)];return a?a.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 a=n.list[i.slice(o+1)];return a?a.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 a=n.list[i.slice(o+1)];return!a||a.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 Fu=Xd((xne,wM)=>{/*!
|
|
* 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 wM=="object"&&wM.exports?wM.exports=t(yne(),Ene(),bne()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(xne,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(b,T){var B=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof r))return B?M?new r(b,T):new r(b):new r;if(b===void 0){if(B)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?b=location.href+"":b=""}if(b===null&&B)throw new TypeError("null is not a valid argument for URI");return this.href(b),T!==void 0?this.absoluteTo(T):this}function a(b){return/^[0-9]+$/.test(b)}r.version="1.19.11";var s=r.prototype,c=Object.prototype.hasOwnProperty;function u(b){return b.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(b){return b===void 0?"Undefined":String(Object.prototype.toString.call(b)).slice(8,-1)}function h(b){return f(b)==="Array"}function p(b,T){var B={},M,O;if(f(T)==="RegExp")B=null;else if(h(T))for(M=0,O=T.length;M<O;M++)B[T[M]]=!0;else B[T]=!0;for(M=0,O=b.length;M<O;M++){var G=B&&B[b[M]]!==void 0||!B&&T.test(b[M]);G&&(b.splice(M,1),O--,M--)}return b}function A(b,T){var B,M;if(h(T)){for(B=0,M=T.length;B<M;B++)if(!A(b,T[B]))return!1;return!0}var O=f(T);for(B=0,M=b.length;B<M;B++)if(O==="RegExp"){if(typeof b[B]=="string"&&b[B].match(T))return!0}else if(b[B]===T)return!0;return!1}function m(b,T){if(!h(b)||!h(T)||b.length!==T.length)return!1;b.sort(),T.sort();for(var B=0,M=b.length;B<M;B++)if(b[B]!==T[B])return!1;return!0}function _(b){var T=/^\/+|\/+$/g;return b.replace(T,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(b){if(!(!b||!b.nodeName)){var T=b.nodeName.toLowerCase();if(!(T==="input"&&b.type!=="image"))return r.domAttributes[T]}};function y(b){return escape(b)}function C(b){return encodeURIComponent(b).replace(/[!'()*]/g,y).replace(/\*/g,"%2A")}r.encode=C,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=C,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(b,T){var B=r.encode(b+"");return T===void 0&&(T=r.escapeQuerySpace),T?B.replace(/%20/g,"+"):B},r.decodeQuery=function(b,T){b+="",T===void 0&&(T=r.escapeQuerySpace);try{return r.decode(T?b.replace(/\+/g,"%20"):b)}catch{return b}};var E={encode:"encode",decode:"decode"},I,x=function(b,T){return function(B){try{return r[T](B+"").replace(r.characters[b][T].expression,function(M){return r.characters[b][T].map[M]})}catch{return B}}};for(I in E)r[I+"PathSegment"]=x("pathname",E[I]),r[I+"UrnPathSegment"]=x("urnpath",E[I]);var S=function(b,T,B){return function(M){var O;B?O=function(F){return r[T](r[B](F))}:O=r[T];for(var G=(M+"").split(b),k=0,z=G.length;k<z;k++)G[k]=O(G[k]);return G.join(b)}};r.decodePath=S("/","decodePathSegment"),r.decodeUrnPath=S(":","decodeUrnPathSegment"),r.recodePath=S("/","encodePathSegment","decode"),r.recodeUrnPath=S(":","encodeUrnPathSegment","decode"),r.encodeReserved=x("reserved","encode"),r.parse=function(b,T){var B;return T||(T={preventInvalidHostname:r.preventInvalidHostname}),b=b.replace(r.leading_whitespace_expression,""),b=b.replace(r.ascii_tab_whitespace,""),B=b.indexOf("#"),B>-1&&(T.fragment=b.substring(B+1)||null,b=b.substring(0,B)),B=b.indexOf("?"),B>-1&&(T.query=b.substring(B+1)||null,b=b.substring(0,B)),b=b.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),b=b.replace(/^[/\\]{2,}/i,"//"),b.substring(0,2)==="//"?(T.protocol=null,b=b.substring(2),b=r.parseAuthority(b,T)):(B=b.indexOf(":"),B>-1&&(T.protocol=b.substring(0,B)||null,T.protocol&&!T.protocol.match(r.protocol_expression)?T.protocol=void 0:b.substring(B+1,B+3).replace(/\\/g,"/")==="//"?(b=b.substring(B+3),b=r.parseAuthority(b,T)):(b=b.substring(B+1),T.urn=!0))),T.path=b,T},r.parseHost=function(b,T){b||(b=""),b=b.replace(/\\/g,"/");var B=b.indexOf("/"),M,O;if(B===-1&&(B=b.length),b.charAt(0)==="[")M=b.indexOf("]"),T.hostname=b.substring(1,M)||null,T.port=b.substring(M+2,B)||null,T.port==="/"&&(T.port=null);else{var G=b.indexOf(":"),k=b.indexOf("/"),z=b.indexOf(":",G+1);z!==-1&&(k===-1||z<k)?(T.hostname=b.substring(0,B)||null,T.port=null):(O=b.substring(0,B).split(":"),T.hostname=O[0]||null,T.port=O[1]||null)}return T.hostname&&b.substring(B).charAt(0)!=="/"&&(B++,b="/"+b),T.preventInvalidHostname&&r.ensureValidHostname(T.hostname,T.protocol),T.port&&r.ensureValidPort(T.port),b.substring(B)||"/"},r.parseAuthority=function(b,T){return b=r.parseUserinfo(b,T),r.parseHost(b,T)},r.parseUserinfo=function(b,T){var B=b,M=b.indexOf("\\");M!==-1&&(b=b.replace(/\\/g,"/"));var O=b.indexOf("/"),G=b.lastIndexOf("@",O>-1?O:b.length-1),k;return G>-1&&(O===-1||G<O)?(k=b.substring(0,G).split(":"),T.username=k[0]?r.decode(k[0]):null,k.shift(),T.password=k[0]?r.decode(k.join(":")):null,b=B.substring(G+1)):(T.username=null,T.password=null),b},r.parseQuery=function(b,T){if(!b)return{};if(b=b.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!b)return{};for(var B={},M=b.split("&"),O=M.length,G,k,z,F=0;F<O;F++)G=M[F].split("="),k=r.decodeQuery(G.shift(),T),z=G.length?r.decodeQuery(G.join("="),T):null,k!=="__proto__"&&(c.call(B,k)?((typeof B[k]=="string"||B[k]===null)&&(B[k]=[B[k]]),B[k].push(z)):B[k]=z);return B},r.build=function(b){var T="",B=!1;return b.protocol&&(T+=b.protocol+":"),!b.urn&&(T||b.hostname)&&(T+="//",B=!0),T+=r.buildAuthority(b)||"",typeof b.path=="string"&&(b.path.charAt(0)!=="/"&&B&&(T+="/"),T+=b.path),typeof b.query=="string"&&b.query&&(T+="?"+b.query),typeof b.fragment=="string"&&b.fragment&&(T+="#"+b.fragment),T},r.buildHost=function(b){var T="";if(b.hostname)r.ip6_expression.test(b.hostname)?T+="["+b.hostname+"]":T+=b.hostname;else return"";return b.port&&(T+=":"+b.port),T},r.buildAuthority=function(b){return r.buildUserinfo(b)+r.buildHost(b)},r.buildUserinfo=function(b){var T="";return b.username&&(T+=r.encode(b.username)),b.password&&(T+=":"+r.encode(b.password)),T&&(T+="@"),T},r.buildQuery=function(b,T,B){var M="",O,G,k,z;for(G in b)if(G!=="__proto__"&&c.call(b,G))if(h(b[G]))for(O={},k=0,z=b[G].length;k<z;k++)b[G][k]!==void 0&&O[b[G][k]+""]===void 0&&(M+="&"+r.buildQueryParameter(G,b[G][k],B),T!==!0&&(O[b[G][k]+""]=!0));else b[G]!==void 0&&(M+="&"+r.buildQueryParameter(G,b[G],B));return M.substring(1)},r.buildQueryParameter=function(b,T,B){return r.encodeQuery(b,B)+(T!==null?"="+r.encodeQuery(T,B):"")},r.addQuery=function(b,T,B){if(typeof T=="object")for(var M in T)c.call(T,M)&&r.addQuery(b,M,T[M]);else if(typeof T=="string"){if(b[T]===void 0){b[T]=B;return}else typeof b[T]=="string"&&(b[T]=[b[T]]);h(B)||(B=[B]),b[T]=(b[T]||[]).concat(B)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(b,T,B){if(typeof T=="object")for(var M in T)c.call(T,M)&&r.setQuery(b,M,T[M]);else if(typeof T=="string")b[T]=B===void 0?null:B;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(b,T,B){var M,O,G;if(h(T))for(M=0,O=T.length;M<O;M++)b[T[M]]=void 0;else if(f(T)==="RegExp")for(G in b)T.test(G)&&(b[G]=void 0);else if(typeof T=="object")for(G in T)c.call(T,G)&&r.removeQuery(b,G,T[G]);else if(typeof T=="string")B!==void 0?f(B)==="RegExp"?!h(b[T])&&B.test(b[T])?b[T]=void 0:b[T]=p(b[T],B):b[T]===String(B)&&(!h(B)||B.length===1)?b[T]=void 0:h(b[T])&&(b[T]=p(b[T],B)):b[T]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(b,T,B,M){switch(f(T)){case"String":break;case"RegExp":for(var O in b)if(c.call(b,O)&&T.test(O)&&(B===void 0||r.hasQuery(b,O,B)))return!0;return!1;case"Object":for(var G in T)if(c.call(T,G)&&!r.hasQuery(b,G,T[G]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(B)){case"Undefined":return T in b;case"Boolean":var k=!!(h(b[T])?b[T].length:b[T]);return B===k;case"Function":return!!B(b[T],T,b);case"Array":if(!h(b[T]))return!1;var z=M?A:m;return z(b[T],B);case"RegExp":return h(b[T])?M?A(b[T],B):!1:!!(b[T]&&b[T].match(B));case"Number":B=String(B);case"String":return h(b[T])?M?A(b[T],B):!1:b[T]===B;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var b=[],T=[],B=0,M=0;M<arguments.length;M++){var O=new r(arguments[M]);b.push(O);for(var G=O.segment(),k=0;k<G.length;k++)typeof G[k]=="string"&&T.push(G[k]),G[k]&&B++}if(!T.length||!B)return new r("");var z=new r("").segment(T);return(b[0].path()===""||b[0].path().slice(0,1)==="/")&&z.path("/"+z.path()),z.normalize()},r.commonPath=function(b,T){var B=Math.min(b.length,T.length),M;for(M=0;M<B;M++)if(b.charAt(M)!==T.charAt(M)){M--;break}return M<1?b.charAt(0)===T.charAt(0)&&b.charAt(0)==="/"?"/":"":((b.charAt(M)!=="/"||T.charAt(M)!=="/")&&(M=b.substring(0,M).lastIndexOf("/")),b.substring(0,M+1))},r.withinString=function(b,T,B){B||(B={});var M=B.start||r.findUri.start,O=B.end||r.findUri.end,G=B.trim||r.findUri.trim,k=B.parens||r.findUri.parens,z=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var F=M.exec(b);if(!F)break;var H=F.index;if(B.ignoreHtml){var Y=b.slice(Math.max(H-3,0),H);if(Y&&z.test(Y))continue}for(var $=H+b.slice(H).search(O),W=b.slice(H,$),K=-1;;){var Z=k.exec(W);if(!Z)break;var pe=Z.index+Z[0].length;K=Math.max(K,pe)}if(K>-1?W=W.slice(0,K)+W.slice(K).replace(G,""):W=W.replace(G,""),!(W.length<=F[0].length)&&!(B.ignore&&B.ignore.test(W))){$=H+W.length;var ge=T(W,H,$,b);if(ge===void 0){M.lastIndex=$;continue}ge=String(ge),b=b.slice(0,H)+ge+b.slice($),M.lastIndex=H+ge.length}}return M.lastIndex=0,b},r.ensureValidHostname=function(b,T){var B=!!b,M=!!T,O=!1;if(M&&(O=A(r.hostProtocols,T)),O&&!B)throw new TypeError("Hostname cannot be empty, if protocol is "+T);if(b&&b.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(b).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(b){if(b){var T=Number(b);if(!(a(T)&&T>0&&T<65536))throw new TypeError('Port "'+b+'" is not a valid port')}},r.noConflict=function(b){if(b){var T={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(T.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(T.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(T.SecondLevelDomains=i.SecondLevelDomains.noConflict()),T}else i.URI===this&&(i.URI=o);return this},s.build=function(b){return b===!0?this._deferred_build=!0:(b===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},s.clone=function(){return new r(this)},s.valueOf=s.toString=function(){return this.build(!1)._string};function w(b){return function(T,B){return T===void 0?this._parts[b]||"":(this._parts[b]=T||null,this.build(!B),this)}}function v(b,T){return function(B,M){return B===void 0?this._parts[b]||"":(B!==null&&(B=B+"",B.charAt(0)===T&&(B=B.substring(1))),this._parts[b]=B,this.build(!M),this)}}s.protocol=w("protocol"),s.username=w("username"),s.password=w("password"),s.hostname=w("hostname"),s.port=w("port"),s.query=v("query","?"),s.fragment=v("fragment","#"),s.search=function(b,T){var B=this.query(b,T);return typeof B=="string"&&B.length?"?"+B:B},s.hash=function(b,T){var B=this.fragment(b,T);return typeof B=="string"&&B.length?"#"+B:B},s.pathname=function(b,T){if(b===void 0||b===!0){var B=this._parts.path||(this._parts.hostname?"/":"");return b?(this._parts.urn?r.decodeUrnPath:r.decodePath)(B):B}else return this._parts.urn?this._parts.path=b?r.recodeUrnPath(b):"":this._parts.path=b?r.recodePath(b):"/",this.build(!T),this},s.path=s.pathname,s.href=function(b,T){var B;if(b===void 0)return this.toString();this._string="",this._parts=r._parts();var M=b instanceof r,O=typeof b=="object"&&(b.hostname||b.path||b.pathname);if(b.nodeName){var G=r.getDomAttribute(b);b=b[G]||"",O=!1}if(!M&&O&&b.pathname!==void 0&&(b=b.toString()),typeof b=="string"||b instanceof String)this._parts=r.parse(String(b),this._parts);else if(M||O){var k=M?b._parts:b;for(B in k)B!=="query"&&c.call(this._parts,B)&&(this._parts[B]=k[B]);k.query&&this.query(k.query,!1)}else throw new TypeError("invalid input");return this.build(!T),this},s.is=function(b){var T=!1,B=!1,M=!1,O=!1,G=!1,k=!1,z=!1,F=!this._parts.urn;switch(this._parts.hostname&&(F=!1,B=r.ip4_expression.test(this._parts.hostname),M=r.ip6_expression.test(this._parts.hostname),T=B||M,O=!T,G=O&&n&&n.has(this._parts.hostname),k=O&&r.idn_expression.test(this._parts.hostname),z=O&&r.punycode_expression.test(this._parts.hostname)),b.toLowerCase()){case"relative":return F;case"absolute":return!F;case"domain":case"name":return O;case"sld":return G;case"ip":return T;case"ip4":case"ipv4":case"inet4":return B;case"ip6":case"ipv6":case"inet6":return M;case"idn":return k;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return z}return null};var R=s.protocol,N=s.port,L=s.hostname;s.protocol=function(b,T){if(b&&(b=b.replace(/:(\/\/)?$/,""),!b.match(r.protocol_expression)))throw new TypeError('Protocol "'+b+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,b,T)},s.scheme=s.protocol,s.port=function(b,T){return this._parts.urn?b===void 0?"":this:(b!==void 0&&(b===0&&(b=null),b&&(b+="",b.charAt(0)===":"&&(b=b.substring(1)),r.ensureValidPort(b))),N.call(this,b,T))},s.hostname=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b!==void 0){var B={preventInvalidHostname:this._parts.preventInvalidHostname},M=r.parseHost(b,B);if(M!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');b=B.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(b,this._parts.protocol)}return L.call(this,b,T)},s.origin=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var B=this.protocol(),M=this.authority();return M?(B?B+"://":"")+this.authority():""}else{var O=r(b);return this.protocol(O.protocol()).authority(O.authority()).build(!T),this}},s.host=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var B=r.parseHost(b,this._parts);if(B!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!T),this},s.authority=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var B=r.parseAuthority(b,this._parts);if(B!=="/")throw new TypeError('Hostname "'+b+'" contains characters other than [A-Z0-9.-]');return this.build(!T),this},s.userinfo=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){var B=r.buildUserinfo(this._parts);return B&&B.substring(0,B.length-1)}else return b[b.length-1]!=="@"&&(b+="@"),r.parseUserinfo(b,this._parts),this.build(!T),this},s.resource=function(b,T){var B;return b===void 0?this.path()+this.search()+this.hash():(B=r.parse(b),this._parts.path=B.path,this._parts.query=B.query,this._parts.fragment=B.fragment,this.build(!T),this)},s.subdomain=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var B=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,B)||""}else{var M=this._parts.hostname.length-this.domain().length,O=this._parts.hostname.substring(0,M),G=new RegExp("^"+u(O));if(b&&b.charAt(b.length-1)!=="."&&(b+="."),b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return b&&r.ensureValidHostname(b,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(G,b),this.build(!T),this}},s.domain=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(T=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var B=this._parts.hostname.match(/\./g);if(B&&B.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(T).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!b)throw new TypeError("cannot set domain empty");if(b.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(b,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=b;else{var O=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(O,b)}return this.build(!T),this}},s.tld=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(typeof b=="boolean"&&(T=b,b=void 0),b===void 0){if(!this._parts.hostname||this.is("IP"))return"";var B=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(B+1);return T!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var O;if(b)if(b.match(/[^a-zA-Z0-9-]/))if(n&&n.is(b))O=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,b);else throw new TypeError('TLD "'+b+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");O=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(O,b)}else throw new TypeError("cannot set TLD empty");return this.build(!T),this}},s.directory=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var B=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,B)||(this._parts.hostname?"/":"");return b?r.decodePath(M):M}else{var O=this._parts.path.length-this.filename().length,G=this._parts.path.substring(0,O),k=new RegExp("^"+u(G));return this.is("relative")||(b||(b="/"),b.charAt(0)!=="/"&&(b="/"+b)),b&&b.charAt(b.length-1)!=="/"&&(b+="/"),b=r.recodePath(b),this._parts.path=this._parts.path.replace(k,b),this.build(!T),this}},s.filename=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(typeof b!="string"){if(!this._parts.path||this._parts.path==="/")return"";var B=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(B+1);return b?r.decodePathSegment(M):M}else{var O=!1;b.charAt(0)==="/"&&(b=b.substring(1)),b.match(/\.?\//)&&(O=!0);var G=new RegExp(u(this.filename())+"$");return b=r.recodePath(b),this._parts.path=this._parts.path.replace(G,b),O?this.normalizePath(T):this.build(!T),this}},s.suffix=function(b,T){if(this._parts.urn)return b===void 0?"":this;if(b===void 0||b===!0){if(!this._parts.path||this._parts.path==="/")return"";var B=this.filename(),M=B.lastIndexOf("."),O,G;return M===-1?"":(O=B.substring(M+1),G=/^[a-z0-9%]+$/i.test(O)?O:"",b?r.decodePathSegment(G):G)}else{b.charAt(0)==="."&&(b=b.substring(1));var k=this.suffix(),z;if(k)b?z=new RegExp(u(k)+"$"):z=new RegExp(u("."+k)+"$");else{if(!b)return this;this._parts.path+="."+r.recodePath(b)}return z&&(b=r.recodePath(b),this._parts.path=this._parts.path.replace(z,b)),this.build(!T),this}},s.segment=function(b,T,B){var M=this._parts.urn?":":"/",O=this.path(),G=O.substring(0,1)==="/",k=O.split(M);if(b!==void 0&&typeof b!="number"&&(B=T,T=b,b=void 0),b!==void 0&&typeof b!="number")throw new Error('Bad segment "'+b+'", must be 0-based integer');if(G&&k.shift(),b<0&&(b=Math.max(k.length+b,0)),T===void 0)return b===void 0?k:k[b];if(b===null||k[b]===void 0)if(h(T)){k=[];for(var z=0,F=T.length;z<F;z++)!T[z].length&&(!k.length||!k[k.length-1].length)||(k.length&&!k[k.length-1].length&&k.pop(),k.push(_(T[z])))}else(T||typeof T=="string")&&(T=_(T),k[k.length-1]===""?k[k.length-1]=T:k.push(T));else T?k[b]=_(T):k.splice(b,1);return G&&k.unshift(""),this.path(k.join(M),B)},s.segmentCoded=function(b,T,B){var M,O,G;if(typeof b!="number"&&(B=T,T=b,b=void 0),T===void 0){if(M=this.segment(b,T,B),!h(M))M=M!==void 0?r.decode(M):void 0;else for(O=0,G=M.length;O<G;O++)M[O]=r.decode(M[O]);return M}if(!h(T))T=typeof T=="string"||T instanceof String?r.encode(T):T;else for(O=0,G=T.length;O<G;O++)T[O]=r.encode(T[O]);return this.segment(b,T,B)};var g=s.query;return s.query=function(b,T){if(b===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="function"){var B=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=b.call(this,B);return this._parts.query=r.buildQuery(M||B,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!T),this}else return b!==void 0&&typeof b!="string"?(this._parts.query=r.buildQuery(b,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!T),this):g.call(this,b,T)},s.setQuery=function(b,T,B){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof b=="string"||b instanceof String)M[b]=T!==void 0?T:null;else if(typeof b=="object")for(var O in b)c.call(b,O)&&(M[O]=b[O]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(B=T),this.build(!B),this},s.addQuery=function(b,T,B){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(M,b,T===void 0?null:T),this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(B=T),this.build(!B),this},s.removeQuery=function(b,T,B){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(M,b,T),this._parts.query=r.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof b!="string"&&(B=T),this.build(!B),this},s.hasQuery=function(b,T,B){var M=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(M,b,T,B)},s.setSearch=s.setQuery,s.addSearch=s.addQuery,s.removeSearch=s.removeQuery,s.hasSearch=s.hasQuery,s.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()},s.normalizeProtocol=function(b){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!b)),this},s.normalizeHostname=function(b){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!b)),this},s.normalizePort=function(b){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!b)),this},s.normalizePath=function(b){var T=this._parts.path;if(!T)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!b),this;if(this._parts.path==="/")return this;T=r.recodePath(T);var B,M="",O,G;for(T.charAt(0)!=="/"&&(B=!0,T="/"+T),(T.slice(-3)==="/.."||T.slice(-2)==="/.")&&(T+="/"),T=T.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),B&&(M=T.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));O=T.search(/\/\.\.(\/|$)/),O!==-1;){if(O===0){T=T.substring(3);continue}G=T.substring(0,O).lastIndexOf("/"),G===-1&&(G=O),T=T.substring(0,G)+T.substring(O+3)}return B&&this.is("relative")&&(T=M+T.substring(1)),this._parts.path=T,this.build(!b),this},s.normalizePathname=s.normalizePath,s.normalizeQuery=function(b){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!b)),this},s.normalizeFragment=function(b){return this._parts.fragment||(this._parts.fragment=null,this.build(!b)),this},s.normalizeSearch=s.normalizeQuery,s.normalizeHash=s.normalizeFragment,s.iso8859=function(){var b=r.encode,T=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=b,r.decode=T}return this},s.unicode=function(){var b=r.encode,T=r.decode;r.encode=C,r.decode=unescape;try{this.normalize()}finally{r.encode=b,r.decode=T}return this},s.readable=function(){var b=this.clone();b.username("").password("").normalize();var T="";if(b._parts.protocol&&(T+=b._parts.protocol+"://"),b._parts.hostname&&(b.is("punycode")&&e?(T+=e.toUnicode(b._parts.hostname),b._parts.port&&(T+=":"+b._parts.port)):T+=b.host()),b._parts.hostname&&b._parts.path&&b._parts.path.charAt(0)!=="/"&&(T+="/"),T+=b.path(!0),b._parts.query){for(var B="",M=0,O=b._parts.query.split("&"),G=O.length;M<G;M++){var k=(O[M]||"").split("=");B+="&"+r.decodeQuery(k[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),k[1]!==void 0&&(B+="="+r.decodeQuery(k[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}T+="?"+B.substring(1)}return T+=r.decodeQuery(b.hash(),!0),T},s.absoluteTo=function(b){var T=this.clone(),B=["protocol","username","password","hostname","port"],M,O,G;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b instanceof r||(b=new r(b)),T._parts.protocol||(T._parts.protocol=b._parts.protocol,this._parts.hostname))return T;for(O=0;G=B[O];O++)T._parts[G]=b._parts[G];return T._parts.path?(T._parts.path.substring(-2)===".."&&(T._parts.path+="/"),T.path().charAt(0)!=="/"&&(M=b.directory(),M=M||(b.path().indexOf("/")===0?"/":""),T._parts.path=(M?M+"/":"")+T._parts.path,T.normalizePath())):(T._parts.path=b._parts.path,T._parts.query||(T._parts.query=b._parts.query)),T.build(),T},s.relativeTo=function(b){var T=this.clone().normalize(),B,M,O,G,k;if(T._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(b=new r(b).normalize(),B=T._parts,M=b._parts,G=T.path(),k=b.path(),G.charAt(0)!=="/")throw new Error("URI is already relative");if(k.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(B.protocol===M.protocol&&(B.protocol=null),B.username!==M.username||B.password!==M.password||B.protocol!==null||B.username!==null||B.password!==null)return T.build();if(B.hostname===M.hostname&&B.port===M.port)B.hostname=null,B.port=null;else return T.build();if(G===k)return B.path="",T.build();if(O=r.commonPath(G,k),!O)return T.build();var z=M.path.substring(O.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return B.path=z+B.path.substring(O.length)||"./",T.build()},s.equals=function(b){var T=this.clone(),B=new r(b),M={},O={},G={},k,z,F;if(T.normalize(),B.normalize(),T.toString()===B.toString())return!0;if(k=T.query(),z=B.query(),T.query(""),B.query(""),T.toString()!==B.toString()||k.length!==z.length)return!1;M=r.parseQuery(k,this._parts.escapeQuerySpace),O=r.parseQuery(z,this._parts.escapeQuerySpace);for(F in M)if(c.call(M,F)){if(h(M[F])){if(!m(M[F],O[F]))return!1}else if(M[F]!==O[F])return!1;G[F]=!0}for(F in O)if(c.call(O,F)&&!G[F])return!1;return!0},s.preventInvalidHostname=function(b){return this._parts.preventInvalidHostname=!!b,this},s.duplicateQueryParameters=function(b){return this._parts.duplicateQueryParameters=!!b,this},s.escapeQuerySpace=function(b){return this._parts.escapeQuerySpace=!!b,this},r})});var ghe=Xd((nUn,Ahe)=>{"use strict";Ahe.exports=qZe;var SD=1e20;function qZe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,a,s,c,u,f,h,p,A,m,_;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,a=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/r/a)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,a=p.height,A=h.getImageData(0,0,r,a),c=A.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,a=p.height,A=h.getImageData(0,0,r,a),c=A.data,f=4):window.ImageData&&e instanceof window.ImageData&&(A=e,r=e.width,a=e.height,c=A.data,f=4);if(s=Math.max(r,a),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(r*a),m=0,_=Math.floor(u.length/f);m<_;m++)c[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var y=Array(r*a),C=Array(r*a),E=Array(s),I=Array(s),x=Array(s+1),S=Array(s);for(m=0,_=r*a;m<_;m++){var w=c[m];y[m]=w===1?0:w===0?SD:Math.pow(Math.max(0,.5-w),2),C[m]=w===1?SD:w===0?0:Math.pow(Math.max(0,w-.5),2)}mhe(y,r,a,E,I,S,x),mhe(C,r,a,E,I,S,x);var v=window.Float32Array?new Float32Array(r*a):new Array(r*a);for(m=0,_=r*a;m<_;m++)v[m]=Math.min(Math.max(1-((y[m]-C[m])/i+n),0),1);return v}function mhe(e,t,n,i,o,r,a){for(var s=0;s<t;s++){for(var c=0;c<n;c++)i[c]=e[c*t+s];for(phe(i,o,r,a,n),c=0;c<n;c++)e[c*t+s]=o[c]}for(c=0;c<n;c++){for(s=0;s<t;s++)i[s]=e[c*t+s];for(phe(i,o,r,a,t),s=0;s<t;s++)e[c*t+s]=Math.sqrt(o[s])}}function phe(e,t,n,i,o){n[0]=0,i[0]=-SD,i[1]=+SD;for(var r=1,a=0;r<o;r++){for(var s=(e[r]+r*r-(e[n[a]]+n[a]*n[a]))/(2*r-2*n[a]);s<=i[a];)a--,s=(e[r]+r*r-(e[n[a]]+n[a]*n[a]))/(2*r-2*n[a]);a++,n[a]=r,i[a]=s,i[a+1]=+SD}for(r=0,a=0;r<o;r++){for(;i[a+1]<r;)a++;t[r]=(r-n[a])*(r-n[a])+e[n[a]]}}});var Ihe=Xd((yUn,C3)=>{function r$e(){var e=0,t=1,n=2,i=3,o=4,r=5,a=6,s=7,c=8,u=9,f=10,h=11,p=12,A=13,m=14,_=15,y=16,C=17,E=0,I=1,x=2,S=3,w=4;function v(g,b){return 55296<=g.charCodeAt(b)&&g.charCodeAt(b)<=56319&&56320<=g.charCodeAt(b+1)&&g.charCodeAt(b+1)<=57343}function R(g,b){b===void 0&&(b=0);var T=g.charCodeAt(b);if(55296<=T&&T<=56319&&b<g.length-1){var B=T,M=g.charCodeAt(b+1);return 56320<=M&&M<=57343?(B-55296)*1024+(M-56320)+65536:B}if(56320<=T&&T<=57343&&b>=1){var B=g.charCodeAt(b-1),M=T;return 55296<=B&&B<=56319?(B-55296)*1024+(M-56320)+65536:M}return T}function N(g,b,T){var B=[g].concat(b).concat([T]),M=B[B.length-2],O=T,G=B.lastIndexOf(m);if(G>1&&B.slice(1,G).every(function(F){return F==i})&&[i,A,C].indexOf(g)==-1)return x;var k=B.lastIndexOf(o);if(k>0&&B.slice(1,k).every(function(F){return F==o})&&[p,o].indexOf(M)==-1)return B.filter(function(F){return F==o}).length%2==1?S:w;if(M==e&&O==t)return E;if(M==n||M==e||M==t)return O==m&&b.every(function(F){return F==i})?x:I;if(O==n||O==e||O==t)return I;if(M==a&&(O==a||O==s||O==u||O==f))return E;if((M==u||M==s)&&(O==s||O==c))return E;if((M==f||M==c)&&O==c)return E;if(O==i||O==_)return E;if(O==r)return E;if(M==p)return E;var z=B.indexOf(i)!=-1?B.lastIndexOf(i)-1:B.length-2;return[A,C].indexOf(B[z])!=-1&&B.slice(z+1,-1).every(function(F){return F==i})&&O==m||M==_&&[y,C].indexOf(O)!=-1?E:b.indexOf(o)!=-1?x:M==o&&O==o?E:I}this.nextBreak=function(g,b){if(b===void 0&&(b=0),b<0)return 0;if(b>=g.length-1)return g.length;for(var T=L(R(g,b)),B=[],M=b+1;M<g.length;M++)if(!v(g,M-1)){var O=L(R(g,M));if(N(T,B,O))return M;B.push(O)}return g.length},this.splitGraphemes=function(g){for(var b=[],T=0,B;(B=this.nextBreak(g,T))<g.length;)b.push(g.slice(T,B)),T=B;return T<g.length&&b.push(g.slice(T)),b},this.iterateGraphemes=function(g){var b=0,T={next:(function(){var B,M;return(M=this.nextBreak(g,b))<g.length?(B=g.slice(b,M),b=M,{value:B,done:!1}):b<g.length?(B=g.slice(b),b=g.length,{value:B,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(T[Symbol.iterator]=function(){return T}),T},this.countGraphemes=function(g){for(var b=0,T=0,B;(B=this.nextBreak(g,T))<g.length;)T=B,b++;return T<g.length&&b++,b};function L(g){return 1536<=g&&g<=1541||g==1757||g==1807||g==2274||g==3406||g==69821||70082<=g&&g<=70083||g==72250||72326<=g&&g<=72329||g==73030?p:g==13?e:g==10?t:0<=g&&g<=9||11<=g&&g<=12||14<=g&&g<=31||127<=g&&g<=159||g==173||g==1564||g==6158||g==8203||8206<=g&&g<=8207||g==8232||g==8233||8234<=g&&g<=8238||8288<=g&&g<=8292||g==8293||8294<=g&&g<=8303||55296<=g&&g<=57343||g==65279||65520<=g&&g<=65528||65529<=g&&g<=65531||113824<=g&&g<=113827||119155<=g&&g<=119162||g==917504||g==917505||917506<=g&&g<=917535||917632<=g&&g<=917759||918e3<=g&&g<=921599?n:768<=g&&g<=879||1155<=g&&g<=1159||1160<=g&&g<=1161||1425<=g&&g<=1469||g==1471||1473<=g&&g<=1474||1476<=g&&g<=1477||g==1479||1552<=g&&g<=1562||1611<=g&&g<=1631||g==1648||1750<=g&&g<=1756||1759<=g&&g<=1764||1767<=g&&g<=1768||1770<=g&&g<=1773||g==1809||1840<=g&&g<=1866||1958<=g&&g<=1968||2027<=g&&g<=2035||2070<=g&&g<=2073||2075<=g&&g<=2083||2085<=g&&g<=2087||2089<=g&&g<=2093||2137<=g&&g<=2139||2260<=g&&g<=2273||2275<=g&&g<=2306||g==2362||g==2364||2369<=g&&g<=2376||g==2381||2385<=g&&g<=2391||2402<=g&&g<=2403||g==2433||g==2492||g==2494||2497<=g&&g<=2500||g==2509||g==2519||2530<=g&&g<=2531||2561<=g&&g<=2562||g==2620||2625<=g&&g<=2626||2631<=g&&g<=2632||2635<=g&&g<=2637||g==2641||2672<=g&&g<=2673||g==2677||2689<=g&&g<=2690||g==2748||2753<=g&&g<=2757||2759<=g&&g<=2760||g==2765||2786<=g&&g<=2787||2810<=g&&g<=2815||g==2817||g==2876||g==2878||g==2879||2881<=g&&g<=2884||g==2893||g==2902||g==2903||2914<=g&&g<=2915||g==2946||g==3006||g==3008||g==3021||g==3031||g==3072||3134<=g&&g<=3136||3142<=g&&g<=3144||3146<=g&&g<=3149||3157<=g&&g<=3158||3170<=g&&g<=3171||g==3201||g==3260||g==3263||g==3266||g==3270||3276<=g&&g<=3277||3285<=g&&g<=3286||3298<=g&&g<=3299||3328<=g&&g<=3329||3387<=g&&g<=3388||g==3390||3393<=g&&g<=3396||g==3405||g==3415||3426<=g&&g<=3427||g==3530||g==3535||3538<=g&&g<=3540||g==3542||g==3551||g==3633||3636<=g&&g<=3642||3655<=g&&g<=3662||g==3761||3764<=g&&g<=3769||3771<=g&&g<=3772||3784<=g&&g<=3789||3864<=g&&g<=3865||g==3893||g==3895||g==3897||3953<=g&&g<=3966||3968<=g&&g<=3972||3974<=g&&g<=3975||3981<=g&&g<=3991||3993<=g&&g<=4028||g==4038||4141<=g&&g<=4144||4146<=g&&g<=4151||4153<=g&&g<=4154||4157<=g&&g<=4158||4184<=g&&g<=4185||4190<=g&&g<=4192||4209<=g&&g<=4212||g==4226||4229<=g&&g<=4230||g==4237||g==4253||4957<=g&&g<=4959||5906<=g&&g<=5908||5938<=g&&g<=5940||5970<=g&&g<=5971||6002<=g&&g<=6003||6068<=g&&g<=6069||6071<=g&&g<=6077||g==6086||6089<=g&&g<=6099||g==6109||6155<=g&&g<=6157||6277<=g&&g<=6278||g==6313||6432<=g&&g<=6434||6439<=g&&g<=6440||g==6450||6457<=g&&g<=6459||6679<=g&&g<=6680||g==6683||g==6742||6744<=g&&g<=6750||g==6752||g==6754||6757<=g&&g<=6764||6771<=g&&g<=6780||g==6783||6832<=g&&g<=6845||g==6846||6912<=g&&g<=6915||g==6964||6966<=g&&g<=6970||g==6972||g==6978||7019<=g&&g<=7027||7040<=g&&g<=7041||7074<=g&&g<=7077||7080<=g&&g<=7081||7083<=g&&g<=7085||g==7142||7144<=g&&g<=7145||g==7149||7151<=g&&g<=7153||7212<=g&&g<=7219||7222<=g&&g<=7223||7376<=g&&g<=7378||7380<=g&&g<=7392||7394<=g&&g<=7400||g==7405||g==7412||7416<=g&&g<=7417||7616<=g&&g<=7673||7675<=g&&g<=7679||g==8204||8400<=g&&g<=8412||8413<=g&&g<=8416||g==8417||8418<=g&&g<=8420||8421<=g&&g<=8432||11503<=g&&g<=11505||g==11647||11744<=g&&g<=11775||12330<=g&&g<=12333||12334<=g&&g<=12335||12441<=g&&g<=12442||g==42607||42608<=g&&g<=42610||42612<=g&&g<=42621||42654<=g&&g<=42655||42736<=g&&g<=42737||g==43010||g==43014||g==43019||43045<=g&&g<=43046||43204<=g&&g<=43205||43232<=g&&g<=43249||43302<=g&&g<=43309||43335<=g&&g<=43345||43392<=g&&g<=43394||g==43443||43446<=g&&g<=43449||g==43452||g==43493||43561<=g&&g<=43566||43569<=g&&g<=43570||43573<=g&&g<=43574||g==43587||g==43596||g==43644||g==43696||43698<=g&&g<=43700||43703<=g&&g<=43704||43710<=g&&g<=43711||g==43713||43756<=g&&g<=43757||g==43766||g==44005||g==44008||g==44013||g==64286||65024<=g&&g<=65039||65056<=g&&g<=65071||65438<=g&&g<=65439||g==66045||g==66272||66422<=g&&g<=66426||68097<=g&&g<=68099||68101<=g&&g<=68102||68108<=g&&g<=68111||68152<=g&&g<=68154||g==68159||68325<=g&&g<=68326||g==69633||69688<=g&&g<=69702||69759<=g&&g<=69761||69811<=g&&g<=69814||69817<=g&&g<=69818||69888<=g&&g<=69890||69927<=g&&g<=69931||69933<=g&&g<=69940||g==70003||70016<=g&&g<=70017||70070<=g&&g<=70078||70090<=g&&g<=70092||70191<=g&&g<=70193||g==70196||70198<=g&&g<=70199||g==70206||g==70367||70371<=g&&g<=70378||70400<=g&&g<=70401||g==70460||g==70462||g==70464||g==70487||70502<=g&&g<=70508||70512<=g&&g<=70516||70712<=g&&g<=70719||70722<=g&&g<=70724||g==70726||g==70832||70835<=g&&g<=70840||g==70842||g==70845||70847<=g&&g<=70848||70850<=g&&g<=70851||g==71087||71090<=g&&g<=71093||71100<=g&&g<=71101||71103<=g&&g<=71104||71132<=g&&g<=71133||71219<=g&&g<=71226||g==71229||71231<=g&&g<=71232||g==71339||g==71341||71344<=g&&g<=71349||g==71351||71453<=g&&g<=71455||71458<=g&&g<=71461||71463<=g&&g<=71467||72193<=g&&g<=72198||72201<=g&&g<=72202||72243<=g&&g<=72248||72251<=g&&g<=72254||g==72263||72273<=g&&g<=72278||72281<=g&&g<=72283||72330<=g&&g<=72342||72344<=g&&g<=72345||72752<=g&&g<=72758||72760<=g&&g<=72765||g==72767||72850<=g&&g<=72871||72874<=g&&g<=72880||72882<=g&&g<=72883||72885<=g&&g<=72886||73009<=g&&g<=73014||g==73018||73020<=g&&g<=73021||73023<=g&&g<=73029||g==73031||92912<=g&&g<=92916||92976<=g&&g<=92982||94095<=g&&g<=94098||113821<=g&&g<=113822||g==119141||119143<=g&&g<=119145||119150<=g&&g<=119154||119163<=g&&g<=119170||119173<=g&&g<=119179||119210<=g&&g<=119213||119362<=g&&g<=119364||121344<=g&&g<=121398||121403<=g&&g<=121452||g==121461||g==121476||121499<=g&&g<=121503||121505<=g&&g<=121519||122880<=g&&g<=122886||122888<=g&&g<=122904||122907<=g&&g<=122913||122915<=g&&g<=122916||122918<=g&&g<=122922||125136<=g&&g<=125142||125252<=g&&g<=125258||917536<=g&&g<=917631||917760<=g&&g<=917999?i:127462<=g&&g<=127487?o:g==2307||g==2363||2366<=g&&g<=2368||2377<=g&&g<=2380||2382<=g&&g<=2383||2434<=g&&g<=2435||2495<=g&&g<=2496||2503<=g&&g<=2504||2507<=g&&g<=2508||g==2563||2622<=g&&g<=2624||g==2691||2750<=g&&g<=2752||g==2761||2763<=g&&g<=2764||2818<=g&&g<=2819||g==2880||2887<=g&&g<=2888||2891<=g&&g<=2892||g==3007||3009<=g&&g<=3010||3014<=g&&g<=3016||3018<=g&&g<=3020||3073<=g&&g<=3075||3137<=g&&g<=3140||3202<=g&&g<=3203||g==3262||3264<=g&&g<=3265||3267<=g&&g<=3268||3271<=g&&g<=3272||3274<=g&&g<=3275||3330<=g&&g<=3331||3391<=g&&g<=3392||3398<=g&&g<=3400||3402<=g&&g<=3404||3458<=g&&g<=3459||3536<=g&&g<=3537||3544<=g&&g<=3550||3570<=g&&g<=3571||g==3635||g==3763||3902<=g&&g<=3903||g==3967||g==4145||4155<=g&&g<=4156||4182<=g&&g<=4183||g==4228||g==6070||6078<=g&&g<=6085||6087<=g&&g<=6088||6435<=g&&g<=6438||6441<=g&&g<=6443||6448<=g&&g<=6449||6451<=g&&g<=6456||6681<=g&&g<=6682||g==6741||g==6743||6765<=g&&g<=6770||g==6916||g==6965||g==6971||6973<=g&&g<=6977||6979<=g&&g<=6980||g==7042||g==7073||7078<=g&&g<=7079||g==7082||g==7143||7146<=g&&g<=7148||g==7150||7154<=g&&g<=7155||7204<=g&&g<=7211||7220<=g&&g<=7221||g==7393||7410<=g&&g<=7411||g==7415||43043<=g&&g<=43044||g==43047||43136<=g&&g<=43137||43188<=g&&g<=43203||43346<=g&&g<=43347||g==43395||43444<=g&&g<=43445||43450<=g&&g<=43451||43453<=g&&g<=43456||43567<=g&&g<=43568||43571<=g&&g<=43572||g==43597||g==43755||43758<=g&&g<=43759||g==43765||44003<=g&&g<=44004||44006<=g&&g<=44007||44009<=g&&g<=44010||g==44012||g==69632||g==69634||g==69762||69808<=g&&g<=69810||69815<=g&&g<=69816||g==69932||g==70018||70067<=g&&g<=70069||70079<=g&&g<=70080||70188<=g&&g<=70190||70194<=g&&g<=70195||g==70197||70368<=g&&g<=70370||70402<=g&&g<=70403||g==70463||70465<=g&&g<=70468||70471<=g&&g<=70472||70475<=g&&g<=70477||70498<=g&&g<=70499||70709<=g&&g<=70711||70720<=g&&g<=70721||g==70725||70833<=g&&g<=70834||g==70841||70843<=g&&g<=70844||g==70846||g==70849||71088<=g&&g<=71089||71096<=g&&g<=71099||g==71102||71216<=g&&g<=71218||71227<=g&&g<=71228||g==71230||g==71340||71342<=g&&g<=71343||g==71350||71456<=g&&g<=71457||g==71462||72199<=g&&g<=72200||g==72249||72279<=g&&g<=72280||g==72343||g==72751||g==72766||g==72873||g==72881||g==72884||94033<=g&&g<=94078||g==119142||g==119149?r:4352<=g&&g<=4447||43360<=g&&g<=43388?a:4448<=g&&g<=4519||55216<=g&&g<=55238?s:4520<=g&&g<=4607||55243<=g&&g<=55291?c:g==44032||g==44060||g==44088||g==44116||g==44144||g==44172||g==44200||g==44228||g==44256||g==44284||g==44312||g==44340||g==44368||g==44396||g==44424||g==44452||g==44480||g==44508||g==44536||g==44564||g==44592||g==44620||g==44648||g==44676||g==44704||g==44732||g==44760||g==44788||g==44816||g==44844||g==44872||g==44900||g==44928||g==44956||g==44984||g==45012||g==45040||g==45068||g==45096||g==45124||g==45152||g==45180||g==45208||g==45236||g==45264||g==45292||g==45320||g==45348||g==45376||g==45404||g==45432||g==45460||g==45488||g==45516||g==45544||g==45572||g==45600||g==45628||g==45656||g==45684||g==45712||g==45740||g==45768||g==45796||g==45824||g==45852||g==45880||g==45908||g==45936||g==45964||g==45992||g==46020||g==46048||g==46076||g==46104||g==46132||g==46160||g==46188||g==46216||g==46244||g==46272||g==46300||g==46328||g==46356||g==46384||g==46412||g==46440||g==46468||g==46496||g==46524||g==46552||g==46580||g==46608||g==46636||g==46664||g==46692||g==46720||g==46748||g==46776||g==46804||g==46832||g==46860||g==46888||g==46916||g==46944||g==46972||g==47e3||g==47028||g==47056||g==47084||g==47112||g==47140||g==47168||g==47196||g==47224||g==47252||g==47280||g==47308||g==47336||g==47364||g==47392||g==47420||g==47448||g==47476||g==47504||g==47532||g==47560||g==47588||g==47616||g==47644||g==47672||g==47700||g==47728||g==47756||g==47784||g==47812||g==47840||g==47868||g==47896||g==47924||g==47952||g==47980||g==48008||g==48036||g==48064||g==48092||g==48120||g==48148||g==48176||g==48204||g==48232||g==48260||g==48288||g==48316||g==48344||g==48372||g==48400||g==48428||g==48456||g==48484||g==48512||g==48540||g==48568||g==48596||g==48624||g==48652||g==48680||g==48708||g==48736||g==48764||g==48792||g==48820||g==48848||g==48876||g==48904||g==48932||g==48960||g==48988||g==49016||g==49044||g==49072||g==49100||g==49128||g==49156||g==49184||g==49212||g==49240||g==49268||g==49296||g==49324||g==49352||g==49380||g==49408||g==49436||g==49464||g==49492||g==49520||g==49548||g==49576||g==49604||g==49632||g==49660||g==49688||g==49716||g==49744||g==49772||g==49800||g==49828||g==49856||g==49884||g==49912||g==49940||g==49968||g==49996||g==50024||g==50052||g==50080||g==50108||g==50136||g==50164||g==50192||g==50220||g==50248||g==50276||g==50304||g==50332||g==50360||g==50388||g==50416||g==50444||g==50472||g==50500||g==50528||g==50556||g==50584||g==50612||g==50640||g==50668||g==50696||g==50724||g==50752||g==50780||g==50808||g==50836||g==50864||g==50892||g==50920||g==50948||g==50976||g==51004||g==51032||g==51060||g==51088||g==51116||g==51144||g==51172||g==51200||g==51228||g==51256||g==51284||g==51312||g==51340||g==51368||g==51396||g==51424||g==51452||g==51480||g==51508||g==51536||g==51564||g==51592||g==51620||g==51648||g==51676||g==51704||g==51732||g==51760||g==51788||g==51816||g==51844||g==51872||g==51900||g==51928||g==51956||g==51984||g==52012||g==52040||g==52068||g==52096||g==52124||g==52152||g==52180||g==52208||g==52236||g==52264||g==52292||g==52320||g==52348||g==52376||g==52404||g==52432||g==52460||g==52488||g==52516||g==52544||g==52572||g==52600||g==52628||g==52656||g==52684||g==52712||g==52740||g==52768||g==52796||g==52824||g==52852||g==52880||g==52908||g==52936||g==52964||g==52992||g==53020||g==53048||g==53076||g==53104||g==53132||g==53160||g==53188||g==53216||g==53244||g==53272||g==53300||g==53328||g==53356||g==53384||g==53412||g==53440||g==53468||g==53496||g==53524||g==53552||g==53580||g==53608||g==53636||g==53664||g==53692||g==53720||g==53748||g==53776||g==53804||g==53832||g==53860||g==53888||g==53916||g==53944||g==53972||g==54e3||g==54028||g==54056||g==54084||g==54112||g==54140||g==54168||g==54196||g==54224||g==54252||g==54280||g==54308||g==54336||g==54364||g==54392||g==54420||g==54448||g==54476||g==54504||g==54532||g==54560||g==54588||g==54616||g==54644||g==54672||g==54700||g==54728||g==54756||g==54784||g==54812||g==54840||g==54868||g==54896||g==54924||g==54952||g==54980||g==55008||g==55036||g==55064||g==55092||g==55120||g==55148||g==55176?u:44033<=g&&g<=44059||44061<=g&&g<=44087||44089<=g&&g<=44115||44117<=g&&g<=44143||44145<=g&&g<=44171||44173<=g&&g<=44199||44201<=g&&g<=44227||44229<=g&&g<=44255||44257<=g&&g<=44283||44285<=g&&g<=44311||44313<=g&&g<=44339||44341<=g&&g<=44367||44369<=g&&g<=44395||44397<=g&&g<=44423||44425<=g&&g<=44451||44453<=g&&g<=44479||44481<=g&&g<=44507||44509<=g&&g<=44535||44537<=g&&g<=44563||44565<=g&&g<=44591||44593<=g&&g<=44619||44621<=g&&g<=44647||44649<=g&&g<=44675||44677<=g&&g<=44703||44705<=g&&g<=44731||44733<=g&&g<=44759||44761<=g&&g<=44787||44789<=g&&g<=44815||44817<=g&&g<=44843||44845<=g&&g<=44871||44873<=g&&g<=44899||44901<=g&&g<=44927||44929<=g&&g<=44955||44957<=g&&g<=44983||44985<=g&&g<=45011||45013<=g&&g<=45039||45041<=g&&g<=45067||45069<=g&&g<=45095||45097<=g&&g<=45123||45125<=g&&g<=45151||45153<=g&&g<=45179||45181<=g&&g<=45207||45209<=g&&g<=45235||45237<=g&&g<=45263||45265<=g&&g<=45291||45293<=g&&g<=45319||45321<=g&&g<=45347||45349<=g&&g<=45375||45377<=g&&g<=45403||45405<=g&&g<=45431||45433<=g&&g<=45459||45461<=g&&g<=45487||45489<=g&&g<=45515||45517<=g&&g<=45543||45545<=g&&g<=45571||45573<=g&&g<=45599||45601<=g&&g<=45627||45629<=g&&g<=45655||45657<=g&&g<=45683||45685<=g&&g<=45711||45713<=g&&g<=45739||45741<=g&&g<=45767||45769<=g&&g<=45795||45797<=g&&g<=45823||45825<=g&&g<=45851||45853<=g&&g<=45879||45881<=g&&g<=45907||45909<=g&&g<=45935||45937<=g&&g<=45963||45965<=g&&g<=45991||45993<=g&&g<=46019||46021<=g&&g<=46047||46049<=g&&g<=46075||46077<=g&&g<=46103||46105<=g&&g<=46131||46133<=g&&g<=46159||46161<=g&&g<=46187||46189<=g&&g<=46215||46217<=g&&g<=46243||46245<=g&&g<=46271||46273<=g&&g<=46299||46301<=g&&g<=46327||46329<=g&&g<=46355||46357<=g&&g<=46383||46385<=g&&g<=46411||46413<=g&&g<=46439||46441<=g&&g<=46467||46469<=g&&g<=46495||46497<=g&&g<=46523||46525<=g&&g<=46551||46553<=g&&g<=46579||46581<=g&&g<=46607||46609<=g&&g<=46635||46637<=g&&g<=46663||46665<=g&&g<=46691||46693<=g&&g<=46719||46721<=g&&g<=46747||46749<=g&&g<=46775||46777<=g&&g<=46803||46805<=g&&g<=46831||46833<=g&&g<=46859||46861<=g&&g<=46887||46889<=g&&g<=46915||46917<=g&&g<=46943||46945<=g&&g<=46971||46973<=g&&g<=46999||47001<=g&&g<=47027||47029<=g&&g<=47055||47057<=g&&g<=47083||47085<=g&&g<=47111||47113<=g&&g<=47139||47141<=g&&g<=47167||47169<=g&&g<=47195||47197<=g&&g<=47223||47225<=g&&g<=47251||47253<=g&&g<=47279||47281<=g&&g<=47307||47309<=g&&g<=47335||47337<=g&&g<=47363||47365<=g&&g<=47391||47393<=g&&g<=47419||47421<=g&&g<=47447||47449<=g&&g<=47475||47477<=g&&g<=47503||47505<=g&&g<=47531||47533<=g&&g<=47559||47561<=g&&g<=47587||47589<=g&&g<=47615||47617<=g&&g<=47643||47645<=g&&g<=47671||47673<=g&&g<=47699||47701<=g&&g<=47727||47729<=g&&g<=47755||47757<=g&&g<=47783||47785<=g&&g<=47811||47813<=g&&g<=47839||47841<=g&&g<=47867||47869<=g&&g<=47895||47897<=g&&g<=47923||47925<=g&&g<=47951||47953<=g&&g<=47979||47981<=g&&g<=48007||48009<=g&&g<=48035||48037<=g&&g<=48063||48065<=g&&g<=48091||48093<=g&&g<=48119||48121<=g&&g<=48147||48149<=g&&g<=48175||48177<=g&&g<=48203||48205<=g&&g<=48231||48233<=g&&g<=48259||48261<=g&&g<=48287||48289<=g&&g<=48315||48317<=g&&g<=48343||48345<=g&&g<=48371||48373<=g&&g<=48399||48401<=g&&g<=48427||48429<=g&&g<=48455||48457<=g&&g<=48483||48485<=g&&g<=48511||48513<=g&&g<=48539||48541<=g&&g<=48567||48569<=g&&g<=48595||48597<=g&&g<=48623||48625<=g&&g<=48651||48653<=g&&g<=48679||48681<=g&&g<=48707||48709<=g&&g<=48735||48737<=g&&g<=48763||48765<=g&&g<=48791||48793<=g&&g<=48819||48821<=g&&g<=48847||48849<=g&&g<=48875||48877<=g&&g<=48903||48905<=g&&g<=48931||48933<=g&&g<=48959||48961<=g&&g<=48987||48989<=g&&g<=49015||49017<=g&&g<=49043||49045<=g&&g<=49071||49073<=g&&g<=49099||49101<=g&&g<=49127||49129<=g&&g<=49155||49157<=g&&g<=49183||49185<=g&&g<=49211||49213<=g&&g<=49239||49241<=g&&g<=49267||49269<=g&&g<=49295||49297<=g&&g<=49323||49325<=g&&g<=49351||49353<=g&&g<=49379||49381<=g&&g<=49407||49409<=g&&g<=49435||49437<=g&&g<=49463||49465<=g&&g<=49491||49493<=g&&g<=49519||49521<=g&&g<=49547||49549<=g&&g<=49575||49577<=g&&g<=49603||49605<=g&&g<=49631||49633<=g&&g<=49659||49661<=g&&g<=49687||49689<=g&&g<=49715||49717<=g&&g<=49743||49745<=g&&g<=49771||49773<=g&&g<=49799||49801<=g&&g<=49827||49829<=g&&g<=49855||49857<=g&&g<=49883||49885<=g&&g<=49911||49913<=g&&g<=49939||49941<=g&&g<=49967||49969<=g&&g<=49995||49997<=g&&g<=50023||50025<=g&&g<=50051||50053<=g&&g<=50079||50081<=g&&g<=50107||50109<=g&&g<=50135||50137<=g&&g<=50163||50165<=g&&g<=50191||50193<=g&&g<=50219||50221<=g&&g<=50247||50249<=g&&g<=50275||50277<=g&&g<=50303||50305<=g&&g<=50331||50333<=g&&g<=50359||50361<=g&&g<=50387||50389<=g&&g<=50415||50417<=g&&g<=50443||50445<=g&&g<=50471||50473<=g&&g<=50499||50501<=g&&g<=50527||50529<=g&&g<=50555||50557<=g&&g<=50583||50585<=g&&g<=50611||50613<=g&&g<=50639||50641<=g&&g<=50667||50669<=g&&g<=50695||50697<=g&&g<=50723||50725<=g&&g<=50751||50753<=g&&g<=50779||50781<=g&&g<=50807||50809<=g&&g<=50835||50837<=g&&g<=50863||50865<=g&&g<=50891||50893<=g&&g<=50919||50921<=g&&g<=50947||50949<=g&&g<=50975||50977<=g&&g<=51003||51005<=g&&g<=51031||51033<=g&&g<=51059||51061<=g&&g<=51087||51089<=g&&g<=51115||51117<=g&&g<=51143||51145<=g&&g<=51171||51173<=g&&g<=51199||51201<=g&&g<=51227||51229<=g&&g<=51255||51257<=g&&g<=51283||51285<=g&&g<=51311||51313<=g&&g<=51339||51341<=g&&g<=51367||51369<=g&&g<=51395||51397<=g&&g<=51423||51425<=g&&g<=51451||51453<=g&&g<=51479||51481<=g&&g<=51507||51509<=g&&g<=51535||51537<=g&&g<=51563||51565<=g&&g<=51591||51593<=g&&g<=51619||51621<=g&&g<=51647||51649<=g&&g<=51675||51677<=g&&g<=51703||51705<=g&&g<=51731||51733<=g&&g<=51759||51761<=g&&g<=51787||51789<=g&&g<=51815||51817<=g&&g<=51843||51845<=g&&g<=51871||51873<=g&&g<=51899||51901<=g&&g<=51927||51929<=g&&g<=51955||51957<=g&&g<=51983||51985<=g&&g<=52011||52013<=g&&g<=52039||52041<=g&&g<=52067||52069<=g&&g<=52095||52097<=g&&g<=52123||52125<=g&&g<=52151||52153<=g&&g<=52179||52181<=g&&g<=52207||52209<=g&&g<=52235||52237<=g&&g<=52263||52265<=g&&g<=52291||52293<=g&&g<=52319||52321<=g&&g<=52347||52349<=g&&g<=52375||52377<=g&&g<=52403||52405<=g&&g<=52431||52433<=g&&g<=52459||52461<=g&&g<=52487||52489<=g&&g<=52515||52517<=g&&g<=52543||52545<=g&&g<=52571||52573<=g&&g<=52599||52601<=g&&g<=52627||52629<=g&&g<=52655||52657<=g&&g<=52683||52685<=g&&g<=52711||52713<=g&&g<=52739||52741<=g&&g<=52767||52769<=g&&g<=52795||52797<=g&&g<=52823||52825<=g&&g<=52851||52853<=g&&g<=52879||52881<=g&&g<=52907||52909<=g&&g<=52935||52937<=g&&g<=52963||52965<=g&&g<=52991||52993<=g&&g<=53019||53021<=g&&g<=53047||53049<=g&&g<=53075||53077<=g&&g<=53103||53105<=g&&g<=53131||53133<=g&&g<=53159||53161<=g&&g<=53187||53189<=g&&g<=53215||53217<=g&&g<=53243||53245<=g&&g<=53271||53273<=g&&g<=53299||53301<=g&&g<=53327||53329<=g&&g<=53355||53357<=g&&g<=53383||53385<=g&&g<=53411||53413<=g&&g<=53439||53441<=g&&g<=53467||53469<=g&&g<=53495||53497<=g&&g<=53523||53525<=g&&g<=53551||53553<=g&&g<=53579||53581<=g&&g<=53607||53609<=g&&g<=53635||53637<=g&&g<=53663||53665<=g&&g<=53691||53693<=g&&g<=53719||53721<=g&&g<=53747||53749<=g&&g<=53775||53777<=g&&g<=53803||53805<=g&&g<=53831||53833<=g&&g<=53859||53861<=g&&g<=53887||53889<=g&&g<=53915||53917<=g&&g<=53943||53945<=g&&g<=53971||53973<=g&&g<=53999||54001<=g&&g<=54027||54029<=g&&g<=54055||54057<=g&&g<=54083||54085<=g&&g<=54111||54113<=g&&g<=54139||54141<=g&&g<=54167||54169<=g&&g<=54195||54197<=g&&g<=54223||54225<=g&&g<=54251||54253<=g&&g<=54279||54281<=g&&g<=54307||54309<=g&&g<=54335||54337<=g&&g<=54363||54365<=g&&g<=54391||54393<=g&&g<=54419||54421<=g&&g<=54447||54449<=g&&g<=54475||54477<=g&&g<=54503||54505<=g&&g<=54531||54533<=g&&g<=54559||54561<=g&&g<=54587||54589<=g&&g<=54615||54617<=g&&g<=54643||54645<=g&&g<=54671||54673<=g&&g<=54699||54701<=g&&g<=54727||54729<=g&&g<=54755||54757<=g&&g<=54783||54785<=g&&g<=54811||54813<=g&&g<=54839||54841<=g&&g<=54867||54869<=g&&g<=54895||54897<=g&&g<=54923||54925<=g&&g<=54951||54953<=g&&g<=54979||54981<=g&&g<=55007||55009<=g&&g<=55035||55037<=g&&g<=55063||55065<=g&&g<=55091||55093<=g&&g<=55119||55121<=g&&g<=55147||55149<=g&&g<=55175||55177<=g&&g<=55203?f:g==9757||g==9977||9994<=g&&g<=9997||g==127877||127938<=g&&g<=127940||g==127943||127946<=g&&g<=127948||128066<=g&&g<=128067||128070<=g&&g<=128080||g==128110||128112<=g&&g<=128120||g==128124||128129<=g&&g<=128131||128133<=g&&g<=128135||g==128170||128372<=g&&g<=128373||g==128378||g==128400||128405<=g&&g<=128406||128581<=g&&g<=128583||128587<=g&&g<=128591||g==128675||128692<=g&&g<=128694||g==128704||g==128716||129304<=g&&g<=129308||129310<=g&&g<=129311||g==129318||129328<=g&&g<=129337||129341<=g&&g<=129342||129489<=g&&g<=129501?A:127995<=g&&g<=127999?m:g==8205?_:g==9792||g==9794||9877<=g&&g<=9878||g==9992||g==10084||g==127752||g==127806||g==127859||g==127891||g==127908||g==127912||g==127979||g==127981||g==128139||128187<=g&&g<=128188||g==128295||g==128300||g==128488||g==128640||g==128658?y:128102<=g&&g<=128105?C:h}return this}typeof C3<"u"&&C3.exports&&(C3.exports=r$e)});var $Z=Xd((exports,module)=>{/*!
|
|
* protobuf.js v8.0.1 (c) 2016, daniel wirtz
|
|
* compiled sat, 04 apr 2026 19:23:15 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(a){var s=n[a];return s||t[a][0].call(s=n[a]={exports:{}},o,s,s.exports),s.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(r.util.Long=a,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 a=new Array(arguments.length-1),s=0,c=2,u=!0;c<arguments.length;)a[s++]=arguments[c++];return new Promise(function(h,p){a[s]=function(m){if(u)if(u=!1,m)p(m);else{for(var _=new Array(arguments.length-1),y=0;y<_.length;)_[y++]=arguments[y];h.apply(null,_)}};try{o.apply(r||null,a)}catch(A){u&&(u=!1,p(A))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.length*3)/4-h};for(var o=new Array(64),r=new Array(123),a=0;a<64;)r[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;i.encode=function(u,f,h){for(var p=null,A=[],m=0,_=0,y;f<h;){var C=u[f++];switch(_){case 0:A[m++]=o[C>>2],y=(C&3)<<4,_=1;break;case 1:A[m++]=o[y|C>>4],y=(C&15)<<2,_=2;break;case 2:A[m++]=o[y|C>>6],A[m++]=o[C&63],_=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,A)),m=0)}return _&&(A[m++]=o[y],A[m++]=61,_===1&&(A[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,A.slice(0,m))),p.join("")):String.fromCharCode.apply(String,A.slice(0,m))};var s="invalid encoding";i.decode=function(u,f,h){for(var p=h,A=0,m,_=0;_<u.length;){var y=u.charCodeAt(_++);if(y===61&&A>1)break;if((y=r[y])===undefined)throw Error(s);switch(A){case 0:m=y,A=1;break;case 1:f[h++]=m<<2|(y&48)>>4,m=y,A=2;break;case 2:f[h++]=(m&15)<<4|(y&60)>>2,m=y,A=3;break;case 3:f[h++]=(m&3)<<6|y,A=0;break}}if(A===1)throw Error(s);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,a,s){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:a,ctx:s||this}),this},i.prototype.off=function(r,a){if(r===undefined)this._listeners={};else if(a===undefined)this._listeners[r]=[];else for(var s=this._listeners[r],c=0;c<s.length;)s[c].fn===a?s.splice(c,1):++c;return this},i.prototype.emit=function(r){var a=this._listeners[r];if(a){for(var s=[],c=1;c<arguments.length;)s.push(arguments[c++]);for(c=0;c<a.length;)a[c].fn.apply(a[c++].ctx,s)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(c){return typeof Float32Array<"u"?(function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(y,C,E){u[0]=y,C[E]=f[0],C[E+1]=f[1],C[E+2]=f[2],C[E+3]=f[3]}function A(y,C,E){u[0]=y,C[E]=f[3],C[E+1]=f[2],C[E+2]=f[1],C[E+3]=f[0]}c.writeFloatLE=h?p:A,c.writeFloatBE=h?A:p;function m(y,C){return f[0]=y[C],f[1]=y[C+1],f[2]=y[C+2],f[3]=y[C+3],u[0]}function _(y,C){return f[3]=y[C],f[2]=y[C+1],f[1]=y[C+2],f[0]=y[C+3],u[0]}c.readFloatLE=h?m:_,c.readFloatBE=h?_:m})():(function(){function u(h,p,A,m){var _=p<0?1:0;if(_&&(p=-p),p===0)h(1/p>0?0:2147483648,A,m);else if(isNaN(p))h(2143289344,A,m);else if(p>34028234663852886e22)h((_<<31|2139095040)>>>0,A,m);else if(p<11754943508222875e-54)h((_<<31|Math.round(p/1401298464324817e-60))>>>0,A,m);else{var y=Math.floor(Math.log(p)/Math.LN2),C=Math.round(p*Math.pow(2,-y)*8388608)&8388607;h((_<<31|y+127<<23|C)>>>0,A,m)}}c.writeFloatLE=u.bind(null,o),c.writeFloatBE=u.bind(null,r);function f(h,p,A){var m=h(p,A),_=(m>>31)*2+1,y=m>>>23&255,C=m&8388607;return y===255?C?NaN:_*(1/0):y===0?_*1401298464324817e-60*C:_*Math.pow(2,y-150)*(C+8388608)}c.readFloatLE=f.bind(null,a),c.readFloatBE=f.bind(null,s)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(y,C,E){u[0]=y,C[E]=f[0],C[E+1]=f[1],C[E+2]=f[2],C[E+3]=f[3],C[E+4]=f[4],C[E+5]=f[5],C[E+6]=f[6],C[E+7]=f[7]}function A(y,C,E){u[0]=y,C[E]=f[7],C[E+1]=f[6],C[E+2]=f[5],C[E+3]=f[4],C[E+4]=f[3],C[E+5]=f[2],C[E+6]=f[1],C[E+7]=f[0]}c.writeDoubleLE=h?p:A,c.writeDoubleBE=h?A:p;function m(y,C){return f[0]=y[C],f[1]=y[C+1],f[2]=y[C+2],f[3]=y[C+3],f[4]=y[C+4],f[5]=y[C+5],f[6]=y[C+6],f[7]=y[C+7],u[0]}function _(y,C){return f[7]=y[C],f[6]=y[C+1],f[5]=y[C+2],f[4]=y[C+3],f[3]=y[C+4],f[2]=y[C+5],f[1]=y[C+6],f[0]=y[C+7],u[0]}c.readDoubleLE=h?m:_,c.readDoubleBE=h?_:m})():(function(){function u(h,p,A,m,_,y){var C=m<0?1:0;if(C&&(m=-m),m===0)h(0,_,y+p),h(1/m>0?0:2147483648,_,y+A);else if(isNaN(m))h(0,_,y+p),h(2146959360,_,y+A);else if(m>17976931348623157e292)h(0,_,y+p),h((C<<31|2146435072)>>>0,_,y+A);else{var E;if(m<22250738585072014e-324)E=m/5e-324,h(E>>>0,_,y+p),h((C<<31|E/4294967296)>>>0,_,y+A);else{var I=Math.floor(Math.log(m)/Math.LN2);I===1024&&(I=1023),E=m*Math.pow(2,-I),h(E*4503599627370496>>>0,_,y+p),h((C<<31|I+1023<<20|E*1048576&1048575)>>>0,_,y+A)}}}c.writeDoubleLE=u.bind(null,o,0,4),c.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,A,m,_){var y=h(m,_+p),C=h(m,_+A),E=(C>>31)*2+1,I=C>>>20&2047,x=4294967296*(C&1048575)+y;return I===2047?x?NaN:E*(1/0):I===0?E*5e-324*x:E*Math.pow(2,I-1075)*(x+4503599627370496)}c.readDoubleLE=f.bind(null,a,0,4),c.readDoubleBE=f.bind(null,s,4,0)})(),c}function o(c,u,f){u[f]=c&255,u[f+1]=c>>>8&255,u[f+2]=c>>>16&255,u[f+3]=c>>>24}function r(c,u,f){u[f]=c>>>24,u[f+1]=c>>>16&255,u[f+2]=c>>>8&255,u[f+3]=c&255}function a(c,u){return(c[u]|c[u+1]<<8|c[u+2]<<16|c[u+3]<<24)>>>0}function s(c,u){return(c[u]<<24|c[u+1]<<16|c[u+2]<<8|c[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,a){var s=a||8192,c=s>>>1,u=null,f=s;return function(p){if(p<1||p>c)return o(p);f+p>s&&(u=o(s),f=0);var A=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),A}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var a=0,s=0,c=0;c<r.length;++c)s=r.charCodeAt(c),s<128?a+=1:s<2048?a+=2:(s&64512)===55296&&(r.charCodeAt(c+1)&64512)===56320?(++c,a+=4):a+=3;return a},i.read=function(r,a,s){var c=s-a;if(c<1)return"";for(var u=null,f=[],h=0,p;a<s;)p=r[a++],p<128?f[h++]=p:p>191&&p<224?f[h++]=(p&31)<<6|r[a++]&63:p>239&&p<365?(p=((p&7)<<18|(r[a++]&63)<<12|(r[a++]&63)<<6|r[a++]&63)-65536,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[a++]&63)<<6|r[a++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,a,s){for(var c=s,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?a[s++]=u:u<2048?(a[s++]=u>>6|192,a[s++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,a[s++]=u>>18|240,a[s++]=u>>12&63|128,a[s++]=u>>6&63|128,a[s++]=u&63|128):(a[s++]=u>>12|224,a[s++]=u>>6&63|128,a[s++]=u&63|128);return s-c}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=c;var i=e(15),o,r=i.LongBits,a=i.utf8;function s(m,_){return RangeError("index out of range: "+m.pos+" + "+(_||1)+" > "+m.len)}function c(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(_){if(_ instanceof Uint8Array||Array.isArray(_))return new c(_);throw Error("illegal buffer")}:function(_){if(Array.isArray(_))return new c(_);throw Error("illegal buffer")},f=function(){return i.Buffer?function(y){return(c.create=function(E){return i.Buffer.isBuffer(E)?new o(E):u(E)})(y)}:u};c.create=f(),c.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,c.prototype.uint32=(function(){var _=4294967295;return function(){if(_=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(_=(_|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(_=(_|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return _;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return _}})(),c.prototype.int32=function(){return this.uint32()|0},c.prototype.sint32=function(){var _=this.uint32();return _>>>1^-(_&1)|0};function h(){var m=new r(0,0),_=0;if(this.len-this.pos>4){for(;_<4;++_)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<_*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;_=0}else{for(;_<3;++_){if(this.pos>=this.len)throw s(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<_*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<_*7)>>>0,m}if(this.len-this.pos>4){for(;_<5;++_)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<_*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;_<5;++_){if(this.pos>=this.len)throw s(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<_*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}c.prototype.bool=function(){return this.uint32()!==0};function p(m,_){return(m[_-4]|m[_-3]<<8|m[_-2]<<16|m[_-1]<<24)>>>0}c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)|0};function A(){if(this.pos+8>this.len)throw s(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var _=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,_},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var _=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,_},c.prototype.bytes=function(){var _=this.uint32(),y=this.pos,C=this.pos+_;if(C>this.len)throw s(this,_);if(this.pos+=_,Array.isArray(this.buf))return this.buf.slice(y,C);if(y===C){var E=i.Buffer;return E?E.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,y,C)},c.prototype.string=function(){var _=this.bytes();return a.read(_,0,_.length)},c.prototype.skip=function(_){if(typeof _=="number"){if(this.pos+_>this.len)throw s(this,_);this.pos+=_}else do if(this.pos>=this.len)throw s(this);while(this.buf[this.pos++]&128);return this},c.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},c._configure=function(m){o=m,c.create=f(),o._configure();var _=i.Long?"toLong":"toNumber";i.merge(c.prototype,{int64:function(){return h.call(this)[_](!1)},uint64:function(){return h.call(this)[_](!0)},sint64:function(){return h.call(this).zzDecode()[_](!1)},fixed64:function(){return A.call(this)[_](!0)},sfixed64:function(){return A.call(this)[_](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(a){i.call(this,a)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var s=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+s,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+s,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,a,s){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!a,this.responseDelimited=!!s}o.prototype.rpcCall=function r(a,s,c,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,a,s,c,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(a,s[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(A,m){if(A)return h.emit("error",A,a),f(A);if(m===null)return h.end(!0),undefined;if(!(m instanceof c))try{m=c[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(_){return h.emit("error",_,a),f(_)}return h.emit("data",m,a),f(null,m)})}catch(p){return h.emit("error",p,a),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(c,u){this.lo=c>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var s=String.prototype.charCodeAt;o.fromHash=function(u){return u===a?r:new o((s.call(u,0)|s.call(u,1)<<8|s.call(u,2)<<16|s.call(u,3)<<24)>>>0,(s.call(u,4)|s.call(u,5)<<8|s.call(u,6)<<16|s.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s},i.isString=function(s){return typeof s=="string"||s instanceof String},i.isObject=function(s){return s&&typeof s=="object"},i.isset=i.isSet=function(s,c){var u=s[c];return u!=null&&s.hasOwnProperty(c)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=(function(){try{var a=i.inquire("buffer").Buffer;return a.prototype.utf8Write?a:null}catch{return null}})(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(s){return typeof s=="number"?i.Buffer?i._Buffer_allocUnsafe(s):new i.Array(s):i.Buffer?i._Buffer_from(s):typeof Uint8Array>"u"?s:new Uint8Array(s)},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(s){return s?i.LongBits.from(s).toHash():i.LongBits.zeroHash},i.longFromHash=function(s,c){var u=i.LongBits.fromHash(s);return i.Long?i.Long.fromBits(u.lo,u.hi,c):u.toNumber(!!c)};function o(a,s,c){for(var u=Object.keys(s),f=0;f<u.length;++f)(a[u[f]]===undefined||!c)&&(a[u[f]]=s[u[f]]);return a}i.merge=o,i.lcFirst=function(s){return s.charAt(0).toLowerCase()+s.substring(1)};function r(a){function s(c,u){if(!(this instanceof s))return new s(c,u);Object.defineProperty(this,"message",{get:function(){return c}}),Error.captureStackTrace?Error.captureStackTrace(this,s):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return s.prototype=Object.create(Error.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return a},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),s}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(s){for(var c={},u=0;u<s.length;++u)c[s[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(c[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(s){return function(c){for(var u=0;u<s.length;++u)s[u]!==c&&delete this[s[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var a=i.Buffer;if(!a){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=a.from!==Uint8Array.from&&a.from||function(c,u){return new a(c,u)},i._Buffer_allocUnsafe=a.allocUnsafe||function(c){return new a(c)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,a=i.base64,s=i.utf8;function c(I,x,S){this.fn=I,this.len=x,this.next=undefined,this.val=S}function u(){}function f(I){this.head=I.head,this.tail=I.tail,this.len=I.len,this.next=I.states}function h(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(x){return new i.Array(x)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(x,S,w){return this.tail=this.tail.next=new c(x,S,w),this.len+=S,this};function A(I,x,S){x[S]=I&255}function m(I,x,S){for(;I>127;)x[S++]=I&127|128,I>>>=7;x[S]=I}function _(I,x){this.len=I,this.next=undefined,this.val=x}_.prototype=Object.create(c.prototype),_.prototype.fn=m,h.prototype.uint32=function(x){return this.len+=(this.tail=this.tail.next=new _((x=x>>>0)<128?1:x<16384?2:x<2097152?3:x<268435456?4:5,x)).len,this},h.prototype.int32=function(x){return x<0?this._push(y,10,r.fromNumber(x)):this.uint32(x)},h.prototype.sint32=function(x){return this.uint32((x<<1^x>>31)>>>0)};function y(I,x,S){for(;I.hi;)x[S++]=I.lo&127|128,I.lo=(I.lo>>>7|I.hi<<25)>>>0,I.hi>>>=7;for(;I.lo>127;)x[S++]=I.lo&127|128,I.lo=I.lo>>>7;x[S++]=I.lo}h.prototype.uint64=function(x){var S=r.from(x);return this._push(y,S.length(),S)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(x){var S=r.from(x).zzEncode();return this._push(y,S.length(),S)},h.prototype.bool=function(x){return this._push(A,1,x?1:0)};function C(I,x,S){x[S]=I&255,x[S+1]=I>>>8&255,x[S+2]=I>>>16&255,x[S+3]=I>>>24}h.prototype.fixed32=function(x){return this._push(C,4,x>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(x){var S=r.from(x);return this._push(C,4,S.lo)._push(C,4,S.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(x){return this._push(i.float.writeFloatLE,4,x)},h.prototype.double=function(x){return this._push(i.float.writeDoubleLE,8,x)};var E=i.Array.prototype.set?function(x,S,w){S.set(x,w)}:function(x,S,w){for(var v=0;v<x.length;++v)S[w+v]=x[v]};h.prototype.bytes=function(x){var S=x.length>>>0;if(!S)return this._push(A,1,0);if(i.isString(x)){var w=h.alloc(S=a.length(x));a.decode(x,w,0),x=w}return this.uint32(S)._push(E,S,x)},h.prototype.string=function(x){var S=s.length(x);return S?this.uint32(S)._push(s.write,S,x):this._push(A,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new c(u,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new c(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var x=this.head,S=this.tail,w=this.len;return this.reset().uint32(w),w&&(this.tail.next=x.next,this.tail=S,this.len+=w),this},h.prototype.finish=function(){for(var x=this.head.next,S=this.constructor.alloc(this.len),w=0;x;)x.fn(x.val,S,w),w+=x.len,x=x.next;return S},h._configure=function(I){o=I,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(c,u,f){u.set(c,f)}:function(c,u,f){if(c.copy)c.copy(u,f,0,c.length);else for(var h=0;h<c.length;)u[f++]=c[h++]}},r.prototype.bytes=function(c){o.isString(c)&&(c=o._Buffer_from(c,"base64"));var u=c.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,c),this};function a(s,c,u){s.length<40?o.utf8.write(s,c,u):c.utf8Write?c.utf8Write(s,u):c.write(s,u)}r.prototype.string=function(c){var u=o.Buffer.byteLength(c);return this.uint32(u),u&&this._push(a,u,c),this},r._configure()},{15:15,16:16}]},{},[8])})()});var FBe=Xd((z$i,S9)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,A=c(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,_=r(A,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),y={width:A.width,height:A.height,pixelData:_.resultPixels,minValue:_.minValue,maxValue:A.pixels.maxValue,noDataValue:m};return _.resultMask&&(y.maskData=_.resultMask),h.returnEncodedMask&&A.mask&&(y.encodedMaskData=A.mask.bitset?A.mask.bitset:null),h.returnFileInfo&&(y.fileInfo=a(A),h.computeUsedBitDepths&&(y.fileInfo.bitDepths=s(A))),y};var r=function(f,h,p,A,m){var _=0,y=f.pixels.numBlocksX,C=f.pixels.numBlocksY,E=Math.floor(f.width/y),I=Math.floor(f.height/C),x=2*f.maxZError,S=Number.MAX_VALUE,w;p=p||(f.mask?f.mask.bitset:null);var v,R;v=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var N=new Float32Array(E*I),L,g,b=0;b<=C;b++){var T=b!==C?I:f.height%C;if(T!==0)for(var B=0;B<=y;B++){var M=B!==y?E:f.width%y;if(M!==0){var O=b*f.width*I+B*E,G=f.width-M,k=f.pixels.blocks[_],z,F,H;k.encoding<2?(k.encoding===0?z=k.rawData:(u(k.stuffedData,k.bitsPerPixel,k.numValidPixels,k.offset,x,N,f.pixels.maxValue),z=N),F=0):k.encoding===2?H=0:H=k.offset;var Y;if(p)for(g=0;g<T;g++){for(O&7&&(Y=p[O>>3],Y<<=O&7),L=0;L<M;L++)O&7||(Y=p[O>>3]),Y&128?(R&&(R[O]=1),w=k.encoding<2?z[F++]:H,S=S>w?w:S,v[O++]=w):(R&&(R[O]=0),v[O++]=A),Y<<=1;O+=G}else if(k.encoding<2)for(g=0;g<T;g++){for(L=0;L<M;L++)w=z[F++],S=S>w?w:S,v[O++]=w;O+=G}else for(S=S>H?H:S,g=0;g<T;g++){for(L=0;L<M;L++)v[O++]=H;O+=G}if(k.encoding===1&&F!==k.numValidPixels)throw"Block and Mask do not match";_++}}}return{resultPixels:v,resultMask:R,minValue:S}},a=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},s=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},A=0;A<h;A++){var m=f.pixels.blocks[A];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,h,p){var A={},m=new Uint8Array(f,h,10);if(A.fileIdentifierString=String.fromCharCode.apply(null,m),A.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+A.fileIdentifierString;h+=10;var _=new DataView(f,h,24);if(A.fileVersion=_.getInt32(0,!0),A.imageType=_.getInt32(4,!0),A.height=_.getUint32(8,!0),A.width=_.getUint32(12,!0),A.maxZError=_.getFloat64(16,!0),h+=24,!p)if(_=new DataView(f,h,16),A.mask={},A.mask.numBlocksY=_.getUint32(0,!0),A.mask.numBlocksX=_.getUint32(4,!0),A.mask.numBytes=_.getUint32(8,!0),A.mask.maxValue=_.getFloat32(12,!0),h+=16,A.mask.numBytes>0){var y=new Uint8Array(Math.ceil(A.width*A.height/8));_=new DataView(f,h,A.mask.numBytes);var C=_.getInt16(0,!0),E=2,I=0;do{if(C>0)for(;C--;)y[I++]=_.getUint8(E++);else{var x=_.getUint8(E++);for(C=-C;C--;)y[I++]=x}C=_.getInt16(E,!0),E+=2}while(E<A.mask.numBytes);if(C!==-32768||I<y.length)throw"Unexpected end of mask RLE encoding";A.mask.bitset=y,h+=A.mask.numBytes}else(A.mask.numBytes|A.mask.numBlocksY|A.mask.maxValue)===0&&(A.mask.bitset=new Uint8Array(Math.ceil(A.width*A.height/8)));_=new DataView(f,h,16),A.pixels={},A.pixels.numBlocksY=_.getUint32(0,!0),A.pixels.numBlocksX=_.getUint32(4,!0),A.pixels.numBytes=_.getUint32(8,!0),A.pixels.maxValue=_.getFloat32(12,!0),h+=16;var S=A.pixels.numBlocksX,w=A.pixels.numBlocksY,v=S+(A.width%S>0?1:0),R=w+(A.height%w>0?1:0);A.pixels.blocks=new Array(v*R);for(var N=0,L=0;L<R;L++)for(var g=0;g<v;g++){var b=0,T=f.byteLength-h;_=new DataView(f,h,Math.min(10,T));var B={};A.pixels.blocks[N++]=B;var M=_.getUint8(0);if(b++,B.encoding=M&63,B.encoding>3)throw"Invalid block encoding ("+B.encoding+")";if(B.encoding===2){h++;continue}if(M!==0&&M!==2){if(M>>=6,B.offsetType=M,M===2)B.offset=_.getInt8(1),b++;else if(M===1)B.offset=_.getInt16(1,!0),b+=2;else if(M===0)B.offset=_.getFloat32(1,!0),b+=4;else throw"Invalid block offset type";if(B.encoding===1)if(M=_.getUint8(b),b++,B.bitsPerPixel=M&63,M>>=6,B.numValidPixelsType=M,M===2)B.numValidPixels=_.getUint8(b),b++;else if(M===1)B.numValidPixels=_.getUint16(b,!0),b+=2;else if(M===0)B.numValidPixels=_.getUint32(b,!0),b+=4;else throw"Invalid valid pixel count type"}if(h+=b,B.encoding!==3){var O,G;if(B.encoding===0){var k=(A.pixels.numBytes-1)/4;if(k!==Math.floor(k))throw"uncompressed block has invalid length";O=new ArrayBuffer(k*4),G=new Uint8Array(O),G.set(new Uint8Array(f,h,k*4));var z=new Float32Array(O);B.rawData=z,h+=k*4}else if(B.encoding===1){var F=Math.ceil(B.numValidPixels*B.bitsPerPixel/8),H=Math.ceil(F/4);O=new ArrayBuffer(H*4),G=new Uint8Array(O),G.set(new Uint8Array(f,h,F)),B.stuffedData=new Uint32Array(O),h+=F}}}return A.eofOffset=h,A},u=function(f,h,p,A,m,_,y){var C=(1<<h)-1,E=0,I,x=0,S,w,v=Math.ceil((y-A)/m),R=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*R,I=0;I<p;I++){if(x===0&&(w=f[E++],x=32),x>=h)S=w>>>x-h&C,x-=h;else{var N=h-x;S=(w&C)<<N&C,w=f[E++],x=32-N,S+=w>>>x}_[I]=S<v?A+S*m:y}return _};return o})(),t=(function(){"use strict";var o={unstuff:function(c,u,f,h,p,A,m,_){var y=(1<<f)-1,C=0,E,I=0,x,S,w,v,R=c.length*4-Math.ceil(f*h/8);if(c[c.length-1]<<=8*R,p)for(E=0;E<h;E++)I===0&&(S=c[C++],I=32),I>=f?(x=S>>>I-f&y,I-=f):(w=f-I,x=(S&y)<<w&y,S=c[C++],I=32-w,x+=S>>>I),u[E]=p[x];else for(v=Math.ceil((_-A)/m),E=0;E<h;E++)I===0&&(S=c[C++],I=32),I>=f?(x=S>>>I-f&y,I-=f):(w=f-I,x=(S&y)<<w&y,S=c[C++],I=32-w,x+=S>>>I),u[E]=x<v?A+x*m:_},unstuffLUT:function(c,u,f,h,p,A){var m=(1<<u)-1,_=0,y=0,C=0,E=0,I=0,x,S=[],w=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*w;var v=Math.ceil((A-h)/p);for(y=0;y<f;y++)E===0&&(x=c[_++],E=32),E>=u?(I=x>>>E-u&m,E-=u):(C=u-E,I=(x&m)<<C&m,x=c[_++],E=32-C,I+=x>>>E),S[y]=I<v?h+I*p:A;return S.unshift(h),S},unstuff2:function(c,u,f,h,p,A,m,_){var y=(1<<f)-1,C=0,E,I=0,x=0,S,w,v;if(p)for(E=0;E<h;E++)I===0&&(w=c[C++],I=32,x=0),I>=f?(S=w>>>x&y,I-=f,x+=f):(v=f-I,S=w>>>x&y,w=c[C++],I=32-v,S|=(w&(1<<v)-1)<<f-v,x=v),u[E]=p[S];else{var R=Math.ceil((_-A)/m);for(E=0;E<h;E++)I===0&&(w=c[C++],I=32,x=0),I>=f?(S=w>>>x&y,I-=f,x+=f):(v=f-I,S=w>>>x&y,w=c[C++],I=32-v,S|=(w&(1<<v)-1)<<f-v,x=v),u[E]=S<R?A+S*m:_}return u},unstuffLUT2:function(c,u,f,h,p,A){var m=(1<<u)-1,_=0,y=0,C=0,E=0,I=0,x=0,S,w=[],v=Math.ceil((A-h)/p);for(y=0;y<f;y++)E===0&&(S=c[_++],E=32,x=0),E>=u?(I=S>>>x&m,E-=u,x+=u):(C=u-E,I=S>>>x&m,S=c[_++],E=32-C,I|=(S&(1<<C)-1)<<u-C,x=C),w[y]=I<v?h+I*p:A;return w.unshift(h),w},originalUnstuff:function(c,u,f,h){var p=(1<<f)-1,A=0,m,_=0,y,C,E,I=c.length*4-Math.ceil(f*h/8);for(c[c.length-1]<<=8*I,m=0;m<h;m++)_===0&&(C=c[A++],_=32),_>=f?(y=C>>>_-f&p,_-=f):(E=f-_,y=(C&p)<<E&p,C=c[A++],_=32-E,y+=C>>>_),u[m]=y;return u},originalUnstuff2:function(c,u,f,h){var p=(1<<f)-1,A=0,m,_=0,y=0,C,E,I;for(m=0;m<h;m++)_===0&&(E=c[A++],_=32,y=0),_>=f?(C=E>>>y&p,_-=f,y+=f):(I=f-_,C=E>>>y&p,E=c[A++],_=32-I,C|=(E&(1<<I)-1)<<f-I,y=I),u[m]=C;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,h=c.length,p=Math.floor(h/2),A=0;p;){var m=p>=359?359:p;p-=m;do u+=c[A++]<<8,f+=u+=c[A++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=c[A]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,h=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var A=new DataView(c,f,8),m=A.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=A.getUint32(4,!0),f+=4),A=new DataView(c,f,12),p.height=A.getUint32(0,!0),p.width=A.getUint32(4,!0),f+=8,m>=4?(p.numDims=A.getUint32(8,!0),f+=4):p.numDims=1,A=new DataView(c,f,40),p.numValidPixel=A.getUint32(0,!0),p.microBlockSize=A.getInt32(4,!0),p.blobSize=A.getInt32(8,!0),p.imageType=A.getInt32(12,!0),p.maxZError=A.getFloat64(16,!0),p.zMin=A.getFloat64(24,!0),p.zMax=A.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var _,y;if(m>=3&&(y=m>=4?52:48,_=this.computeChecksumFletcher32(new Uint8Array(c,f-y,p.blobSize-14)),_!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),A=this.readSubArray(c,u.ptr,h,p),m=this.readSubArray(c,u.ptr+p,h,p);u.ptr+=2*p;var _,y=!0;for(_=0;_<f.numDims;_++)if(A[_]!==m[_]){y=!1;break}return f.minValues=A,f.maxValues=m,y},readSubArray:function(c,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(c,u,h);else{var A=new ArrayBuffer(h),m=new Uint8Array(A);m.set(new Uint8Array(c,u,h)),p=new f(A)}return p},readMask:function(c,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,A=h.numValidPixel,m=new DataView(c,f,4),_={};if(_.numBytes=m.getUint32(0,!0),f+=4,(A===0||p===A)&&_.numBytes!==0)throw"invalid mask";var y,C;if(A===0)y=new Uint8Array(Math.ceil(p/8)),_.bitset=y,C=new Uint8Array(p),u.pixels.resultMask=C,f+=_.numBytes;else if(_.numBytes>0){y=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,_.numBytes);var E=m.getInt16(0,!0),I=2,x=0,S=0;do{if(E>0)for(;E--;)y[x++]=m.getUint8(I++);else for(S=m.getUint8(I++),E=-E;E--;)y[x++]=S;E=m.getInt16(I,!0),I+=2}while(I<_.numBytes);if(E!==-32768||x<y.length)throw"Unexpected end of mask RLE encoding";C=new Uint8Array(p);var w=0,v=0;for(v=0;v<p;v++)v&7?(w=y[v>>3],w<<=v&7):w=y[v>>3],w&128&&(C[v]=1);u.pixels.resultMask=C,_.bitset=y,f+=_.numBytes}return u.ptr=f,u.mask=_,!0},readDataOneSweep:function(c,u,f){var h=u.ptr,p=u.headerInfo,A=p.numDims,m=p.width*p.height,_=p.imageType,y=p.numValidPixel*r.getDataTypeSize(_)*A,C,E=u.pixels.resultMask;if(f===Uint8Array)C=new Uint8Array(c,h,y);else{var I=new ArrayBuffer(y),x=new Uint8Array(I);x.set(new Uint8Array(c,h,y)),C=new f(I)}if(C.length===m*A)u.pixels.resultPixels=C;else{u.pixels.resultPixels=new f(m*A);var S=0,w=0,v=0,R=0;if(A>1)for(v=0;v<A;v++)for(R=v*m,w=0;w<m;w++)E[w]&&(u.pixels.resultPixels[R+w]=C[S++]);else for(w=0;w<m;w++)E[w]&&(u.pixels.resultPixels[w]=C[S++])}return h+=y,u.ptr=h,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(c,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var A=h.getInt32(4,!0),m=h.getInt32(8,!0),_=h.getInt32(12,!0);if(m>=_)return!1;var y=new Uint32Array(_-m);r.decodeBits(c,u,y);var C=[],E,I,x,S;for(E=m;E<_;E++)I=E-(E<A?0:A),C[I]={first:y[E-m],second:null};var w=c.byteLength-u.ptr,v=Math.ceil(w/4),R=new ArrayBuffer(v*4),N=new Uint8Array(R);N.set(new Uint8Array(c,u.ptr,w));var L=new Uint32Array(R),g=0,b,T=0;for(b=L[0],E=m;E<_;E++)I=E-(E<A?0:A),S=C[I].first,S>0&&(C[I].second=b<<g>>>32-S,32-g>=S?(g+=S,g===32&&(g=0,T++,b=L[T])):(g+=S-32,T++,b=L[T],C[I].second|=b>>>32-g));var B=0,M=0,O=new a;for(E=0;E<C.length;E++)C[E]!==void 0&&(B=Math.max(B,C[E].first));B>=f?M=f:M=B,B>=30&&console.log("WARning, large NUM LUT BITS IS "+B);var G=[],k,z,F,H,Y,$;for(E=m;E<_;E++)if(I=E-(E<A?0:A),S=C[I].first,S>0)if(k=[S,I],S<=M)for(z=C[I].second<<M-S,F=1<<M-S,x=0;x<F;x++)G[z|x]=k;else for(z=C[I].second,$=O,H=S-1;H>=0;H--)Y=z>>>H&1,Y?($.right||($.right=new a),$=$.right):($.left||($.left=new a),$=$.left),H===0&&!$.val&&($.val=k[1]);return{decodeLut:G,numBitsLUTQick:M,numBitsLUT:B,tree:O,stuffedData:L,srcPtr:T,bitPos:g}},readHuffman:function(c,u,f){var h=u.headerInfo,p=h.numDims,A=u.headerInfo.height,m=u.headerInfo.width,_=m*A,y=this.readHuffmanTree(c,u),C=y.decodeLut,E=y.tree,I=y.stuffedData,x=y.srcPtr,S=y.bitPos,w=y.numBitsLUTQick,v=y.numBitsLUT,R=u.headerInfo.imageType===0?128:0,N,L,g,b=u.pixels.resultMask,T,B,M,O,G,k,z,F=0;S>0&&(x++,S=0);var H=I[x],Y=u.encodeMode===1,$=new f(_*p),W=$,K;for(K=0;K<h.numDims;K++){if(p>1&&(W=new f($.buffer,_*K,_),F=0),u.headerInfo.numValidPixel===m*A)for(k=0,O=0;O<A;O++)for(G=0;G<m;G++,k++){if(L=0,T=H<<S>>>32-w,B=T,32-S<w&&(T|=I[x+1]>>>64-S-w,B=T),C[B])L=C[B][1],S+=C[B][0];else for(T=H<<S>>>32-v,B=T,32-S<v&&(T|=I[x+1]>>>64-S-v,B=T),N=E,z=0;z<v;z++)if(M=T>>>v-z-1&1,N=M?N.right:N.left,!(N.left||N.right)){L=N.val,S=S+z+1;break}S>=32&&(S-=32,x++,H=I[x]),g=L-R,Y?(G>0?g+=F:O>0?g+=W[k-m]:g+=F,g&=255,W[k]=g,F=g):W[k]=g}else for(k=0,O=0;O<A;O++)for(G=0;G<m;G++,k++)if(b[k]){if(L=0,T=H<<S>>>32-w,B=T,32-S<w&&(T|=I[x+1]>>>64-S-w,B=T),C[B])L=C[B][1],S+=C[B][0];else for(T=H<<S>>>32-v,B=T,32-S<v&&(T|=I[x+1]>>>64-S-v,B=T),N=E,z=0;z<v;z++)if(M=T>>>v-z-1&1,N=M?N.right:N.left,!(N.left||N.right)){L=N.val,S=S+z+1;break}S>=32&&(S-=32,x++,H=I[x]),g=L-R,Y?(G>0&&b[k-1]?g+=F:O>0&&b[k-m]?g+=W[k-m]:g+=F,g&=255,W[k]=g,F=g):W[k]=g}u.ptr=u.ptr+(x+1)*4+(S>0?4:0)}u.pixels.resultPixels=$},decodeBits:function(c,u,f,h,p){{var A=u.headerInfo,m=A.fileVersion,_=0,y=new DataView(c,u.ptr,5),C=y.getUint8(0);_++;var E=C>>6,I=E===0?4:3-E,x=(C&32)>0,S=C&31,w=0;if(I===1)w=y.getUint8(_),_++;else if(I===2)w=y.getUint16(_,!0),_+=2;else if(I===4)w=y.getUint32(_,!0),_+=4;else throw"Invalid valid pixel count type";var v=2*A.maxZError,R,N,L,g,b,T,B,M,O,G,k=A.numDims>1?A.maxValues[p]:A.zMax;if(x){for(u.counter.lut++,M=y.getUint8(_),O=S,_++,g=Math.ceil((M-1)*S/8),b=Math.ceil(g/4),N=new ArrayBuffer(b*4),L=new Uint8Array(N),u.ptr+=_,L.set(new Uint8Array(c,u.ptr,g)),B=new Uint32Array(N),u.ptr+=g,G=0;M-1>>>G;)G++;g=Math.ceil(w*G/8),b=Math.ceil(g/4),N=new ArrayBuffer(b*4),L=new Uint8Array(N),L.set(new Uint8Array(c,u.ptr,g)),R=new Uint32Array(N),u.ptr+=g,m>=3?T=o.unstuffLUT2(B,S,M-1,h,v,k):T=o.unstuffLUT(B,S,M-1,h,v,k),m>=3?o.unstuff2(R,f,G,w,T):o.unstuff(R,f,G,w,T)}else u.counter.bitstuffer++,G=S,u.ptr+=_,G>0&&(g=Math.ceil(w*G/8),b=Math.ceil(g/4),N=new ArrayBuffer(b*4),L=new Uint8Array(N),L.set(new Uint8Array(c,u.ptr,g)),R=new Uint32Array(N),u.ptr+=g,m>=3?h==null?o.originalUnstuff2(R,f,G,w):o.unstuff2(R,f,G,w,!1,h,v,k):h==null?o.originalUnstuff(R,f,G,w):o.unstuff(R,f,G,w,!1,h,v,k))}},readTiles:function(c,u,f){var h=u.headerInfo,p=h.width,A=h.height,m=h.microBlockSize,_=h.imageType,y=r.getDataTypeSize(_),C=Math.ceil(p/m),E=Math.ceil(A/m);u.pixels.numBlocksY=E,u.pixels.numBlocksX=C,u.pixels.ptr=0;var I=0,x=0,S=0,w=0,v=0,R=0,N=0,L=0,g=0,b=0,T=0,B=0,M=0,O=0,G=0,k=0,z,F,H,Y,$,W,K=new f(m*m),Z=A%m||m,pe=p%m||m,ge,re,ye=h.numDims,Ce,ve=u.pixels.resultMask,Ne=u.pixels.resultPixels;for(S=0;S<E;S++)for(v=S!==E-1?m:Z,w=0;w<C;w++)for(R=w!==C-1?m:pe,T=S*p*m+w*m,B=p-R,Ce=0;Ce<ye;Ce++){if(ye>1&&(Ne=new f(u.pixels.resultPixels.buffer,p*A*Ce*y,p*A)),N=c.byteLength-u.ptr,z=new DataView(c,u.ptr,Math.min(10,N)),F={},k=0,L=z.getUint8(0),k++,g=L>>6&255,b=L>>2&15,b!==(w*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=k,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=k;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=k,M=v*R*y,O=c.byteLength-u.ptr,M=M<O?M:O,H=new ArrayBuffer(M%y===0?M:M+y-M%y),Y=new Uint8Array(H),Y.set(new Uint8Array(c,u.ptr,M)),$=new f(H),G=0,ve)for(I=0;I<v;I++){for(x=0;x<R;x++)ve[T]&&(Ne[T]=$[G++]),T++;T+=B}else for(I=0;I<v;I++){for(x=0;x<R;x++)Ne[T++]=$[G++];T+=B}u.ptr+=G*y}else if(ge=r.getDataTypeUsed(_,g),re=r.getOnePixel(F,k,ge,z),k+=r.getDataTypeSize(ge),W===3)if(u.ptr+=k,u.counter.constantoffset++,ve)for(I=0;I<v;I++){for(x=0;x<R;x++)ve[T]&&(Ne[T]=re),T++;T+=B}else for(I=0;I<v;I++){for(x=0;x<R;x++)Ne[T++]=re;T+=B}else if(u.ptr+=k,r.decodeBits(c,u,K,re,Ce),k=0,ve)for(I=0;I<v;I++){for(x=0;x<R;x++)ve[T]&&(Ne[T]=K[k++]),T++;T+=B}else for(I=0;I<v;I++){for(x=0;x<R;x++)Ne[T++]=K[k++];T+=B}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:r.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,h=c.headerInfo.height*c.headerInfo.width,p=h*f,A=0,m=0,_=0,y=c.pixels.resultMask;if(y)if(f>1)for(A=0;A<f;A++)for(_=A*h,m=0;m<h;m++)y[m]&&(c.pixels.resultPixels[_+m]=u);else for(m=0;m<h;m++)y[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},a=function(c,u,f){this.val=c,this.left=u,this.right=f},s={decode:function(c,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var A=p.headerInfo,m=A.fileVersion,_=r.getDataTypeArray(A.imageType);r.readMask(c,p),A.numValidPixel!==A.width*A.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var y=A.width*A.height;if(p.pixels.resultPixels=new _(y*A.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},A.numValidPixel!==0)if(A.zMax===A.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var C=new DataView(c,p.ptr,2),E=C.getUint8(0);if(p.ptr++,E)r.readDataOneSweep(c,p,_);else if(m>1&&A.imageType<=1&&Math.abs(A.maxZError-.5)<1e-5){var I=C.getUint8(1);if(p.ptr++,p.encodeMode=I,I>2||m<4&&I>1)throw"Invalid Huffman flag "+I;I?r.readHuffman(c,p,_):r.readTiles(c,p,_)}else r.readTiles(c,p,_)}p.eofOffset=p.ptr;var x;u.inputOffset?(x=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(x)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(x=p.headerInfo.blobSize-p.ptr,Math.abs(x)>=1&&(p.eofOffset=p.headerInfo.blobSize));var S={width:A.width,height:A.height,pixelData:p.pixels.resultPixels,minValue:A.zMin,maxValue:A.zMax,validPixelCount:A.numValidPixel,dimCount:A.numDims,dimStats:{minValues:A.minValues,maxValues:A.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(A.imageType,f)){var w=p.pixels.resultMask;for(h=0;h<y;h++)w[h]||(S.pixelData[h]=f);S.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(S.fileInfo=r.formatFileInfo(p)),S}},getBandCount:function(c){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<c.byteLength-58;)r.readHeaderInfo(c,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};return s})(),n=(function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),a=new Uint32Array(o);return a[0]=1,r[0]===1})(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var a=r.inputOffset||0,s=new Uint8Array(o,a,10),c=String.fromCharCode.apply(null,s),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var h=0,p=o.byteLength-10,A,m=[],_,y,C={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};a<p;){var E=u.decode(o,{inputOffset:a,encodedMaskData:A,maskData:y,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});a=E.fileInfo.eofOffset,h===0&&(A=E.encodedMaskData,y=E.maskData,C.width=E.width,C.height=E.height,C.dimCount=E.dimCount||1,C.pixelType=E.pixelType||E.fileInfo.pixelType,C.mask=E.maskData),f>1&&E.fileInfo.mask&&E.fileInfo.mask.numBytes>0&&m.push(E.maskData),h++,C.pixels.push(E.pixelData),C.statistics.push({minValue:E.minValue,maxValue:E.maxValue,noDataValue:E.noDataValue,dimStats:E.dimStats})}var I,x,S;if(f>1&&m.length>1){for(S=C.width*C.height,C.bandMasks=m,y=new Uint8Array(S),y.set(m[0]),I=1;I<m.length;I++)for(_=m[I],x=0;x<S;x++)y[x]=y[x]&_[x];C.maskData=y}return C}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof S9<"u"&&S9.exports?S9.exports=i:this.Lerc=i})()});var qDe=Xd((qwo,YDe)=>{YDe.exports={webm:"data:video/webm;base64,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",mp4:"data:video/mp4;base64,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"}});var XDe=Xd((Kwo,KDe)=>{var{webm:oLt,mp4:rLt}=qDe(),Fte=()=>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,Qte=()=>"wakeLock"in navigator,kte=class{constructor(){if(this.enabled=!1,Qte()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else Fte()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",oLt),this._addSourceToVideo(this.noSleepVideo,"mp4",rLt),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 Qte()?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}):Fte()?(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(){Qte()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):Fte()?this.noSleepTimer&&(console.warn(`
|
|
NoSleep now disabled for older iOS devices.
|
|
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};KDe.exports=kte});var jte=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],K5=1,fw=8,wC=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!==K5)throw new Error(`Got v${o} data when expected v${K5}.`);let r=jte[i&15];if(!r)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,a,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=jte.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,s=t*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%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,fw,t),this.coords=new this.ArrayType(this.data,fw+s+c,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(fw+a+s+c),this.ids=new this.IndexArrayType(this.data,fw,t),this.coords=new this.ArrayType(this.data,fw+s+c,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(K5<<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 J5(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:a,nodeSize:s}=this,c=[0,r.length-1,0],u=[];for(;c.length;){let f=c.pop()||0,h=c.pop()||0,p=c.pop()||0;if(h-p<=s){for(let y=p;y<=h;y++){let C=a[2*y],E=a[2*y+1];C>=t&&C<=i&&E>=n&&E<=o&&u.push(r[y])}continue}let A=p+h>>1,m=a[2*A],_=a[2*A+1];m>=t&&m<=i&&_>=n&&_<=o&&u.push(r[A]),(f===0?t<=m:n<=_)&&(c.push(p),c.push(A-1),c.push(1-f)),(f===0?i>=m:o>=_)&&(c.push(A+1),c.push(h),c.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:a}=this,s=[0,o.length-1,0],c=[],u=i*i;for(;s.length;){let f=s.pop()||0,h=s.pop()||0,p=s.pop()||0;if(h-p<=a){for(let y=p;y<=h;y++)Yte(r[2*y],r[2*y+1],t,n)<=u&&c.push(o[y]);continue}let A=p+h>>1,m=r[2*A],_=r[2*A+1];Yte(m,_,t,n)<=u&&c.push(o[A]),(f===0?t-i<=m:n-i<=_)&&(s.push(p),s.push(A-1),s.push(1-f)),(f===0?t+i>=m:n+i>=_)&&(s.push(A+1),s.push(h),s.push(1-f))}return c}};function J5(e,t,n,i,o,r){if(o-i<=n)return;let a=i+o>>1;qte(e,t,a,i,o,r),J5(e,t,n,i,a-1,1-r),J5(e,t,n,a+1,o,1-r)}function qte(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),A=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+A)),_=Math.min(o,Math.floor(n+(u-f)*p/u+A));qte(e,t,n,m,_,r)}let a=t[2*n+r],s=i,c=o;for(dw(e,t,i,n),t[2*o+r]>a&&dw(e,t,i,o);s<c;){for(dw(e,t,s,c),s++,c--;t[2*s+r]<a;)s++;for(;t[2*c+r]>a;)c--}t[2*i+r]===a?dw(e,t,i,c):(c++,dw(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function dw(e,t,n,i){X5(e,n,i),X5(t,2*n,2*i),X5(t,2*n+1,2*i+1)}function X5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Yte(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}var gI={},Cve={KDBush:wC,addCache:function(e,t){return gI[e]=t,t},removeCache:function(e){delete gI[e]},getCache:function(e){return gI[e]},getCacheOrAdd:function(e){return gI[e]||(gI[e]={}),gI[e]}},Lg=Cve;function Eve(e){return e!=null}var l=Eve;function BC(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(BC.prototype=Object.create(Error.prototype),BC.prototype.constructor=BC);BC.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
|
|
${this.stack.toString()}`),e};BC.throwInstantiationError=function(){throw new BC("This function defines an interface and should not be called directly.")};var de=BC;var $a={};$a.typeOf={};function Ive(e){return`${e} is required, actual value was undefined`}function _I(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}$a.defined=function(e,t){if(!l(t))throw new de(Ive(e))};$a.typeOf.func=function(e,t){if(typeof t!="function")throw new de(_I(typeof t,"function",e))};$a.typeOf.string=function(e,t){if(typeof t!="string")throw new de(_I(typeof t,"string",e))};$a.typeOf.number=function(e,t){if(typeof t!="number")throw new de(_I(typeof t,"number",e))};$a.typeOf.number.lessThan=function(e,t,n){if($a.typeOf.number(e,t),t>=n)throw new de(`Expected ${e} to be less than ${n}, actual value was ${t}`)};$a.typeOf.number.lessThanOrEquals=function(e,t,n){if($a.typeOf.number(e,t),t>n)throw new de(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};$a.typeOf.number.greaterThan=function(e,t,n){if($a.typeOf.number(e,t),t<=n)throw new de(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};$a.typeOf.number.greaterThanOrEquals=function(e,t,n){if($a.typeOf.number(e,t),t<n)throw new de(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};$a.typeOf.object=function(e,t){if(typeof t!="object")throw new de(_I(typeof t,"object",e))};$a.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new de(_I(typeof t,"boolean",e))};$a.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new de(_I(typeof t,"bigint",e))};$a.typeOf.number.equals=function(e,t,n,i){if($a.typeOf.number(e,n),$a.typeOf.number(t,i),n!==i)throw new de(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Wo=$a;var Z5=Na(aM(),1);var pt={};pt.EPSILON1=.1;pt.EPSILON2=.01;pt.EPSILON3=.001;pt.EPSILON4=1e-4;pt.EPSILON5=1e-5;pt.EPSILON6=1e-6;pt.EPSILON7=1e-7;pt.EPSILON8=1e-8;pt.EPSILON9=1e-9;pt.EPSILON10=1e-10;pt.EPSILON11=1e-11;pt.EPSILON12=1e-12;pt.EPSILON13=1e-13;pt.EPSILON14=1e-14;pt.EPSILON15=1e-15;pt.EPSILON16=1e-16;pt.EPSILON17=1e-17;pt.EPSILON18=1e-18;pt.EPSILON19=1e-19;pt.EPSILON20=1e-20;pt.EPSILON21=1e-21;pt.GRAVITATIONALPARAMETER=3986004418e5;pt.SOLAR_RADIUS=6955e5;pt.LUNAR_RADIUS=1737400;pt.SIXTY_FOUR_KILOBYTES=64*1024;pt.FOUR_GIGABYTES=4*1024*1024*1024;pt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};pt.signNotZero=function(e){return e<0?-1:1};pt.toSNorm=function(e,t){return t=t??255,Math.round((pt.clamp(e,-1,1)*.5+.5)*t)};pt.fromSNorm=function(e,t){return t=t??255,pt.clamp(e,0,t)/t*2-1};pt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:pt.clamp((e-t)/n,0,1)};pt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};pt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};pt.lerp=function(e,t,n){return(1-n)*e+n*t};pt.PI=Math.PI;pt.ONE_OVER_PI=1/Math.PI;pt.PI_OVER_TWO=Math.PI/2;pt.PI_OVER_THREE=Math.PI/3;pt.PI_OVER_FOUR=Math.PI/4;pt.PI_OVER_SIX=Math.PI/6;pt.THREE_PI_OVER_TWO=3*Math.PI/2;pt.TWO_PI=2*Math.PI;pt.ONE_OVER_TWO_PI=1/(2*Math.PI);pt.RADIANS_PER_DEGREE=Math.PI/180;pt.DEGREES_PER_RADIAN=180/Math.PI;pt.RADIANS_PER_ARCSECOND=pt.RADIANS_PER_DEGREE/3600;pt.toRadians=function(e){return e*pt.RADIANS_PER_DEGREE};pt.toDegrees=function(e){return e*pt.DEGREES_PER_RADIAN};pt.convertLongitudeRange=function(e){let t=pt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};pt.clampToLatitudeRange=function(e){return pt.clamp(e,-1*pt.PI_OVER_TWO,pt.PI_OVER_TWO)};pt.negativePiToPi=function(e){return e>=-pt.PI&&e<=pt.PI?e:pt.zeroToTwoPi(e+pt.PI)-pt.PI};pt.zeroToTwoPi=function(e){if(e>=0&&e<=pt.TWO_PI)return e;let t=pt.mod(e,pt.TWO_PI);return Math.abs(t)<pt.EPSILON14&&Math.abs(e)>pt.EPSILON14?pt.TWO_PI:t};pt.mod=function(e,t){return pt.sign(e)===pt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};pt.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};pt.lessThan=function(e,t,n){return e-t<-n};pt.lessThanOrEquals=function(e,t,n){return e-t<n};pt.greaterThan=function(e,t,n){return e-t>n};pt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var sM=[1];pt.factorial=function(e){let t=sM.length;if(e>=t){let n=sM[t-1];for(let i=t;i<=e;i++){let o=n*i;sM.push(o),n=o}}return sM[e]};pt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};pt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};pt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};pt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};pt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var Xte=new Z5.default;pt.setRandomNumberSeed=function(e){Xte=new Z5.default(e)};pt.nextRandomNumber=function(){return Xte.random()};pt.randomBetween=function(e,t){return pt.nextRandomNumber()*(t-e)+e};pt.acosClamped=function(e){return Math.acos(pt.clamp(e,-1,1))};pt.asinClamped=function(e){return Math.asin(pt.clamp(e,-1,1))};pt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};pt.logBase=function(e,t){return Math.log(e)/Math.log(t)};pt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};pt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};pt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};pt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};pt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=pt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?pt.PI_OVER_TWO-i:i,i=e<0?pt.PI-i:i,i=t<0?-i:i,i};var D=pt;var or=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,o=t.cone,r=t.magnitude??1,a=r*Math.sin(o);return n.x=a*Math.cos(i),n.y=a*Math.sin(i),n.z=r*Math.cos(o),n}static fromElements(t,n,i,o){return l(o)?(o.x=t,o.y=n,o.z=i,o):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,o=i*3;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=o/3;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z);return o.x=r,o.y=a,o.z=s,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,cM),e.magnitude(cM)}static distanceSquared(t,n){return e.subtract(t,n,cM),e.magnitudeSquared(cM)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,Jte),o=e.multiplyByScalar(t,1-i,o),e.add(Jte,o,o)}static angleBetween(t,n){e.normalize(t,lM),e.normalize(n,$5);let i=e.dot(lM,$5),o=e.magnitude(e.cross(lM,$5,lM));return Math.atan2(o,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,bve);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let o=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,o,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)&&D.equalsEpsilon(t.z,n.z,i,o)}static cross(t,n,i){let o=t.x,r=t.y,a=t.z,s=n.x,c=n.y,u=n.z,f=r*u-a*c,h=a*s-o*u,p=o*c-r*s;return i.x=f,i.y=h,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,o,r){return t=D.toRadians(t),n=D.toRadians(n),e.fromRadians(t,n,i,o,r)}static fromRadians(t,n,i,o,r){i=i??0;let a=l(o)?o.radiiSquared:e._ellipsoidRadiiSquared,s=Math.cos(n);Nf.x=s*Math.cos(t),Nf.y=s*Math.sin(t),Nf.z=Math.sin(n),Nf=e.normalize(Nf,Nf),e.multiplyComponents(a,Nf,yI);let c=Math.sqrt(e.dot(Nf,yI));return yI=e.divideByScalar(yI,c,yI),Nf=e.multiplyByScalar(Nf,i,Nf),l(r)||(r=new e),e.add(yI,Nf,r)}static fromDegreesArray(t,n,i){let o=t.length;l(i)?i.length=o/2:i=new Array(o/2);for(let r=0;r<o;r+=2){let a=t[r],s=t[r+1],c=r/2;i[c]=e.fromDegrees(a,s,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let o=t.length;l(i)?i.length=o/2:i=new Array(o/2);for(let r=0;r<o;r+=2){let a=t[r],s=t[r+1],c=r/2;i[c]=e.fromRadians(a,s,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let o=t.length;l(i)?i.length=o/3:i=new Array(o/3);for(let r=0;r<o;r+=3){let a=t[r],s=t[r+1],c=t[r+2],u=r/3;i[u]=e.fromDegrees(a,s,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let o=t.length;l(i)?i.length=o/3:i=new Array(o/3);for(let r=0;r<o;r+=3){let a=t[r],s=t[r+1],c=t[r+2],u=r/3;i[u]=e.fromRadians(a,s,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};or.fromCartesian4=or.clone;or.packedLength=3;or.fromArray=or.unpack;var cM=new or,Jte=new or,lM=new or,$5=new or,bve=new or,Nf=new or,yI=new or;or._ellipsoidRadiiSquared=new or(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);or.ZERO=Object.freeze(new or(0,0,0));or.ONE=Object.freeze(new or(1,1,1));or.UNIT_X=Object.freeze(new or(1,0,0));or.UNIT_Y=Object.freeze(new or(0,1,0));or.UNIT_Z=Object.freeze(new or(0,0,1));var d=or;var La=class e{constructor(t,n,i,o){this.x=t??0,this.y=n??0,this.z=i??0,this.w=o??0}static fromElements(t,n,i,o,r){return l(r)?(r.x=t,r.y=n,r.z=i,r.w=o,r):new e(t,n,i,o)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,o=i*4;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let o=0;o<i;o+=4){let r=o/4;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y),s=D.clamp(t.z,n.z,i.z),c=D.clamp(t.w,n.w,i.w);return o.x=r,o.y=a,o.z=s,o.w=c,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,uM),e.magnitude(uM)}static distanceSquared(t,n){return e.subtract(t,n,uM),e.magnitudeSquared(uM)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,Zte),o=e.multiplyByScalar(t,1-i,o),e.add(Zte,o,o)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,xve);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)&&D.equalsEpsilon(t.z,n.z,i,o)&&D.equalsEpsilon(t.w,n.w,i,o)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),eW[0]=t,$te?(n.x=Bc[0],n.y=Bc[1],n.z=Bc[2],n.w=Bc[3]):(n.x=Bc[3],n.y=Bc[2],n.z=Bc[1],n.w=Bc[0]),n}static unpackFloat(t){return $te?(Bc[0]=t.x,Bc[1]=t.y,Bc[2]=t.z,Bc[3]=t.w):(Bc[0]=t.w,Bc[1]=t.z,Bc[2]=t.y,Bc[3]=t.x),eW[0]}};La.packedLength=4;La.fromArray=La.unpack;var uM=new La,Zte=new La,xve=new La;La.ZERO=Object.freeze(new La(0,0,0,0));La.ONE=Object.freeze(new La(1,1,1,1));La.UNIT_X=Object.freeze(new La(1,0,0,0));La.UNIT_Y=Object.freeze(new La(0,1,0,0));La.UNIT_Z=Object.freeze(new La(0,0,1,0));La.UNIT_W=Object.freeze(new La(0,0,0,1));var eW=new Float32Array(1),Bc=new Uint8Array(eW.buffer),Tve=new Uint32Array([287454020]),Sve=new Uint8Array(Tve.buffer),$te=Sve[0]===68,ie=La;var tW={};tW.EMPTY_OBJECT=Object.freeze({});tW.EMPTY_ARRAY=Object.freeze([]);var V=tW;function ut(e,t,n,i,o,r,a,s,c){this[0]=e??0,this[1]=i??0,this[2]=a??0,this[3]=t??0,this[4]=o??0,this[5]=s??0,this[6]=n??0,this[7]=r??0,this[8]=c??0}ut.packedLength=9;ut.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};ut.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ut),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};ut.packArray=function(e,t){let n=e.length,i=n*9;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)ut.pack(e[o],t,o*9);return t};ut.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=ut.unpack(e,i,t[o])}return t};ut.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):new ut(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};ut.fromArray=ut.unpack;ut.fromColumnMajorArray=function(e,t){return ut.clone(e,t)};ut.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],t):new ut(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};ut.fromQuaternion=function(e,t){let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,a=e.y*e.y,s=e.y*e.z,c=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-a-u+h,A=2*(i-f),m=2*(o+c),_=2*(i+f),y=-n+a-u+h,C=2*(s-r),E=2*(o-c),I=2*(s+r),x=-n-a+u+h;return l(t)?(t[0]=p,t[1]=_,t[2]=E,t[3]=A,t[4]=y,t[5]=I,t[6]=m,t[7]=C,t[8]=x,t):new ut(p,A,m,_,y,C,E,I,x)};ut.fromHeadingPitchRoll=function(e,t){let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),a=Math.sin(-e.heading),s=Math.sin(e.roll),c=n*i,u=-o*a+s*r*i,f=s*a+o*r*i,h=n*a,p=o*i+s*r*a,A=-s*i+o*r*a,m=-r,_=s*n,y=o*n;return l(t)?(t[0]=c,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=_,t[6]=f,t[7]=A,t[8]=y,t):new ut(c,u,f,h,p,A,m,_,y)};ut.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new ut(e.x,0,0,0,e.y,0,0,0,e.z)};ut.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new ut(e,0,0,0,e,0,0,0,e)};ut.fromCrossProduct=function(e,t){return l(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new ut(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};ut.fromRotationX=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new ut(1,0,0,0,n,-i,0,i,n)};ut.fromRotationY=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new ut(n,0,i,0,1,0,-i,0,n)};ut.fromRotationZ=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new ut(n,-i,0,i,n,0,0,0,1)};ut.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};ut.getElementIndex=function(e,t){return e*3+t};ut.getColumn=function(e,t,n){let i=t*3,o=e[i],r=e[i+1],a=e[i+2];return n.x=o,n.y=r,n.z=a,n};ut.setColumn=function(e,t,n,i){i=ut.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};ut.getRow=function(e,t,n){let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};ut.setRow=function(e,t,n,i){return i=ut.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var wve=new d;ut.setScale=function(e,t,n){let i=ut.getScale(e,wve),o=t.x/i.x,r=t.y/i.y,a=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]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};var Bve=new d;ut.setUniformScale=function(e,t,n){let i=ut.getScale(e,Bve),o=t/i.x,r=t/i.y,a=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]*a,n[7]=e[7]*a,n[8]=e[8]*a,n};var nW=new d;ut.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],nW)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],nW)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],nW)),t};var ene=new d;ut.getMaximumScale=function(e){return ut.getScale(e,ene),d.maximumComponent(ene)};var Dve=new d;ut.setRotation=function(e,t,n){let i=ut.getScale(e,Dve);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 vve=new d;ut.getRotation=function(e,t){let n=ut.getScale(e,vve);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};ut.multiply=function(e,t,n){let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],a=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],s=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],c=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=a,n[4]=s,n[5]=c,n[6]=u,n[7]=f,n[8]=h,n};ut.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};ut.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};ut.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=e[0]*i+e[3]*o+e[6]*r,s=e[1]*i+e[4]*o+e[7]*r,c=e[2]*i+e[5]*o+e[8]*r;return n.x=a,n.y=s,n.z=c,n};ut.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};ut.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};ut.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};ut.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t};ut.transpose=function(e,t){let n=e[0],i=e[3],o=e[6],r=e[1],a=e[4],s=e[7],c=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=a,t[5]=s,t[6]=c,t[7]=u,t[8]=f,t};function Pve(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var iW=[1,0,0],oW=[2,2,1];function Rve(e){let t=0;for(let n=0;n<3;++n){let i=e[ut.getElementIndex(oW[n],iW[n])];t+=2*i*i}return Math.sqrt(t)}function Mve(e,t){let n=D.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[ut.getElementIndex(oW[u],iW[u])]);f>i&&(o=u,i=f)}let r=1,a=0,s=iW[o],c=oW[o];if(Math.abs(e[ut.getElementIndex(c,s)])>n){let u=e[ut.getElementIndex(c,c)],f=e[ut.getElementIndex(s,s)],h=e[ut.getElementIndex(c,s)],p=(u-f)/2/h,A;p<0?A=-1/(-p+Math.sqrt(1+p*p)):A=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+A*A),a=A*r}return t=ut.clone(ut.IDENTITY,t),t[ut.getElementIndex(s,s)]=t[ut.getElementIndex(c,c)]=r,t[ut.getElementIndex(c,s)]=a,t[ut.getElementIndex(s,c)]=-a,t}var fM=new ut,tne=new ut;ut.computeEigenDecomposition=function(e,t){let n=D.EPSILON20,i=10,o=0,r=0;l(t)||(t={});let a=t.unitary=ut.clone(ut.IDENTITY,t.unitary),s=t.diagonal=ut.clone(e,t.diagonal),c=n*Pve(s);for(;r<i&&Rve(s)>c;)Mve(s,fM),ut.transpose(fM,tne),ut.multiply(s,fM,s),ut.multiply(tne,s,s),ut.multiply(a,fM,a),++o>2&&(++r,o=0);return t};ut.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};ut.determinant=function(e){let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],a=e[7],s=e[2],c=e[5],u=e[8];return t*(r*u-c*a)+o*(c*i-n*u)+s*(n*a-r*i)};ut.inverse=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[3],a=e[4],s=e[5],c=e[6],u=e[7],f=e[8],h=ut.determinant(e);t[0]=a*f-u*s,t[1]=u*o-i*f,t[2]=i*s-a*o,t[3]=c*s-r*f,t[4]=n*f-c*o,t[5]=r*o-n*s,t[6]=r*u-c*a,t[7]=c*i-n*u,t[8]=n*a-r*i;let p=1/h;return ut.multiplyByScalar(t,p,t)};var Nve=new ut;ut.inverseTranspose=function(e,t){return ut.inverse(ut.transpose(e,Nve),t)};ut.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]};ut.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};ut.IDENTITY=Object.freeze(new ut(1,0,0,0,1,0,0,0,1));ut.ZERO=Object.freeze(new ut(0,0,0,0,0,0,0,0,0));ut.COLUMN0ROW0=0;ut.COLUMN0ROW1=1;ut.COLUMN0ROW2=2;ut.COLUMN1ROW0=3;ut.COLUMN1ROW1=4;ut.COLUMN1ROW2=5;ut.COLUMN2ROW0=6;ut.COLUMN2ROW1=7;ut.COLUMN2ROW2=8;Object.defineProperties(ut.prototype,{length:{get:function(){return ut.packedLength}}});ut.prototype.clone=function(e){return ut.clone(this,e)};ut.prototype.equals=function(e){return ut.equals(this,e)};ut.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]};ut.prototype.equalsEpsilon=function(e,t){return ut.equalsEpsilon(this,e,t)};ut.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
|
|
(${this[1]}, ${this[4]}, ${this[7]})
|
|
(${this[2]}, ${this[5]}, ${this[8]})`};var J=ut;function hw(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(hw.prototype=Object.create(Error.prototype),hw.prototype.constructor=hw);hw.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=`
|
|
${this.stack.toString()}`),e};var ue=hw;function ct(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_){this[0]=e??0,this[1]=o??0,this[2]=c??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=A??0,this[8]=n??0,this[9]=a??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=s??0,this[14]=h??0,this[15]=_??0}ct.packedLength=16;ct.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};ct.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ct),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};ct.packArray=function(e,t){let n=e.length,i=n*16;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)ct.pack(e[o],t,o*16);return t};ct.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=ct.unpack(e,i,t[o])}return t};ct.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):new ct(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])};ct.fromArray=ct.unpack;ct.fromColumnMajorArray=function(e,t){return ct.clone(e,t)};ct.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15],t):new ct(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])};ct.fromRotationTranslation=function(e,t,n){return t=t??d.ZERO,l(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new ct(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)};ct.fromTranslationQuaternionRotationScale=function(e,t,n,i){l(i)||(i=new ct);let o=n.x,r=n.y,a=n.z,s=t.x*t.x,c=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,A=t.y*t.w,m=t.z*t.z,_=t.z*t.w,y=t.w*t.w,C=s-h-m+y,E=2*(c-_),I=2*(u+A),x=2*(c+_),S=-s+h-m+y,w=2*(p-f),v=2*(u-A),R=2*(p+f),N=-s-h+m+y;return i[0]=C*o,i[1]=x*o,i[2]=v*o,i[3]=0,i[4]=E*r,i[5]=S*r,i[6]=R*r,i[7]=0,i[8]=I*a,i[9]=w*a,i[10]=N*a,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};ct.fromTranslationRotationScale=function(e,t){return ct.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};ct.fromTranslation=function(e,t){return ct.fromRotationTranslation(J.IDENTITY,e,t)};ct.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new ct(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};ct.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new ct(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};ct.fromRotation=function(e,t){return l(t)||(t=new ct),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 CI=new d,EI=new d,mw=new d;ct.fromCamera=function(e,t){let n=e.position,i=e.direction,o=e.up;d.normalize(i,CI),d.normalize(d.cross(CI,o,EI),EI),d.normalize(d.cross(EI,CI,mw),mw);let r=EI.x,a=EI.y,s=EI.z,c=CI.x,u=CI.y,f=CI.z,h=mw.x,p=mw.y,A=mw.z,m=n.x,_=n.y,y=n.z,C=r*-m+a*-_+s*-y,E=h*-m+p*-_+A*-y,I=c*m+u*_+f*y;return l(t)?(t[0]=r,t[1]=h,t[2]=-c,t[3]=0,t[4]=a,t[5]=p,t[6]=-u,t[7]=0,t[8]=s,t[9]=A,t[10]=-f,t[11]=0,t[12]=C,t[13]=E,t[14]=I,t[15]=1,t):new ct(r,a,s,C,h,p,A,E,-c,-u,-f,I,0,0,0,1)};ct.computePerspectiveFieldOfView=function(e,t,n,i,o){let a=1/Math.tan(e*.5),s=a/t,c=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=c,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};ct.computeOrthographicOffCenter=function(e,t,n,i,o,r,a){let s=1/(t-e),c=1/(i-n),u=1/(r-o),f=-(t+e)*s,h=-(i+n)*c,p=-(r+o)*u;return s*=2,c*=2,u*=-2,a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=u,a[11]=0,a[12]=f,a[13]=h,a[14]=p,a[15]=1,a};ct.computePerspectiveOffCenter=function(e,t,n,i,o,r,a){let s=2*o/(t-e),c=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,A=-2*r*o/(r-o);return a[0]=s,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=c,a[6]=0,a[7]=0,a[8]=u,a[9]=f,a[10]=h,a[11]=p,a[12]=0,a[13]=0,a[14]=A,a[15]=0,a};ct.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){let a=2*o/(t-e),s=2*o/(i-n),c=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,h=-1,p=-2*o;return r[0]=a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=s,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};ct.computeViewportTransformation=function(e,t,n,i){l(i)||(i=new ct),e=e??V.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,a=e.width??0,s=e.height??0;t=t??0,n=n??1;let c=a*.5,u=s*.5,f=(n-t)*.5,h=c,p=u,A=f,m=o+c,_=r+u,y=t+f,C=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=A,i[11]=0,i[12]=m,i[13]=_,i[14]=y,i[15]=C,i};ct.computeView=function(e,t,n,i,o){return o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};ct.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]};ct.getElementIndex=function(e,t){return e*4+t};ct.getColumn=function(e,t,n){let i=t*4,o=e[i],r=e[i+1],a=e[i+2],s=e[i+3];return n.x=o,n.y=r,n.z=a,n.w=s,n};ct.setColumn=function(e,t,n,i){i=ct.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};ct.getRow=function(e,t,n){let i=e[t],o=e[t+4],r=e[t+8],a=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=a,n};ct.setRow=function(e,t,n,i){return i=ct.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};ct.setTranslation=function(e,t,n){return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var Lve=new d;ct.setScale=function(e,t,n){let i=ct.getScale(e,Lve),o=t.x/i.x,r=t.y/i.y,a=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]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var Ove=new d;ct.setUniformScale=function(e,t,n){let i=ct.getScale(e,Ove),o=t/i.x,r=t/i.y,a=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]*a,n[9]=e[9]*a,n[10]=e[10]*a,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var rW=new d;ct.getScale=function(e,t){return t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],rW)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],rW)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],rW)),t};var nne=new d;ct.getMaximumScale=function(e){return ct.getScale(e,nne),d.maximumComponent(nne)};var Fve=new d;ct.setRotation=function(e,t,n){let i=ct.getScale(e,Fve);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 Qve=new d;ct.getRotation=function(e,t){let n=ct.getScale(e,Qve);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};ct.multiply=function(e,t,n){let i=e[0],o=e[1],r=e[2],a=e[3],s=e[4],c=e[5],u=e[6],f=e[7],h=e[8],p=e[9],A=e[10],m=e[11],_=e[12],y=e[13],C=e[14],E=e[15],I=t[0],x=t[1],S=t[2],w=t[3],v=t[4],R=t[5],N=t[6],L=t[7],g=t[8],b=t[9],T=t[10],B=t[11],M=t[12],O=t[13],G=t[14],k=t[15],z=i*I+s*x+h*S+_*w,F=o*I+c*x+p*S+y*w,H=r*I+u*x+A*S+C*w,Y=a*I+f*x+m*S+E*w,$=i*v+s*R+h*N+_*L,W=o*v+c*R+p*N+y*L,K=r*v+u*R+A*N+C*L,Z=a*v+f*R+m*N+E*L,pe=i*g+s*b+h*T+_*B,ge=o*g+c*b+p*T+y*B,re=r*g+u*b+A*T+C*B,ye=a*g+f*b+m*T+E*B,Ce=i*M+s*O+h*G+_*k,ve=o*M+c*O+p*G+y*k,Ne=r*M+u*O+A*G+C*k,Le=a*M+f*O+m*G+E*k;return n[0]=z,n[1]=F,n[2]=H,n[3]=Y,n[4]=$,n[5]=W,n[6]=K,n[7]=Z,n[8]=pe,n[9]=ge,n[10]=re,n[11]=ye,n[12]=Ce,n[13]=ve,n[14]=Ne,n[15]=Le,n};ct.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};ct.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};ct.multiplyTransformation=function(e,t,n){let i=e[0],o=e[1],r=e[2],a=e[4],s=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=e[12],A=e[13],m=e[14],_=t[0],y=t[1],C=t[2],E=t[4],I=t[5],x=t[6],S=t[8],w=t[9],v=t[10],R=t[12],N=t[13],L=t[14],g=i*_+a*y+u*C,b=o*_+s*y+f*C,T=r*_+c*y+h*C,B=i*E+a*I+u*x,M=o*E+s*I+f*x,O=r*E+c*I+h*x,G=i*S+a*w+u*v,k=o*S+s*w+f*v,z=r*S+c*w+h*v,F=i*R+a*N+u*L+p,H=o*R+s*N+f*L+A,Y=r*R+c*N+h*L+m;return n[0]=g,n[1]=b,n[2]=T,n[3]=0,n[4]=B,n[5]=M,n[6]=O,n[7]=0,n[8]=G,n[9]=k,n[10]=z,n[11]=0,n[12]=F,n[13]=H,n[14]=Y,n[15]=1,n};ct.multiplyByMatrix3=function(e,t,n){let i=e[0],o=e[1],r=e[2],a=e[4],s=e[5],c=e[6],u=e[8],f=e[9],h=e[10],p=t[0],A=t[1],m=t[2],_=t[3],y=t[4],C=t[5],E=t[6],I=t[7],x=t[8],S=i*p+a*A+u*m,w=o*p+s*A+f*m,v=r*p+c*A+h*m,R=i*_+a*y+u*C,N=o*_+s*y+f*C,L=r*_+c*y+h*C,g=i*E+a*I+u*x,b=o*E+s*I+f*x,T=r*E+c*I+h*x;return n[0]=S,n[1]=w,n[2]=v,n[3]=0,n[4]=R,n[5]=N,n[6]=L,n[7]=0,n[8]=g,n[9]=b,n[10]=T,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};ct.multiplyByTranslation=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=i*e[0]+o*e[4]+r*e[8]+e[12],s=i*e[1]+o*e[5]+r*e[9]+e[13],c=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=a,n[13]=s,n[14]=c,n[15]=e[15],n};ct.multiplyByScale=function(e,t,n){let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?ct.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)};ct.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};ct.multiplyByVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=t.w,s=e[0]*i+e[4]*o+e[8]*r+e[12]*a,c=e[1]*i+e[5]*o+e[9]*r+e[13]*a,u=e[2]*i+e[6]*o+e[10]*r+e[14]*a,f=e[3]*i+e[7]*o+e[11]*r+e[15]*a;return n.x=s,n.y=c,n.z=u,n.w=f,n};ct.multiplyByPointAsVector=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=e[0]*i+e[4]*o+e[8]*r,s=e[1]*i+e[5]*o+e[9]*r,c=e[2]*i+e[6]*o+e[10]*r;return n.x=a,n.y=s,n.z=c,n};ct.multiplyByPoint=function(e,t,n){let i=t.x,o=t.y,r=t.z,a=e[0]*i+e[4]*o+e[8]*r+e[12],s=e[1]*i+e[5]*o+e[9]*r+e[13],c=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=a,n.y=s,n.z=c,n};ct.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};ct.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t[4]=-e[4],t[5]=-e[5],t[6]=-e[6],t[7]=-e[7],t[8]=-e[8],t[9]=-e[9],t[10]=-e[10],t[11]=-e[11],t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=-e[15],t};ct.transpose=function(e,t){let n=e[1],i=e[2],o=e[3],r=e[6],a=e[7],s=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=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]=a,t[14]=s,t[15]=e[15],t};ct.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};ct.equals=function(e,t){return e===t||l(e)&&l(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};ct.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};ct.getTranslation=function(e,t){return t.x=e[12],t.y=e[13],t.z=e[14],t};ct.getMatrix3=function(e,t){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var kve=new J,Uve=new J,zve=new ie,Gve=new ie(0,0,0,1);ct.inverse=function(e,t){let n=e[0],i=e[4],o=e[8],r=e[12],a=e[1],s=e[5],c=e[9],u=e[13],f=e[2],h=e[6],p=e[10],A=e[14],m=e[3],_=e[7],y=e[11],C=e[15],E=p*C,I=A*y,x=h*C,S=A*_,w=h*y,v=p*_,R=f*C,N=A*m,L=f*y,g=p*m,b=f*_,T=h*m,B=E*s+S*c+w*u-(I*s+x*c+v*u),M=I*a+R*c+g*u-(E*a+N*c+L*u),O=x*a+N*s+b*u-(S*a+R*s+T*u),G=v*a+L*s+T*c-(w*a+g*s+b*c),k=I*i+x*o+v*r-(E*i+S*o+w*r),z=E*n+N*o+L*r-(I*n+R*o+g*r),F=S*n+R*i+T*r-(x*n+N*i+b*r),H=w*n+g*i+b*o-(v*n+L*i+T*o);E=o*u,I=r*c,x=i*u,S=r*s,w=i*c,v=o*s,R=n*u,N=r*a,L=n*c,g=o*a,b=n*s,T=i*a;let Y=E*_+S*y+w*C-(I*_+x*y+v*C),$=I*m+R*y+g*C-(E*m+N*y+L*C),W=x*m+N*_+b*C-(S*m+R*_+T*C),K=v*m+L*_+T*y-(w*m+g*_+b*y),Z=x*p+v*A+I*h-(w*A+E*h+S*p),pe=L*A+E*f+N*p-(R*p+g*A+I*f),ge=R*h+T*A+S*f-(b*A+x*f+N*h),re=b*p+w*f+g*h-(L*h+T*p+v*f),ye=n*B+i*M+o*O+r*G;if(Math.abs(ye)<D.EPSILON21){if(J.equalsEpsilon(ct.getMatrix3(e,kve),Uve,D.EPSILON7)&&ie.equals(ct.getRow(e,3,zve),Gve))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new ue("matrix is not invertible because its determinate is zero.")}return ye=1/ye,t[0]=B*ye,t[1]=M*ye,t[2]=O*ye,t[3]=G*ye,t[4]=k*ye,t[5]=z*ye,t[6]=F*ye,t[7]=H*ye,t[8]=Y*ye,t[9]=$*ye,t[10]=W*ye,t[11]=K*ye,t[12]=Z*ye,t[13]=pe*ye,t[14]=ge*ye,t[15]=re*ye,t};ct.inverseTransformation=function(e,t){let n=e[0],i=e[1],o=e[2],r=e[4],a=e[5],s=e[6],c=e[8],u=e[9],f=e[10],h=e[12],p=e[13],A=e[14],m=-n*h-i*p-o*A,_=-r*h-a*p-s*A,y=-c*h-u*p-f*A;return t[0]=n,t[1]=r,t[2]=c,t[3]=0,t[4]=i,t[5]=a,t[6]=u,t[7]=0,t[8]=o,t[9]=s,t[10]=f,t[11]=0,t[12]=m,t[13]=_,t[14]=y,t[15]=1,t};var Vve=new ct;ct.inverseTranspose=function(e,t){return ct.inverse(ct.transpose(e,Vve),t)};ct.IDENTITY=Object.freeze(new ct(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));ct.ZERO=Object.freeze(new ct(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));ct.COLUMN0ROW0=0;ct.COLUMN0ROW1=1;ct.COLUMN0ROW2=2;ct.COLUMN0ROW3=3;ct.COLUMN1ROW0=4;ct.COLUMN1ROW1=5;ct.COLUMN1ROW2=6;ct.COLUMN1ROW3=7;ct.COLUMN2ROW0=8;ct.COLUMN2ROW1=9;ct.COLUMN2ROW2=10;ct.COLUMN2ROW3=11;ct.COLUMN3ROW0=12;ct.COLUMN3ROW1=13;ct.COLUMN3ROW2=14;ct.COLUMN3ROW3=15;Object.defineProperties(ct.prototype,{length:{get:function(){return ct.packedLength}}});ct.prototype.clone=function(e){return ct.clone(this,e)};ct.prototype.equals=function(e){return ct.equals(this,e)};ct.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]};ct.prototype.equalsEpsilon=function(e,t){return ct.equalsEpsilon(this,e,t)};ct.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 P=ct;var Hve={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},ee=Object.freeze(Hve);var Wve=new d;function Mt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Qs={};Qs[ee.FLOAT]="float";Qs[ee.FLOAT_VEC2]="vec2";Qs[ee.FLOAT_VEC3]="vec3";Qs[ee.FLOAT_VEC4]="vec4";Qs[ee.INT]="int";Qs[ee.INT_VEC2]="ivec2";Qs[ee.INT_VEC3]="ivec3";Qs[ee.INT_VEC4]="ivec4";Qs[ee.BOOL]="bool";Qs[ee.BOOL_VEC2]="bvec2";Qs[ee.BOOL_VEC3]="bvec3";Qs[ee.BOOL_VEC4]="bvec4";Qs[ee.FLOAT_MAT2]="mat2";Qs[ee.FLOAT_MAT3]="mat3";Qs[ee.FLOAT_MAT4]="mat4";Qs[ee.SAMPLER_2D]="sampler2D";Qs[ee.SAMPLER_CUBE]="samplerCube";Mt.prototype.getDeclaration=function(e){let t=`uniform ${Qs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var jve={czm_viewport:new Mt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Mt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Mt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Mt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Mt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_model:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new Mt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Mt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Mt({size:1,datatype:ee.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Mt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Mt({size:1,datatype:ee.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Mt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return P.getTranslation(e.inverseView,Wve)}}),czm_frameNumber:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Mt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Mt({size:1,datatype:ee.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Mt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Mt({size:1,datatype:ee.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Mt({size:9,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Mt({size:1,datatype:ee.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Mt({size:1,datatype:ee.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Mt({size:1,datatype:ee.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Mt({size:1,datatype:ee.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Og=jve;function Yve(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Jn=Yve;function qve(){return!0}function Kve(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=qve}var fe=Kve;var _s={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT};_s.getSizeInBytes=function(e){switch(e){case _s.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case _s.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case _s.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};_s.fromSizeInBytes=function(e){switch(e){case 2:return _s.UNSIGNED_SHORT;case 4:return _s.UNSIGNED_INT;case 1:return _s.UNSIGNED_BYTE}};_s.validate=function(e){return l(e)&&(e===_s.UNSIGNED_BYTE||e===_s.UNSIGNED_SHORT||e===_s.UNSIGNED_INT)};_s.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};_s.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};_s.fromTypedArray=function(e){if(e instanceof Uint8Array)return _s.UNSIGNED_BYTE;if(e instanceof Uint16Array)return _s.UNSIGNED_SHORT;if(e instanceof Uint32Array)return _s.UNSIGNED_INT};var Ue=Object.freeze(_s);var pw={STREAM_DRAW:ee.STREAM_DRAW,STATIC_DRAW:ee.STATIC_DRAW,DYNAMIC_DRAW:ee.DYNAMIC_DRAW,DYNAMIC_READ:ee.DYNAMIC_READ,validate:function(e){return e===pw.STREAM_DRAW||e===pw.STATIC_DRAW||e===pw.DYNAMIC_DRAW||e===pw.DYNAMIC_READ}},Re=Object.freeze(pw);function Dc(e){e=e??V.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,a=l(i);a&&(o=i.byteLength);let s=t.createBuffer();t.bindBuffer(n,s),t.bufferData(n,a?i:o,r),t.bindBuffer(n,null),this._id=Jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=s,this.vertexArrayDestroyable=!0}Dc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new de("A WebGL 2 context is required to create PixelBuffers.");return new Dc({context:e.context,bufferTarget:ee.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Dc.createVertexBuffer=function(e){return new Dc({context:e.context,bufferTarget:ee.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Dc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Ue.getSizeInBytes(n),o=new Dc({context:t,bufferTarget:ee.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Dc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Dc.prototype._getBuffer=function(){return this._buffer};Dc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Dc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Dc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Dc.prototype.copyFromBuffer=function(e,t,n,i){let o=ee.COPY_READ_BUFFER,r=ee.COPY_WRITE_BUFFER,a=this._gl;a.bindBuffer(r,this._buffer),a.bindBuffer(o,e._buffer),a.copyBufferSubData(o,r,t,n,i),a.bindBuffer(r,null),a.bindBuffer(o,null)};Dc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ee.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Dc.prototype.isDestroyed=function(){return!1};Dc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),fe(this)};var tt=Dc;var Fg,Xr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Gl={};Object.defineProperties(Gl,{element:{get:function(){if(Gl.supportsFullscreen())return document[Xr.fullscreenElement]}},changeEventName:{get:function(){if(Gl.supportsFullscreen())return Xr.fullscreenchange}},errorEventName:{get:function(){if(Gl.supportsFullscreen())return Xr.fullscreenerror}},enabled:{get:function(){if(Gl.supportsFullscreen())return document[Xr.fullscreenEnabled]}},fullscreen:{get:function(){if(Gl.supportsFullscreen())return Gl.element!==null}}});Gl.supportsFullscreen=function(){if(l(Fg))return Fg;Fg=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Xr.requestFullscreen="requestFullscreen",Xr.exitFullscreen="exitFullscreen",Xr.fullscreenEnabled="fullscreenEnabled",Xr.fullscreenElement="fullscreenElement",Xr.fullscreenchange="fullscreenchange",Xr.fullscreenerror="fullscreenerror",Fg=!0,Fg;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"?(Xr.requestFullscreen=n,Fg=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Xr.requestFullscreen=n,Fg=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Xr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Xr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Xr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Xr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Xr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Xr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Xr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Xr.fullscreenerror=n)}return Fg};Gl.requestFullscreen=function(e,t){Gl.supportsFullscreen()&&e[Xr.requestFullscreen]({vrDisplay:t})};Gl.exitFullscreen=function(){Gl.supportsFullscreen()&&document[Xr.exitFullscreen]()};Gl._names=Xr;var Jr=Gl;var Lf;typeof navigator<"u"?Lf=navigator:Lf={};function Aw(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var dM,ine;function uW(){if(!l(dM)&&(dM=!1,!_M())){let e=/ Chrome\/([\.0-9]+)/.exec(Lf.userAgent);e!==null&&(dM=!0,ine=Aw(e[1]))}return dM}function Xve(){return uW()&&ine}var hM,one;function rne(){if(!l(hM)&&(hM=!1,!uW()&&!_M()&&/ Safari\/[\.0-9]+/.test(Lf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Lf.userAgent);e!==null&&(hM=!0,one=Aw(e[1]))}return hM}function Jve(){return rne()&&one}var mM,lW;function ane(){if(!l(mM)){mM=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Lf.userAgent);e!==null&&(mM=!0,lW=Aw(e[1]),lW.isNightly=!!e[2])}return mM}function Zve(){return ane()&&lW}var pM,sne;function _M(){if(!l(pM)){pM=!1;let e=/ Edg\/([\.0-9]+)/.exec(Lf.userAgent);e!==null&&(pM=!0,sne=Aw(e[1]))}return pM}function $ve(){return _M()&&sne}var AM,fW;function yM(){if(!l(AM)){AM=!1;let e=/Firefox\/([\.0-9]+)/.exec(Lf.userAgent);e!==null&&(AM=!0,fW=Aw(e[1]))}return AM}var aW;function ePe(){return l(aW)||(aW=/Windows/i.test(Lf.appVersion)),aW}var sW;function tPe(){return l(sW)||(sW=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),sW}function nPe(){return yM()&&fW}var cW;function iPe(){return l(cW)||(cW=!yM()&&typeof PointerEvent<"u"&&(!l(Lf.pointerEnabled)||Lf.pointerEnabled)),cW}var cne,gM;function lne(){if(!l(gM)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;gM=l(t)&&t!=="",gM&&(cne=t)}return gM}function oPe(){return lne()?cne:void 0}function al(){return al._result}al._promise=void 0;al._result=void 0;al.initialize=function(){return l(al._promise)||(al._promise=new Promise(e=>{let t=new Image;t.onload=function(){al._result=t.width>0&&t.height>0,e(al._result)},t.onerror=function(){al._result=!1,e(al._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),al._promise};Object.defineProperties(al,{initialized:{get:function(){return l(al._result)}}});var II=[];typeof ArrayBuffer<"u"&&(II.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&II.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&II.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&II.push(BigInt64Array),typeof BigUint64Array<"u"&&II.push(BigUint64Array));var Of={isChrome:uW,chromeVersion:Xve,isSafari:rne,safariVersion:Jve,isWebkit:ane,webkitVersion:Zve,isEdge:_M,edgeVersion:$ve,isFirefox:yM,firefoxVersion:nPe,isWindows:ePe,isIPadOrIOS:tPe,hardwareConcurrency:Lf.hardwareConcurrency??3,supportsPointerEvents:iPe,supportsImageRenderingPixelated:lne,supportsWebP:al,imageRenderingValue:oPe,typedArrayTypes:II};Of.supportsBasis=function(e){return Of.supportsWebAssembly()&&e.context.supportsBasis};Of.supportsFullscreen=function(){return Jr.supportsFullscreen()};Of.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Of.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Of.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Of.supportsBigInt=function(){return typeof BigInt<"u"};Of.supportsWebWorkers=function(){return typeof Worker<"u"};Of.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Of.supportsWebgl2=function(e){return e.context.webgl2};Of.supportsEsmWebWorkers=function(){return!yM()||parseInt(fW)>=114};var hn=Of;function dW(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 se(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}se.fromCartesian4=function(e,t){return l(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new se(e.x,e.y,e.z,e.w)};se.fromBytes=function(e,t,n,i,o){return e=se.byteToFloat(e??255),t=se.byteToFloat(t??255),n=se.byteToFloat(n??255),i=se.byteToFloat(i??255),l(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new se(e,t,n,i)};se.fromAlpha=function(e,t,n){return l(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new se(e.red,e.green,e.blue,t)};var hW,mW,eA;hn.supportsTypedArrays()&&(hW=new ArrayBuffer(4),mW=new Uint32Array(hW),eA=new Uint8Array(hW));se.fromRgba=function(e,t){return mW[0]=e,se.fromBytes(eA[0],eA[1],eA[2],eA[3],t)};se.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,a=n,s=n;if(t!==0){let c;n<.5?c=n*(1+t):c=n+t-n*t;let u=2*n-c;r=dW(u,c,e+1/3),a=dW(u,c,e),s=dW(u,c,e-1/3)}return l(o)?(o.red=r,o.green=a,o.blue=s,o.alpha=i,o):new se(r,a,s,i)};se.fromRandom=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.red;if(!l(n)){let a=e.minimumRed??0,s=e.maximumRed??1;n=a+D.nextRandomNumber()*(s-a)}let i=e.green;if(!l(i)){let a=e.minimumGreen??0,s=e.maximumGreen??1;i=a+D.nextRandomNumber()*(s-a)}let o=e.blue;if(!l(o)){let a=e.minimumBlue??0,s=e.maximumBlue??1;o=a+D.nextRandomNumber()*(s-a)}let r=e.alpha;if(!l(r)){let a=e.minimumAlpha??0,s=e.maximumAlpha??1;r=a+D.nextRandomNumber()*(s-a)}return l(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new se(n,i,o,r)};var rPe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,aPe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,sPe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,cPe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;se.fromCssColorString=function(e,t){l(t)||(t=new se),e=e.trim();let n=se[e.toUpperCase()];if(l(n))return se.clone(n,t),t;let i=rPe.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=aPe.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=sPe.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=cPe.exec(e),i!==null?se.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};se.packedLength=4;se.pack=function(e,t,n){return n=n??0,t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};se.unpack=function(e,t,n){return t=t??0,l(n)||(n=new se),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};se.byteToFloat=function(e){return e/255};se.floatToByte=function(e){return e===1?255:e*256|0};se.clone=function(e,t){if(l(e))return l(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new se(e.red,e.green,e.blue,e.alpha)};se.equals=function(e,t){return e===t||l(e)&&l(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};se.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]};se.prototype.clone=function(e){return se.clone(this,e)};se.prototype.equals=function(e){return se.equals(this,e)};se.prototype.equalsEpsilon=function(e,t){return this===e||l(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};se.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};se.prototype.toCssColorString=function(){let e=se.floatToByte(this.red),t=se.floatToByte(this.green),n=se.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};se.prototype.toCssHexString=function(){let e=se.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=se.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=se.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=se.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};se.prototype.toBytes=function(e){let t=se.floatToByte(this.red),n=se.floatToByte(this.green),i=se.floatToByte(this.blue),o=se.floatToByte(this.alpha);return l(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};se.bytesToRgba=function(e,t,n,i){return eA[0]=e,eA[1]=t,eA[2]=n,eA[3]=i,mW[0]};se.prototype.toRgba=function(){return se.bytesToRgba(se.floatToByte(this.red),se.floatToByte(this.green),se.floatToByte(this.blue),se.floatToByte(this.alpha))};se.prototype.brighten=function(e,t){return e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};se.prototype.darken=function(e,t){return e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};se.prototype.withAlpha=function(e,t){return se.fromAlpha(this,e,t)};se.add=function(e,t,n){return n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};se.subtract=function(e,t,n){return n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};se.multiply=function(e,t,n){return n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};se.divide=function(e,t,n){return n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};se.mod=function(e,t,n){return n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};se.lerp=function(e,t,n,i){return i.red=D.lerp(e.red,t.red,n),i.green=D.lerp(e.green,t.green,n),i.blue=D.lerp(e.blue,t.blue,n),i.alpha=D.lerp(e.alpha,t.alpha,n),i};se.multiplyByScalar=function(e,t,n){return n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};se.divideByScalar=function(e,t,n){return n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};se.ALICEBLUE=Object.freeze(se.fromCssColorString("#F0F8FF"));se.ANTIQUEWHITE=Object.freeze(se.fromCssColorString("#FAEBD7"));se.AQUA=Object.freeze(se.fromCssColorString("#00FFFF"));se.AQUAMARINE=Object.freeze(se.fromCssColorString("#7FFFD4"));se.AZURE=Object.freeze(se.fromCssColorString("#F0FFFF"));se.BEIGE=Object.freeze(se.fromCssColorString("#F5F5DC"));se.BISQUE=Object.freeze(se.fromCssColorString("#FFE4C4"));se.BLACK=Object.freeze(se.fromCssColorString("#000000"));se.BLANCHEDALMOND=Object.freeze(se.fromCssColorString("#FFEBCD"));se.BLUE=Object.freeze(se.fromCssColorString("#0000FF"));se.BLUEVIOLET=Object.freeze(se.fromCssColorString("#8A2BE2"));se.BROWN=Object.freeze(se.fromCssColorString("#A52A2A"));se.BURLYWOOD=Object.freeze(se.fromCssColorString("#DEB887"));se.CADETBLUE=Object.freeze(se.fromCssColorString("#5F9EA0"));se.CHARTREUSE=Object.freeze(se.fromCssColorString("#7FFF00"));se.CHOCOLATE=Object.freeze(se.fromCssColorString("#D2691E"));se.CORAL=Object.freeze(se.fromCssColorString("#FF7F50"));se.CORNFLOWERBLUE=Object.freeze(se.fromCssColorString("#6495ED"));se.CORNSILK=Object.freeze(se.fromCssColorString("#FFF8DC"));se.CRIMSON=Object.freeze(se.fromCssColorString("#DC143C"));se.CYAN=Object.freeze(se.fromCssColorString("#00FFFF"));se.DARKBLUE=Object.freeze(se.fromCssColorString("#00008B"));se.DARKCYAN=Object.freeze(se.fromCssColorString("#008B8B"));se.DARKGOLDENROD=Object.freeze(se.fromCssColorString("#B8860B"));se.DARKGRAY=Object.freeze(se.fromCssColorString("#A9A9A9"));se.DARKGREEN=Object.freeze(se.fromCssColorString("#006400"));se.DARKGREY=se.DARKGRAY;se.DARKKHAKI=Object.freeze(se.fromCssColorString("#BDB76B"));se.DARKMAGENTA=Object.freeze(se.fromCssColorString("#8B008B"));se.DARKOLIVEGREEN=Object.freeze(se.fromCssColorString("#556B2F"));se.DARKORANGE=Object.freeze(se.fromCssColorString("#FF8C00"));se.DARKORCHID=Object.freeze(se.fromCssColorString("#9932CC"));se.DARKRED=Object.freeze(se.fromCssColorString("#8B0000"));se.DARKSALMON=Object.freeze(se.fromCssColorString("#E9967A"));se.DARKSEAGREEN=Object.freeze(se.fromCssColorString("#8FBC8F"));se.DARKSLATEBLUE=Object.freeze(se.fromCssColorString("#483D8B"));se.DARKSLATEGRAY=Object.freeze(se.fromCssColorString("#2F4F4F"));se.DARKSLATEGREY=se.DARKSLATEGRAY;se.DARKTURQUOISE=Object.freeze(se.fromCssColorString("#00CED1"));se.DARKVIOLET=Object.freeze(se.fromCssColorString("#9400D3"));se.DEEPPINK=Object.freeze(se.fromCssColorString("#FF1493"));se.DEEPSKYBLUE=Object.freeze(se.fromCssColorString("#00BFFF"));se.DIMGRAY=Object.freeze(se.fromCssColorString("#696969"));se.DIMGREY=se.DIMGRAY;se.DODGERBLUE=Object.freeze(se.fromCssColorString("#1E90FF"));se.FIREBRICK=Object.freeze(se.fromCssColorString("#B22222"));se.FLORALWHITE=Object.freeze(se.fromCssColorString("#FFFAF0"));se.FORESTGREEN=Object.freeze(se.fromCssColorString("#228B22"));se.FUCHSIA=Object.freeze(se.fromCssColorString("#FF00FF"));se.GAINSBORO=Object.freeze(se.fromCssColorString("#DCDCDC"));se.GHOSTWHITE=Object.freeze(se.fromCssColorString("#F8F8FF"));se.GOLD=Object.freeze(se.fromCssColorString("#FFD700"));se.GOLDENROD=Object.freeze(se.fromCssColorString("#DAA520"));se.GRAY=Object.freeze(se.fromCssColorString("#808080"));se.GREEN=Object.freeze(se.fromCssColorString("#008000"));se.GREENYELLOW=Object.freeze(se.fromCssColorString("#ADFF2F"));se.GREY=se.GRAY;se.HONEYDEW=Object.freeze(se.fromCssColorString("#F0FFF0"));se.HOTPINK=Object.freeze(se.fromCssColorString("#FF69B4"));se.INDIANRED=Object.freeze(se.fromCssColorString("#CD5C5C"));se.INDIGO=Object.freeze(se.fromCssColorString("#4B0082"));se.IVORY=Object.freeze(se.fromCssColorString("#FFFFF0"));se.KHAKI=Object.freeze(se.fromCssColorString("#F0E68C"));se.LAVENDER=Object.freeze(se.fromCssColorString("#E6E6FA"));se.LAVENDAR_BLUSH=Object.freeze(se.fromCssColorString("#FFF0F5"));se.LAWNGREEN=Object.freeze(se.fromCssColorString("#7CFC00"));se.LEMONCHIFFON=Object.freeze(se.fromCssColorString("#FFFACD"));se.LIGHTBLUE=Object.freeze(se.fromCssColorString("#ADD8E6"));se.LIGHTCORAL=Object.freeze(se.fromCssColorString("#F08080"));se.LIGHTCYAN=Object.freeze(se.fromCssColorString("#E0FFFF"));se.LIGHTGOLDENRODYELLOW=Object.freeze(se.fromCssColorString("#FAFAD2"));se.LIGHTGRAY=Object.freeze(se.fromCssColorString("#D3D3D3"));se.LIGHTGREEN=Object.freeze(se.fromCssColorString("#90EE90"));se.LIGHTGREY=se.LIGHTGRAY;se.LIGHTPINK=Object.freeze(se.fromCssColorString("#FFB6C1"));se.LIGHTSEAGREEN=Object.freeze(se.fromCssColorString("#20B2AA"));se.LIGHTSKYBLUE=Object.freeze(se.fromCssColorString("#87CEFA"));se.LIGHTSLATEGRAY=Object.freeze(se.fromCssColorString("#778899"));se.LIGHTSLATEGREY=se.LIGHTSLATEGRAY;se.LIGHTSTEELBLUE=Object.freeze(se.fromCssColorString("#B0C4DE"));se.LIGHTYELLOW=Object.freeze(se.fromCssColorString("#FFFFE0"));se.LIME=Object.freeze(se.fromCssColorString("#00FF00"));se.LIMEGREEN=Object.freeze(se.fromCssColorString("#32CD32"));se.LINEN=Object.freeze(se.fromCssColorString("#FAF0E6"));se.MAGENTA=Object.freeze(se.fromCssColorString("#FF00FF"));se.MAROON=Object.freeze(se.fromCssColorString("#800000"));se.MEDIUMAQUAMARINE=Object.freeze(se.fromCssColorString("#66CDAA"));se.MEDIUMBLUE=Object.freeze(se.fromCssColorString("#0000CD"));se.MEDIUMORCHID=Object.freeze(se.fromCssColorString("#BA55D3"));se.MEDIUMPURPLE=Object.freeze(se.fromCssColorString("#9370DB"));se.MEDIUMSEAGREEN=Object.freeze(se.fromCssColorString("#3CB371"));se.MEDIUMSLATEBLUE=Object.freeze(se.fromCssColorString("#7B68EE"));se.MEDIUMSPRINGGREEN=Object.freeze(se.fromCssColorString("#00FA9A"));se.MEDIUMTURQUOISE=Object.freeze(se.fromCssColorString("#48D1CC"));se.MEDIUMVIOLETRED=Object.freeze(se.fromCssColorString("#C71585"));se.MIDNIGHTBLUE=Object.freeze(se.fromCssColorString("#191970"));se.MINTCREAM=Object.freeze(se.fromCssColorString("#F5FFFA"));se.MISTYROSE=Object.freeze(se.fromCssColorString("#FFE4E1"));se.MOCCASIN=Object.freeze(se.fromCssColorString("#FFE4B5"));se.NAVAJOWHITE=Object.freeze(se.fromCssColorString("#FFDEAD"));se.NAVY=Object.freeze(se.fromCssColorString("#000080"));se.OLDLACE=Object.freeze(se.fromCssColorString("#FDF5E6"));se.OLIVE=Object.freeze(se.fromCssColorString("#808000"));se.OLIVEDRAB=Object.freeze(se.fromCssColorString("#6B8E23"));se.ORANGE=Object.freeze(se.fromCssColorString("#FFA500"));se.ORANGERED=Object.freeze(se.fromCssColorString("#FF4500"));se.ORCHID=Object.freeze(se.fromCssColorString("#DA70D6"));se.PALEGOLDENROD=Object.freeze(se.fromCssColorString("#EEE8AA"));se.PALEGREEN=Object.freeze(se.fromCssColorString("#98FB98"));se.PALETURQUOISE=Object.freeze(se.fromCssColorString("#AFEEEE"));se.PALEVIOLETRED=Object.freeze(se.fromCssColorString("#DB7093"));se.PAPAYAWHIP=Object.freeze(se.fromCssColorString("#FFEFD5"));se.PEACHPUFF=Object.freeze(se.fromCssColorString("#FFDAB9"));se.PERU=Object.freeze(se.fromCssColorString("#CD853F"));se.PINK=Object.freeze(se.fromCssColorString("#FFC0CB"));se.PLUM=Object.freeze(se.fromCssColorString("#DDA0DD"));se.POWDERBLUE=Object.freeze(se.fromCssColorString("#B0E0E6"));se.PURPLE=Object.freeze(se.fromCssColorString("#800080"));se.RED=Object.freeze(se.fromCssColorString("#FF0000"));se.ROSYBROWN=Object.freeze(se.fromCssColorString("#BC8F8F"));se.ROYALBLUE=Object.freeze(se.fromCssColorString("#4169E1"));se.SADDLEBROWN=Object.freeze(se.fromCssColorString("#8B4513"));se.SALMON=Object.freeze(se.fromCssColorString("#FA8072"));se.SANDYBROWN=Object.freeze(se.fromCssColorString("#F4A460"));se.SEAGREEN=Object.freeze(se.fromCssColorString("#2E8B57"));se.SEASHELL=Object.freeze(se.fromCssColorString("#FFF5EE"));se.SIENNA=Object.freeze(se.fromCssColorString("#A0522D"));se.SILVER=Object.freeze(se.fromCssColorString("#C0C0C0"));se.SKYBLUE=Object.freeze(se.fromCssColorString("#87CEEB"));se.SLATEBLUE=Object.freeze(se.fromCssColorString("#6A5ACD"));se.SLATEGRAY=Object.freeze(se.fromCssColorString("#708090"));se.SLATEGREY=se.SLATEGRAY;se.SNOW=Object.freeze(se.fromCssColorString("#FFFAFA"));se.SPRINGGREEN=Object.freeze(se.fromCssColorString("#00FF7F"));se.STEELBLUE=Object.freeze(se.fromCssColorString("#4682B4"));se.TAN=Object.freeze(se.fromCssColorString("#D2B48C"));se.TEAL=Object.freeze(se.fromCssColorString("#008080"));se.THISTLE=Object.freeze(se.fromCssColorString("#D8BFD8"));se.TOMATO=Object.freeze(se.fromCssColorString("#FF6347"));se.TURQUOISE=Object.freeze(se.fromCssColorString("#40E0D0"));se.VIOLET=Object.freeze(se.fromCssColorString("#EE82EE"));se.WHEAT=Object.freeze(se.fromCssColorString("#F5DEB3"));se.WHITE=Object.freeze(se.fromCssColorString("#FFFFFF"));se.WHITESMOKE=Object.freeze(se.fromCssColorString("#F5F5F5"));se.YELLOW=Object.freeze(se.fromCssColorString("#FFFF00"));se.YELLOWGREEN=Object.freeze(se.fromCssColorString("#9ACD32"));se.TRANSPARENT=Object.freeze(new se(0,0,0,0));var U=se;function CM(e){e=e??V.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}CM.ALL=Object.freeze(new CM({color:new U(0,0,0,0),depth:1,stencil:0}));CM.prototype.execute=function(e,t){e.clear(this,t)};var ui=CM;var lPe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE:5,CESIUM_3D_TILE_CLASSIFICATION:6,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:7,OPAQUE:8,TRANSLUCENT:9,VOXELS:10,GAUSSIAN_SPLATS:11,OVERLAY:12,NUMBER_OF_PASSES:13},Be=Object.freeze(lPe);function une(e){e=e??V.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Be.COMPUTE,this.owner=e.owner}une.prototype.execute=function(e){e.execute(this)};var Vl=une;var Zr=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,o=i*2;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r<i;++r)e.pack(t[r],n,r*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=o/2;n[r]=e.unpack(t,o,n[r])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,o){let r=D.clamp(t.x,n.x,i.x),a=D.clamp(t.y,n.y,i.y);return o.x=r,o.y=a,o}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,EM),e.magnitude(EM)}static distanceSquared(t,n){return e.subtract(t,n,EM),e.magnitudeSquared(EM)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,o){return e.multiplyByScalar(n,i,fne),o=e.multiplyByScalar(t,1-i,o),e.add(fne,o,o)}static angleBetween(t,n){return e.normalize(t,dne),e.normalize(n,hne),D.acosClamped(e.dot(dne,hne))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,uPe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,o){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,o)&&D.equalsEpsilon(t.y,n.y,i,o)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};Zr.fromCartesian3=Zr.clone;Zr.fromCartesian4=Zr.clone;Zr.packedLength=2;Zr.fromArray=Zr.unpack;var EM=new Zr,fne=new Zr,dne=new Zr,hne=new Zr,uPe=new Zr;Zr.ZERO=Object.freeze(new Zr(0,0));Zr.ONE=Object.freeze(new Zr(1,1));Zr.UNIT_X=Object.freeze(new Zr(1,0));Zr.UNIT_Y=Object.freeze(new Zr(0,1));var Q=Zr;var fPe=new d,dPe=new d;function hPe(e,t,n,i,o){let r=e.x,a=e.y,s=e.z,c=t.x,u=t.y,f=t.z,h=r*r*c*c,p=a*a*u*u,A=s*s*f*f,m=h+p+A,_=Math.sqrt(1/m),y=d.multiplyByScalar(e,_,fPe);if(m<i)return isFinite(_)?d.clone(y,o):void 0;let C=n.x,E=n.y,I=n.z,x=dPe;x.x=y.x*C*2,x.y=y.y*E*2,x.z=y.z*I*2;let S=(1-_)*d.magnitude(e)/(.5*d.magnitude(x)),w=0,v,R,N,L,g,b,T,B,M,O,G;do{S-=w,N=1/(1+S*C),L=1/(1+S*E),g=1/(1+S*I),b=N*N,T=L*L,B=g*g,M=b*N,O=T*L,G=B*g,v=h*b+p*T+A*B-1,R=h*M*C+p*O*E+A*G*I;let k=-2*R;w=v/k}while(Math.abs(v)>D.EPSILON12);return l(o)?(o.x=r*N,o.y=a*L,o.z=s*g,o):new d(r*N,a*L,s*g)}var bI=hPe;function rr(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}rr.fromRadians=function(e,t,n,i){return n=n??0,l(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new rr(e,t,n)};rr.fromDegrees=function(e,t,n,i){return e=D.toRadians(e),t=D.toRadians(t),rr.fromRadians(e,t,n,i)};var mPe=new d,pPe=new d,APe=new d;rr._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);rr._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));rr._ellipsoidCenterToleranceSquared=D.EPSILON1;rr.fromCartesian=function(e,t,n){let i=l(t)?t.oneOverRadii:rr._ellipsoidOneOverRadii,o=l(t)?t.oneOverRadiiSquared:rr._ellipsoidOneOverRadiiSquared,r=l(t)?t._centerToleranceSquared:rr._ellipsoidCenterToleranceSquared,a=bI(e,i,o,r,pPe);if(!l(a))return;let s=d.multiplyComponents(a,o,mPe);s=d.normalize(s,s);let c=d.subtract(e,a,APe),u=Math.atan2(s.y,s.x),f=Math.asin(s.z),h=D.sign(d.dot(c,e))*d.magnitude(c);return l(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new rr(u,f,h)};rr.toCartesian=function(e,t,n){return d.fromRadians(e.longitude,e.latitude,e.height,t,n)};rr.clone=function(e,t){if(l(e))return l(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new rr(e.longitude,e.latitude,e.height)};rr.equals=function(e,t){return e===t||l(e)&&l(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};rr.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};rr.ZERO=Object.freeze(new rr(0,0,0));rr.prototype.clone=function(e){return rr.clone(this,e)};rr.prototype.equals=function(e){return rr.equals(this,e)};rr.prototype.equalsEpsilon=function(e,t){return rr.equalsEpsilon(this,e,t)};rr.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var me=rr;function pne(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function Ii(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,pne(this,e,t,n)}Object.defineProperties(Ii.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}}});Ii.clone=function(e,t){if(!l(e))return;let n=e._radii;return l(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new Ii(n.x,n.y,n.z)};Ii.fromCartesian3=function(e,t){return l(t)||(t=new Ii),l(e)&&pne(t,e.x,e.y,e.z),t};Ii.WGS84=Object.freeze(new Ii(6378137,6378137,6356752314245179e-9));Ii.UNIT_SPHERE=Object.freeze(new Ii(1,1,1));Ii.MOON=Object.freeze(new Ii(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Ii.MARS=Object.freeze(new Ii(3396190,3396190,3376200));Ii._default=Ii.WGS84;Object.defineProperties(Ii,{default:{get:function(){return Ii._default},set:function(e){Ii._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,me._ellipsoidOneOverRadii=e.oneOverRadii,me._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,me._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});Ii.prototype.clone=function(e){return Ii.clone(this,e)};Ii.packedLength=d.packedLength;Ii.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),t};Ii.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t);return Ii.fromCartesian3(i,n)};Ii.prototype.geocentricSurfaceNormal=d.normalize;Ii.prototype.geodeticSurfaceNormalCartographic=function(e,t){let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),a=o*Math.sin(n),s=Math.sin(i);return l(t)||(t=new d),t.x=r,t.y=a,t.z=s,d.normalize(t,t)};Ii.prototype.geodeticSurfaceNormal=function(e,t){if(!d.equalsEpsilon(e,d.ZERO,D.EPSILON14))return l(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var gPe=new d,_Pe=new d;Ii.prototype.cartographicToCartesian=function(e,t){let n=gPe,i=_Pe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),l(t)||(t=new d),d.add(i,n,t)};Ii.prototype.cartographicArrayToCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var yPe=new d,CPe=new d,EPe=new d;Ii.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,CPe);if(!l(n))return;let i=this.geodeticSurfaceNormal(n,yPe),o=d.subtract(e,n,EPe),r=Math.atan2(i.y,i.x),a=Math.asin(i.z),s=D.sign(d.dot(o,e))*d.magnitude(o);return l(t)?(t.longitude=r,t.latitude=a,t.height=s,t):new me(r,a,s)};Ii.prototype.cartesianArrayToCartographicArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};Ii.prototype.scaleToGeodeticSurface=function(e,t){return bI(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};Ii.prototype.scaleToGeocentricSurface=function(e,t){l(t)||(t=new d);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,a=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return d.multiplyByScalar(e,a,t)};Ii.prototype.transformPositionToScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};Ii.prototype.transformPositionFromScaledSpace=function(e,t){return l(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};Ii.prototype.equals=function(e){return this===e||l(e)&&d.equals(this._radii,e._radii)};Ii.prototype.toString=function(){return this._radii.toString()};Ii.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){t=t??0;let i=this._squaredXOverSquaredZ;if(l(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var IPe=new d;Ii.prototype.getLocalCurvature=function(e,t){l(t)||(t=new Q);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,IPe),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return Q.fromElements(1/i,1/r,t)};var bPe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],xPe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function mne(e,t,n){let i=.5*(t+e),o=.5*(t-e),r=0;for(let a=0;a<5;a++){let s=o*bPe[a];r+=xPe[a]*(n(i+s)+n(i-s))}return r*=o,r}Ii.prototype.surfaceArea=function(e){let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=D.TWO_PI;let r=this._radiiSquared,a=r.x,s=r.y,c=r.z,u=a*s;return mne(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*mne(t,n,function(A){let m=Math.cos(A),_=Math.sin(A);return Math.sqrt(u*p*p+c*(s*m*m+a*_*_)*h*h)})})};var te=Ii;function IM(e){this._ellipsoid=e??te.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(IM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});IM.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};IM.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new me(i,o,r)};var qi=IM;var TPe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Xt=Object.freeze(TPe);function SPe(e,t,n){let i=0,o=e.length-1,r,a;for(;i<=o;){if(r=~~((i+o)/2),a=n(e[r],t),a<0){i=r+1;continue}if(a>0){o=r-1;continue}return r}return~(o+1)}var Io=SPe;function wPe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var DC=wPe;function BPe(e){return e%4===0&&e%100!==0||e%400===0}var hm=BPe;var Ane=[31,28,31,30,31,30,31,31,30,31,30,31];function DPe(e,t,n,i,o,r,a,s){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,a=a??0,s=s??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=a,this.isLeapSecond=s;function _(){Wo.typeOf.number.greaterThanOrEquals("Year",e,1),Wo.typeOf.number.lessThanOrEquals("Year",e,9999),Wo.typeOf.number.greaterThanOrEquals("Month",t,1),Wo.typeOf.number.lessThanOrEquals("Month",t,12),Wo.typeOf.number.greaterThanOrEquals("Day",n,1),Wo.typeOf.number.lessThanOrEquals("Day",n,31),Wo.typeOf.number.greaterThanOrEquals("Hour",i,0),Wo.typeOf.number.lessThanOrEquals("Hour",i,23),Wo.typeOf.number.greaterThanOrEquals("Minute",o,0),Wo.typeOf.number.lessThanOrEquals("Minute",o,59),Wo.typeOf.bool("IsLeapSecond",s),Wo.typeOf.number.greaterThanOrEquals("Second",r,0),Wo.typeOf.number.lessThanOrEquals("Second",r,s?60:59),Wo.typeOf.number.greaterThanOrEquals("Millisecond",a,0),Wo.typeOf.number.lessThan("Millisecond",a,1e3)}function y(){let C=t===2&&hm(e)?Ane[t-1]+1:Ane[t-1];if(n>C)throw new de("Month and Day represents invalid date")}}var Qg=DPe;function vPe(e,t){this.julianDate=e,this.offset=t}var ho=vPe;var PPe={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},ci=Object.freeze(PPe);var RPe={UTC:0,TAI:1},ai=Object.freeze(RPe);var _ne=new Qg,pW=[31,28,31,30,31,30,31,31,30,31,30,31],AW=29;function gW(e,t){return kt.compare(e.julianDate,t.julianDate)}var xI=new ho;function xM(e){xI.julianDate=e;let t=kt.leapSeconds,n=Io(t,xI,gW);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&kt.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),kt.addSeconds(e,i,e)}function gne(e,t){xI.julianDate=e;let n=kt.leapSeconds,i=Io(n,xI,gW);if(i<0&&(i=~i),i===0)return kt.addSeconds(e,-n[0].offset,t);if(i>=n.length)return kt.addSeconds(e,-n[i-1].offset,t);let o=kt.secondsDifference(n[i].julianDate,e);if(o===0)return kt.addSeconds(e,-n[i].offset,t);if(!(o<=1))return kt.addSeconds(e,-n[--i].offset,t)}function kg(e,t,n){let i=t/ci.SECONDS_PER_DAY|0;return e+=i,t-=ci.SECONDS_PER_DAY*i,t<0&&(e--,t+=ci.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function _W(e,t,n,i,o,r,a){let s=(t-14)/12|0,c=e+4800+s,u=(1461*c/4|0)+(367*(t-2-12*s)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*ci.SECONDS_PER_HOUR+o*ci.SECONDS_PER_MINUTE+a*ci.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var MPe=/^(\d{4})$/,NPe=/^(\d{4})-(\d{2})$/,LPe=/^(\d{4})-?(\d{3})$/,OPe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,FPe=/^(\d{4})-?(\d{2})-?(\d{2})$/,yW=/([Z+\-])?(\d{2})?:?(\d{2})?$/,QPe=/^(\d{2})(\.\d+)?/.source+yW.source,kPe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+yW.source,UPe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+yW.source;function kt(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??ai.UTC;let i=e|0;t=t+(e-i)*ci.SECONDS_PER_DAY,kg(i,t,this),n===ai.UTC&&xM(this)}kt.fromGregorianDate=function(e,t){let n=_W(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return l(t)?(kg(n[0],n[1],t),xM(t),t):new kt(n[0],n[1],ai.UTC)};kt.fromDate=function(e,t){let n=_W(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return l(t)?(kg(n[0],n[1],t),xM(t),t):new kt(n[0],n[1],ai.UTC)};kt.fromIso8601=function(e,t){e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,a=0,s=0,c=0,u=0,f=n[0],h=n[1],p,A;if(n=f.match(FPe),n!==null)i=+n[1],o=+n[2],r=+n[3];else if(n=f.match(NPe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(MPe),n!==null)i=+n[1];else{let C;if(n=f.match(LPe),n!==null)i=+n[1],C=+n[2],A=hm(i);else if(n=f.match(OPe),n!==null){i=+n[1];let E=+n[2],I=+n[3]||0,x=new Date(Date.UTC(i,0,4));C=E*7+I-x.getUTCDay()-3}p=new Date(Date.UTC(i,0,1)),p.setUTCDate(C),o=p.getUTCMonth()+1,r=p.getUTCDate()}A=hm(i);let m;if(l(h)){n=h.match(UPe),n!==null?(a=+n[1],s=+n[2],c=+n[3],u=+(n[4]||0)*1e3,m=5):(n=h.match(kPe),n!==null?(a=+n[1],s=+n[2],c=+(n[3]||0)*60,m=4):(n=h.match(QPe),n!==null&&(a=+n[1],s=+(n[2]||0)*60,m=3)));let C=n[m],E=+n[m+1],I=+(n[m+2]||0);switch(C){case"+":a=a-E,s=s-I;break;case"-":a=a+E,s=s+I;break;case"Z":break;default:s=s+new Date(Date.UTC(i,o-1,r,a,s)).getTimezoneOffset();break}}let _=c===60;for(_&&c--;s>=60;)s-=60,a++;for(;a>=24;)a-=24,r++;for(p=A&&o===2?AW:pW[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=A&&o===2?AW:pW[o-1];for(;s<0;)s+=60,a--;for(;a<0;)a+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=A&&o===2?AW:pW[o-1],r+=p;let y=_W(i,o,r,a,s,c,u);return l(t)?(kg(y[0],y[1],t),xM(t)):t=new kt(y[0],y[1],ai.UTC),_&&kt.addSeconds(t,1,t),t};kt.now=function(e){return kt.fromDate(new Date,e)};var bM=new kt(0,0,ai.TAI);kt.toGregorianDate=function(e,t){let n=!1,i=gne(e,bM);l(i)||(kt.addSeconds(e,-1,bM),i=gne(bM,bM),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let a=o+68569|0,s=4*a/146097|0;a=a-((146097*s+3)/4|0)|0;let c=4e3*(a+1)/1461001|0;a=a-(1461*c/4|0)+31|0;let u=80*a/2447|0,f=a-(2447*u/80|0)|0;a=u/11|0;let h=u+2-12*a|0,p=100*(s-49)+c+a|0,A=r/ci.SECONDS_PER_HOUR|0,m=r-A*ci.SECONDS_PER_HOUR,_=m/ci.SECONDS_PER_MINUTE|0;m=m-_*ci.SECONDS_PER_MINUTE;let y=m|0,C=(m-y)/ci.SECONDS_PER_MILLISECOND;return A+=12,A>23&&(A-=24),n&&(y+=1),l(t)?(t.year=p,t.month=h,t.day=f,t.hour=A,t.minute=_,t.second=y,t.millisecond=C,t.isLeapSecond=n,t):new Qg(p,h,f,A,_,y,C,n)};kt.toDate=function(e){let t=kt.toGregorianDate(e,_ne),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))};kt.toIso8601=function(e,t){let n=kt.toGregorianDate(e,_ne),i=n.year,o=n.month,r=n.day,a=n.hour,s=n.minute,c=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&a===0&&s===0&&c===0&&u===0&&(i=9999,o=12,r=31,a=24);let f;if(!l(t)&&u!==0){let h=u*.01;return f=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`}return!l(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}.${f}Z`)};kt.clone=function(e,t){if(l(e))return l(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new kt(e.dayNumber,e.secondsOfDay,ai.TAI)};kt.compare=function(e,t){let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};kt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};kt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(kt.secondsDifference(e,t))<=n};kt.totalDays=function(e){return e.dayNumber+e.secondsOfDay/ci.SECONDS_PER_DAY};kt.secondsDifference=function(e,t){return(e.dayNumber-t.dayNumber)*ci.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};kt.daysDifference=function(e,t){let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/ci.SECONDS_PER_DAY;return n+i};kt.computeTaiMinusUtc=function(e){xI.julianDate=e;let t=kt.leapSeconds,n=Io(t,xI,gW);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};kt.addSeconds=function(e,t,n){return kg(e.dayNumber,e.secondsOfDay+t,n)};kt.addMinutes=function(e,t,n){let i=e.secondsOfDay+t*ci.SECONDS_PER_MINUTE;return kg(e.dayNumber,i,n)};kt.addHours=function(e,t,n){let i=e.secondsOfDay+t*ci.SECONDS_PER_HOUR;return kg(e.dayNumber,i,n)};kt.addDays=function(e,t,n){let i=e.dayNumber+t;return kg(i,e.secondsOfDay,n)};kt.lessThan=function(e,t){return kt.compare(e,t)<0};kt.lessThanOrEquals=function(e,t){return kt.compare(e,t)<=0};kt.greaterThan=function(e,t){return kt.compare(e,t)>0};kt.greaterThanOrEquals=function(e,t){return kt.compare(e,t)>=0};kt.prototype.clone=function(e){return kt.clone(this,e)};kt.prototype.equals=function(e){return kt.equals(this,e)};kt.prototype.equalsEpsilon=function(e,t){return kt.equalsEpsilon(this,e,t)};kt.prototype.toString=function(){return kt.toIso8601(this)};kt.leapSeconds=[new ho(new kt(2441317,43210,ai.TAI),10),new ho(new kt(2441499,43211,ai.TAI),11),new ho(new kt(2441683,43212,ai.TAI),12),new ho(new kt(2442048,43213,ai.TAI),13),new ho(new kt(2442413,43214,ai.TAI),14),new ho(new kt(2442778,43215,ai.TAI),15),new ho(new kt(2443144,43216,ai.TAI),16),new ho(new kt(2443509,43217,ai.TAI),17),new ho(new kt(2443874,43218,ai.TAI),18),new ho(new kt(2444239,43219,ai.TAI),19),new ho(new kt(2444786,43220,ai.TAI),20),new ho(new kt(2445151,43221,ai.TAI),21),new ho(new kt(2445516,43222,ai.TAI),22),new ho(new kt(2446247,43223,ai.TAI),23),new ho(new kt(2447161,43224,ai.TAI),24),new ho(new kt(2447892,43225,ai.TAI),25),new ho(new kt(2448257,43226,ai.TAI),26),new ho(new kt(2448804,43227,ai.TAI),27),new ho(new kt(2449169,43228,ai.TAI),28),new ho(new kt(2449534,43229,ai.TAI),29),new ho(new kt(2450083,43230,ai.TAI),30),new ho(new kt(2450630,43231,ai.TAI),31),new ho(new kt(2451179,43232,ai.TAI),32),new ho(new kt(2453736,43233,ai.TAI),33),new ho(new kt(2454832,43234,ai.TAI),34),new ho(new kt(2456109,43235,ai.TAI),35),new ho(new kt(2457204,43236,ai.TAI),36),new ho(new kt(2457754,43237,ai.TAI),37)];var X=kt;var Fne=Na(Fu(),1);function zPe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var BM=zPe;function Tne(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=Tne(o,t)),n[i]=o}return n}var Ye=Tne;function Sne(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),a,s,c;if(o)for(a in e)e.hasOwnProperty(a)&&(s=e[a],r&&n&&typeof s=="object"&&t.hasOwnProperty(a)?(c=t[a],typeof c=="object"?i[a]=Sne(s,c,n):i[a]=s):i[a]=s);if(r)for(a in t)t.hasOwnProperty(a)&&!i.hasOwnProperty(a)&&(c=t[a],i[a]=c);return i}var Pt=Sne;function GPe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Qu=GPe;var wne=Na(Fu(),1);function CW(e,t){let n;return typeof document<"u"&&(n=document),CW._implementation(e,t,n)}CW._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new wne.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var tA=CW;var Bne=Na(Fu(),1);function VPe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Bne.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var DM=VPe;var Dne=Na(Fu(),1);function HPe(e){let t=new Dne.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 Ug=HPe;var vne={};function WPe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=vne[t];l(i)||(i={},vne[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var mm=WPe;var jPe=/^blob:/i;function YPe(e){return jPe.test(e)}var wI=YPe;var pm;function qPe(e){l(pm)||(pm=document.createElement("a")),pm.href=window.location.href;let t=pm.host,n=pm.protocol;return pm.href=e,pm.href=pm.href,n!==pm.protocol||t!==pm.host}var vC=qPe;var KPe=/^data:/i;function XPe(e){return KPe.test(e)}var Am=XPe;function JPe(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 BI=JPe;function ZPe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,a=i.length;r<a;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var DI=ZPe;function $Pe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),a=decodeURIComponent(r[0]),s=r[1];l(s)?s=decodeURIComponent(s):s="";let c=t[a];typeof c=="string"?t[a]=[c,s]:Array.isArray(c)?c.push(s):t[a]=s}return t}var Ff=$Pe;var eRe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},yi=Object.freeze(eRe);var tRe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},es=Object.freeze(tRe);function vM(e){e=e??V.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??es.OTHER,this.serverKey=e.serverKey,this.state=yi.UNISSUED,this.deferred=void 0,this.cancelled=!1}vM.prototype.cancel=function(){this.cancelled=!0};vM.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=yi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new vM(this)};var Br=vM;function nRe(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 a=o.substring(0,r),s=o.substring(r+2);t[a]=s}}return t}var PM=nRe;function Pne(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=PM(this.responseHeaders))}Pne.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var nA=Pne;var MM=Na(Fu(),1);function gw(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(gw.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});gw.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return IW(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function IW(e,t,n,i){t.has(n)||t.set(n,new Set);let o=t.get(n);return o.has(i)?!1:(o.add(i),!0)}gw.prototype.removeEventListener=function(e,t){let n=EW(this,this._listeners,e,t),i=EW(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function EW(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!IW(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}gw.prototype.raiseEvent=function(){this._invokingListeners=!0;for(let[e,t]of this._listeners.entries())if(l(e))for(let n of t)e.apply(n,arguments);this._invokingListeners=!1;for(let[e,t]of this._toAdd.entries())for(let n of t)IW(this,this._listeners,e,n);this._toAdd.clear();for(let[e,t]of this._toRemove.entries())for(let n of t)EW(this,this._listeners,e,n);this._toRemove.clear()};var _e=gw;function PC(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(PC.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function bW(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}PC.prototype.reserve=function(e){e=e??this._length,this._array.length=e};PC.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let a=2*(e+1),s=a-1;s<t&&n(i[s],i[e])<0?o=s:o=e,a<t&&n(i[a],i[o])<0&&(o=a),o!==e?(bW(i,o,e),e=o):r=!1}};PC.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};PC.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let a=Math.floor((o-1)/2);if(n(t[o],t[a])<0)bW(t,o,a),o=a;else break}let r;return l(i)&&this._length>i&&(r=t[i],this._length=i),r};PC.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return bW(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var RM=PC;function iRe(e,t){return e.priority-t.priority}var po={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},vI=20,vc=new RM({comparator:iRe});vc.maximumLength=vI;vc.reserve(vI);var gm=[],iA={},oRe=typeof document<"u"?new MM.default(document.location.href):new MM.default,NM=new _e;function Ar(){}Ar.maximumRequests=50;Ar.maximumRequestsPerServer=18;Ar.requestsByServer={};Ar.throttleRequests=!0;Ar.debugShowStatistics=!1;Ar.requestCompletedEvent=NM;Object.defineProperties(Ar,{statistics:{get:function(){return po}},priorityHeapLength:{get:function(){return vI},set:function(e){if(e<vI)for(;vc.length>e;){let t=vc.pop();RC(t)}vI=e,vc.maximumLength=e,vc.reserve(e)}}});function Rne(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ar.serverHasOpenSlots=function(e,t){t=t??1;let n=Ar.requestsByServer[e]??Ar.maximumRequestsPerServer;return iA[e]+t<=n};Ar.heapHasOpenSlots=function(e){return vc.length+e<=vI};function Mne(e){return e.state===yi.UNISSUED&&(e.state=yi.ISSUED,e.deferred=Qu()),e.deferred.promise}function rRe(e){return function(t){if(e.state===yi.CANCELLED)return;let n=e.deferred;--po.numberOfActiveRequests,--iA[e.serverKey],NM.raiseEvent(),e.state=yi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function aRe(e){return function(t){e.state!==yi.CANCELLED&&(++po.numberOfFailedRequests,--po.numberOfActiveRequests,--iA[e.serverKey],NM.raiseEvent(t),e.state=yi.FAILED,e.deferred.reject(t))}}function Nne(e){let t=Mne(e);return e.state=yi.ACTIVE,gm.push(e),++po.numberOfActiveRequests,++po.numberOfActiveRequestsEver,++iA[e.serverKey],e.requestFunction().then(rRe(e)).catch(aRe(e)),t}function RC(e){let t=e.state===yi.ACTIVE;if(e.state=yi.CANCELLED,++po.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--po.numberOfActiveRequests,--iA[e.serverKey],++po.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Ar.update=function(){let e,t,n=0,i=gm.length;for(e=0;e<i;++e){if(t=gm[e],t.cancelled&&RC(t),t.state!==yi.ACTIVE){++n;continue}n>0&&(gm[e-n]=t)}gm.length-=n;let o=vc.internalArray,r=vc.length;for(e=0;e<r;++e)Rne(o[e]);vc.resort();let a=Math.max(Ar.maximumRequests-gm.length,0),s=0;for(;s<a&&vc.length>0;){if(t=vc.pop(),t.cancelled){RC(t);continue}if(t.throttleByServer&&!Ar.serverHasOpenSlots(t.serverKey)){RC(t);continue}Nne(t),++s}sRe()};Ar.getServerKey=function(e){let t=new MM.default(e);t.scheme()===""&&(t=t.absoluteTo(oRe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=iA[n];return l(i)||(iA[n]=0),n};Ar.request=function(e){if(Am(e.url)||wI(e.url))return NM.raiseEvent(),e.state=yi.RECEIVED,e.requestFunction();if(++po.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Ar.getServerKey(e.url)),Ar.throttleRequests&&e.throttleByServer&&!Ar.serverHasOpenSlots(e.serverKey))return;if(!Ar.throttleRequests||!e.throttle)return Nne(e);if(gm.length>=Ar.maximumRequests)return;Rne(e);let t=vc.insert(e);if(l(t)){if(t===e)return;RC(t)}return Mne(e)};function sRe(){Ar.debugShowStatistics&&(po.numberOfActiveRequests===0&&po.lastNumberOfActiveRequests>0&&(po.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${po.numberOfAttemptedRequests}`),po.numberOfAttemptedRequests=0),po.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${po.numberOfCancelledRequests}`),po.numberOfCancelledRequests=0),po.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${po.numberOfCancelledActiveRequests}`),po.numberOfCancelledActiveRequests=0),po.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${po.numberOfFailedRequests}`),po.numberOfFailedRequests=0)),po.lastNumberOfActiveRequests=po.numberOfActiveRequests)}Ar.clearForSpecs=function(){for(;vc.length>0;){let t=vc.pop();RC(t)}let e=gm.length;for(let t=0;t<e;++t)RC(gm[t]);gm.length=0,iA={},po.numberOfAttemptedRequests=0,po.numberOfActiveRequests=0,po.numberOfCancelledRequests=0,po.numberOfCancelledActiveRequests=0,po.numberOfFailedRequests=0,po.numberOfActiveRequestsEver=0,po.lastNumberOfActiveRequests=0};Ar.numberOfActiveRequestsByServer=function(e){return iA[e]};Ar.requestHeap=vc;var sl=Ar;var Lne=Na(Fu(),1);var _w={},PI={};_w.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PI[n])||(PI[n]=!0)};_w.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PI[n])&&delete PI[n]};function cRe(e){let t=new Lne.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}}_w.contains=function(e){let t=cRe(e);return!!(l(t)&&l(PI[t]))};_w.clear=function(){PI={}};var yw=_w;var Qne=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function Ot(e){e=e??V.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=_m(e.templateValues,{}),this._queryParameters=_m(e.queryParameters,{}),this.headers=_m(e.headers,{}),this.request=e.request??new Br,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 _m(e,t){return l(e)?Ye(e):t}Ot.createIfNeeded=function(e){return e instanceof Ot?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new Ot({url:e})};var RI;Ot.supportsImageBitmapOptions=function(){return l(RI)?RI:typeof createImageBitmap!="function"?(RI=Promise.resolve(!1),RI):(RI=Ot.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=mm(t[0]),i=mm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),RI)};Object.defineProperties(Ot,{isBlobSupported:{get:function(){return Qne}}});Object.defineProperties(Ot.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 Ug(this._url)}},isDataUri:{get:function(){return Am(this._url)}},isBlobUri:{get:function(){return wI(this._url)}},isCrossOriginUrl:{get:function(){return vC(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});Ot.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ot.prototype.parseUrl=function(e,t,n,i){let o=new Fne.default(e),r=lRe(o.query());this._queryParameters=t?OM(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(tA(i))),this._url=o.toString()};function lRe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ff(e)}function OM(e,t,n){if(!n)return Pt(e,t);let i=Ye(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],a=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(a)):i[o]=Array.isArray(a)?a.slice():a}return i}Ot.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${uRe(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 a=i[r];return l(a)?encodeURIComponent(a):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function uRe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${DI(e)}`}Ot.prototype.setQueryParameters=function(e,t){t?this._queryParameters=OM(this._queryParameters,e,!1):this._queryParameters=OM(e,this._queryParameters,!1)};Ot.prototype.appendQueryParameters=function(e){this._queryParameters=OM(e,this._queryParameters,!0)};Ot.prototype.setTemplateValues=function(e,t){t?this._templateValues=Pt(this._templateValues,e):this._templateValues=Pt(e,this._templateValues)};Ot.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Pt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Pt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Pt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Ot.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})};Ot.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ye(this._queryParameters),e._templateValues=Ye(this._templateValues),e.headers=Ye(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Ot({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Ot.prototype.getBaseUri=function(e){return DM(this.getUrlComponent(e),e)};Ot.prototype.appendForwardSlash=function(){this._url=BM(this._url)};Ot.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Ot.fetchArrayBuffer=function(e){return new Ot(e).fetchArrayBuffer()};Ot.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Ot.fetchBlob=function(e){return new Ot(e).fetchBlob()};Ot.prototype.fetchImage=function(e){e=e??V.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(xW(this.request),!Qne||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let a,s,c,u;return Ot.supportsImageBitmapOptions().then(function(f){return a=f,s=a&&t,r}).then(function(f){if(!l(f))return;if(u=f,s)return Ot.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return c=new Ot({url:h}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,s||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};Ot.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let s=!1;!t.isDataUri&&!t.isBlobUri&&(s=t.isCrossOriginUrl);let c=Qu();return Ot._Implementations.createImage(r,s,c,n,i,o),c.promise};let a=sl.request(r);if(l(a))return a.catch(function(s){return r.state!==yi.FAILED?Promise.reject(s):t.retryOnError(s).then(function(c){return c?(r.state=yi.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(s)})})};Ot.fetchImage=function(e){return new Ot(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Ot.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Ot.fetchText=function(e){return new Ot(e).fetchText()};Ot.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Ot.fetchJson=function(e){return new Ot(e).fetchJson()};Ot.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Ot.fetchXML=function(e){return new Ot(e).fetchXML()};Ot.prototype.fetchJsonp=function(e){e=e??"callback",xW(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return kne(this,e,t)};function kne(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 s=Qu();return window[n]=function(c){s.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Ot._Implementations.loadAndExecuteScript(r,n,s),s.promise};let a=sl.request(o);if(l(a))return a.catch(function(s){return o.state!==yi.FAILED?Promise.reject(s):e.retryOnError(s).then(function(c){return c?(o.state=yi.UNISSUED,o.deferred=void 0,kne(e,t,n)):Promise.reject(s)})})}Ot.fetchJsonp=function(e){return new Ot(e).fetchJsonp(e.callbackParameterName)};Ot.prototype._makeRequest=function(e){let t=this;xW(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,a=Pt(e.headers,t.headers),s=e.overrideMimeType,c=e.method,u=e.data,f=Qu(),h=Ot._Implementations.loadWithXhr(i,r,c,u,a,f,s);return l(h)&&l(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=sl.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==yi.FAILED?Promise.reject(r):t.retryOnError(r).then(function(a){return a?(n.state=yi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function xW(e){if(e.state===yi.ISSUED||e.state===yi.ACTIVE)throw new ue("The Resource is already being fetched.");e.state=yi.UNISSUED,e.deferred=void 0}var fRe=/^data:(.*?)(;base64)?,(.*)$/;function LM(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function One(e,t){let n=LM(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 dRe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,a;switch(t){case"":case"text":return LM(i,o);case"arraybuffer":return One(i,o);case"blob":return r=One(i,o),new Blob([r],{type:n});case"document":return a=new DOMParser,a.parseFromString(LM(i,o),n);case"json":return JSON.parse(LM(i,o));default:}}Ot.prototype.fetch=function(e){return e=_m(e,{}),e.method="GET",this._makeRequest(e)};Ot.fetch=function(e){return new Ot(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ot.prototype.delete=function(e){return e=_m(e,{}),e.method="DELETE",this._makeRequest(e)};Ot.delete=function(e){return new Ot(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};Ot.prototype.head=function(e){return e=_m(e,{}),e.method="HEAD",this._makeRequest(e)};Ot.head=function(e){return new Ot(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ot.prototype.options=function(e){return e=_m(e,{}),e.method="OPTIONS",this._makeRequest(e)};Ot.options=function(e){return new Ot(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ot.prototype.post=function(e,t){return Wo.defined("data",e),t=_m(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};Ot.post=function(e){return new Ot(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ot.prototype.put=function(e,t){return Wo.defined("data",e),t=_m(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};Ot.put=function(e){return new Ot(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ot.prototype.patch=function(e,t){return Wo.defined("data",e),t=_m(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};Ot.patch=function(e){return new Ot(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};Ot._Implementations={};Ot._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&&(yw.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};Ot._Implementations.createImage=function(e,t,n,i,o,r,a){let s=e.url;Ot.supportsImageBitmapOptions().then(function(c){if(!(c&&r)){Ot._Implementations.loadImageElement(s,t,n);return}let u="blob",f="GET",h=Qu(),p=Ot._Implementations.loadWithXhr(s,u,f,void 0,a,h,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),h.promise.then(function(A){if(!l(A)){n.reject(new ue(`Successfully retrieved ${s} but it contained no content.`));return}return Ot.createImageBitmapFromBlob(A,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(A){n.resolve(A)})}).catch(function(c){n.reject(c)})};Ot.createImageBitmapFromBlob=function(e,t){return Wo.defined("options",t),Wo.typeOf.bool("options.flipY",t.flipY),Wo.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Wo.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function hRe(e,t,n,i,o,r,a){fetch(e,{method:n,headers:o}).then(async s=>{if(!s.ok){let c={};s.headers.forEach((u,f)=>{c[f]=u}),r.reject(new nA(s.status,s,c));return}switch(t){case"text":r.resolve(s.text());break;case"json":r.resolve(s.json());break;default:r.resolve(new Uint8Array(await s.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new nA)})}var mRe=typeof XMLHttpRequest>"u";Ot._Implementations.loadWithXhr=function(e,t,n,i,o,r,a){let s=fRe.exec(e);if(s!==null){r.resolve(dRe(s,t));return}if(mRe){hRe(e,t,n,i,o,r,a);return}let c=new XMLHttpRequest;if(yw.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(a)&&l(c.overrideMimeType)&&c.overrideMimeType(a),l(o))for(let f in o)o.hasOwnProperty(f)&&c.setRequestHeader(f,o[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){r.reject(new nA(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,h=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let A=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};A.forEach(function(_){let y=_.split(": "),C=y.shift();m[C]=y.join(": ")}),r.resolve(m);return}if(c.status===204)r.resolve(void 0);else if(l(f)&&(!l(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(h===""||h==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ue("Invalid XMLHttpRequest response type."))},c.onerror=function(f){r.reject(new nA)},c.send(i),c};Ot._Implementations.loadAndExecuteScript=function(e,t,n){return BI(e,t).catch(function(i){n.reject(i)})};Ot._DefaultImplementations={};Ot._DefaultImplementations.createImage=Ot._Implementations.createImage;Ot._DefaultImplementations.loadWithXhr=Ot._Implementations.loadWithXhr;Ot._DefaultImplementations.loadAndExecuteScript=Ot._Implementations.loadAndExecuteScript;Ot.DEFAULT=Object.freeze(new Ot({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=Ot;function Ew(e){e=e??V.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?Une(this,e.data):Une(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Ew.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ue(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new Ew({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};Ew.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new DC(0,0,0,0,0),t}});Ew.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new DC(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(l(i)){let s=n[i],c=n[i+1],u=X.lessThanOrEquals(s,e),f=!l(c),h=f||X.greaterThanOrEquals(c,e);if(u&&h)return o=i,!f&&c.equals(e)&&++o,r=o+1,Gne(this,n,this._samples,e,o,r,t),t}let a=Io(n,e,X.compare,this._dateColumn);return a>=0?(a<n.length-1&&n[a+1].equals(e)&&++a,o=a,r=a):(r=~a,o=r-1,o<0&&(o=0)),this._lastIndex=o,Gne(this,n,this._samples,e,o,r,t),t};function pRe(e,t){return X.compare(e.julianDate,t)}function Une(e,t){if(!l(t.columnNames))throw new ue("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new ue("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),a=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),s=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||a<0||s<0||c<0)throw new ue("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=a,e._yCelestialPoleOffsetRadiansColumn=s,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let A=0,m=u.length;A<m;A+=e._columnCount){let _=u[A+n],y=u[A+c],C=_+ci.MODIFIED_JULIAN_DATE_DIFFERENCE,E=new X(C,y,ai.TAI);if(f.push(E),p){if(y!==h&&l(h)){let I=X.leapSeconds,x=Io(I,E,pRe);if(x<0){let S=new ho(E,y);I.splice(~x,0,S)}}h=y}}}function zne(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 Cw(e,t,n){return t+e*(n-t)}function Gne(e,t,n,i,o,r,a){let s=e._columnCount;if(r>t.length-1)return a.xPoleWander=0,a.yPoleWander=0,a.xPoleOffset=0,a.yPoleOffset=0,a.ut1MinusUtc=0,a;let c=t[o],u=t[r];if(c.equals(u)||i.equals(c))return zne(e,n,o,s,a),a;if(i.equals(u))return zne(e,n,r,s,a),a;let f=X.secondsDifference(i,c)/X.secondsDifference(u,c),h=o*s,p=r*s,A=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],_=m-A;if(_>.5||_<-.5){let y=n[h+e._taiMinusUtcSecondsColumn],C=n[p+e._taiMinusUtcSecondsColumn];y!==C&&(u.equals(i)?A=m:m-=C-y)}return a.xPoleWander=Cw(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),a.yPoleWander=Cw(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),a.xPoleOffset=Cw(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),a.yPoleOffset=Cw(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),a.ut1MinusUtc=Cw(f,A,m),a}var FM=Ew;function Pc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Pc.fromQuaternion=function(e,t){l(t)||(t=new Pc);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),a=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(a,r),t.roll=Math.atan2(o,i),t.pitch=-D.asinClamped(n),t};Pc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Pc),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};Pc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Pc(e.heading,e.pitch,e.roll)};Pc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Pc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};Pc.prototype.clone=function(e){return Pc.clone(this,e)};Pc.prototype.equals=function(e){return Pc.equals(this,e)};Pc.prototype.equalsEpsilon=function(e,t,n){return Pc.equalsEpsilon(this,e,t,n)};Pc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Rc=Pc;var Vne=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function ARe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=Vne.exec(i);if(o!==null)return o[1]}}var QM;function Hne(e){return typeof document>"u"?e:(l(QM)||(QM=document.createElement("a")),QM.href=e,QM.href)}var MC;function Wne(){if(l(MC))return MC;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=tA(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(rM.toUrl)?e=tA("..",NC("Core/buildModuleUrl.js")):e=ARe(),MC=new De({url:Hne(e)}),MC.appendForwardSlash(),MC}function gRe(e){return Hne(rM.toUrl(`../${e}`))}function jne(e){return Wne().getDerivedResource({url:e}).url}var kM;function NC(e){return l(kM)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(rM.toUrl)?kM=gRe:kM=jne),kM(e)}NC._cesiumScriptRegex=Vne;NC._buildModuleUrlFromBaseUrl=jne;NC._clearBaseResource=function(){MC=void 0};NC.setBaseUrl=function(e){MC=De.DEFAULT.getDerivedResource({url:e})};NC.getCesiumBaseUrl=Wne;var Zt=NC;function _Re(e,t,n){this.x=e,this.y=t,this.s=n}var MI=_Re;function wW(e){e=e??V.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new X(this._sampleZeroJulianEphemerisDate,0,ai.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 a=0;a<=t;++a)a!==r&&(n[r]*=r-a);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var yRe=new X(0,0,ai.TAI);function TW(e,t,n){let i=yRe;return i.dayNumber=t,i.secondsOfDay=n,X.daysDifference(i,e._sampleZeroDateTT)}wW.prototype.preload=function(e,t,n,i){let o=TW(this,e,t),r=TW(this,n,i),a=o/this._stepSizeDays-this._interpolationOrder/2|0;a<0&&(a=0);let s=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;s>=this._totalSamples&&(s=this._totalSamples-1);let c=a/this._samplesPerXysFile|0,u=s/this._samplesPerXysFile|0,f=[];for(let h=c;h<=u;++h)f.push(SW(this,h));return Promise.all(f)};wW.prototype.computeXysRadians=function(e,t,n){let i=TW(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,a=o-(r/2|0);a<0&&(a=0);let s=a+r;s>=this._totalSamples&&(s=this._totalSamples-1,a=s-r,a<0&&(a=0));let c=!1,u=this._samples;if(l(u[a*3])||(SW(this,a/this._samplesPerXysFile|0),c=!0),l(u[s*3])||(SW(this,s/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new MI(0,0,0);let f=i-a*this._stepSizeDays,h=this._work,p=this._denominators,A=this._coef,m=this._xTable,_,y;for(_=0;_<=r;++_)h[_]=f-m[_];for(_=0;_<=r;++_){for(A[_]=1,y=0;y<=r;++y)y!==_&&(A[_]*=h[y]);A[_]*=p[_];let C=(a+_)*3;n.x+=A[_]*u[C++],n.y+=A[_]*u[C++],n.s+=A[_]*u[C]}return n};function SW(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let a=e._samples,s=r.samples,c=t*e._samplesPerXysFile*3;for(let u=0,f=s.length;u<f;++u)a[c+u]=s[u]});return e._chunkDownloadsInProgress[t]=o,o}var UM=wW;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var Iw=new d;dt.fromAxisAngle=function(e,t,n){let i=t/2,o=Math.sin(i);Iw=d.normalize(e,Iw);let r=Iw.x*o,a=Iw.y*o,s=Iw.z*o,c=Math.cos(i);return l(n)?(n.x=r,n.y=a,n.z=s,n.w=c,n):new dt(r,a,s,c)};var CRe=[1,2,0],ERe=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,o,r,a,s=e[J.COLUMN0ROW0],c=e[J.COLUMN1ROW1],u=e[J.COLUMN2ROW2],f=s+c+u;if(f>0)n=Math.sqrt(f+1),a=.5*n,n=.5/n,i=(e[J.COLUMN1ROW2]-e[J.COLUMN2ROW1])*n,o=(e[J.COLUMN2ROW0]-e[J.COLUMN0ROW2])*n,r=(e[J.COLUMN0ROW1]-e[J.COLUMN1ROW0])*n;else{let h=CRe,p=0;c>s&&(p=1),u>s&&u>c&&(p=2);let A=h[p],m=h[A];n=Math.sqrt(e[J.getElementIndex(p,p)]-e[J.getElementIndex(A,A)]-e[J.getElementIndex(m,m)]+1);let _=ERe;_[p]=.5*n,n=.5/n,a=(e[J.getElementIndex(m,A)]-e[J.getElementIndex(A,m)])*n,_[A]=(e[J.getElementIndex(A,p)]+e[J.getElementIndex(p,A)])*n,_[m]=(e[J.getElementIndex(m,p)]+e[J.getElementIndex(p,m)])*n,i=-_[0],o=-_[1],r=-_[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=a,t):new dt(i,o,r,a)};var Yne=new dt,qne=new dt,BW=new dt,Kne=new dt;dt.fromHeadingPitchRoll=function(e,t){return Kne=dt.fromAxisAngle(d.UNIT_X,e.roll,Yne),BW=dt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=dt.multiply(BW,Kne,BW),qne=dt.fromAxisAngle(d.UNIT_Z,-e.heading,Yne),dt.multiply(qne,t,t)};var zM=new d,DW=new d,Jd=new dt,Xne=new dt,GM=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,GM),dt.conjugate(GM,GM);for(let o=0,r=n-t+1;o<r;o++){let a=o*3;dt.unpack(e,(t+o)*4,Jd),dt.multiply(Jd,GM,Jd),Jd.w<0&&dt.negate(Jd,Jd),dt.computeAxis(Jd,zM);let s=dt.computeAngle(Jd);l(i)||(i=[]),i[a]=zM.x*s,i[a+1]=zM.y*s,i[a+2]=zM.z*s}};dt.unpackInterpolationResult=function(e,t,n,i,o){l(o)||(o=new dt),d.fromArray(e,0,DW);let r=d.magnitude(DW);return dt.unpack(t,i*4,Xne),r===0?dt.clone(dt.IDENTITY,Jd):dt.fromAxisAngle(DW,r,Jd),dt.multiply(Jd,Xne,o)};dt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,a=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=a,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};dt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,o=e.y,r=e.z,a=e.w,s=t.x,c=t.y,u=t.z,f=t.w,h=a*s+i*f+o*u-r*c,p=a*c-i*u+o*f+r*s,A=a*u+i*c-o*s+r*f,m=a*f-i*s-o*c-r*u;return n.x=h,n.y=p,n.z=A,n.w=m,n};dt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};dt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};dt.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var vW=new dt;dt.lerp=function(e,t,n,i){return vW=dt.multiplyByScalar(t,n,vW),i=dt.multiplyByScalar(e,1-n,i),dt.add(vW,i,i)};var Jne=new dt,PW=new dt,RW=new dt;dt.slerp=function(e,t,n,i){let o=dt.dot(e,t),r=t;if(o<0&&(o=-o,r=Jne=dt.negate(t,Jne)),1-o<D.EPSILON6)return dt.lerp(e,r,n,i);let a=Math.acos(o);return PW=dt.multiplyByScalar(e,Math.sin((1-n)*a),PW),RW=dt.multiplyByScalar(r,Math.sin(n*a),RW),i=dt.add(PW,RW,i),dt.multiplyByScalar(i,1/Math.sin(a),i)};dt.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=d.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var IRe=new d,bRe=new d,bw=new dt,NI=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let o=dt.conjugate(t,bw);dt.multiply(o,n,NI);let r=dt.log(NI,IRe);dt.multiply(o,e,NI);let a=dt.log(NI,bRe);return d.add(r,a,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),dt.exp(r,bw),dt.multiply(t,bw,i)};dt.squad=function(e,t,n,i,o,r){let a=dt.slerp(e,t,o,bw),s=dt.slerp(n,i,o,NI);return dt.slerp(a,s,2*o*(1-o),r)};var xRe=new dt,Zne=1.9011074535173003,VM=hn.supportsTypedArrays()?new Float32Array(8):[],HM=hn.supportsTypedArrays()?new Float32Array(8):[],oA=hn.supportsTypedArrays()?new Float32Array(8):[],rA=hn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;VM[e]=1/(t*n),HM[e]=t/n}VM[7]=Zne/136;HM[7]=Zne*8/17;dt.fastSlerp=function(e,t,n,i){let o=dt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let a=o-1,s=1-n,c=n*n,u=s*s;for(let A=7;A>=0;--A)oA[A]=(VM[A]*c-HM[A])*a,rA[A]=(VM[A]*u-HM[A])*a;let f=r*n*(1+oA[0]*(1+oA[1]*(1+oA[2]*(1+oA[3]*(1+oA[4]*(1+oA[5]*(1+oA[6]*(1+oA[7])))))))),h=s*(1+rA[0]*(1+rA[1]*(1+rA[2]*(1+rA[3]*(1+rA[4]*(1+rA[5]*(1+rA[6]*(1+rA[7])))))))),p=dt.multiplyByScalar(e,h,xRe);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,o,r){let a=dt.fastSlerp(e,t,o,bw),s=dt.fastSlerp(n,i,o,NI);return dt.fastSlerp(a,s,2*o*(1-o),r)};dt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};dt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Qe=dt;var fi={},MW={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"}},LI={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},NW={},Hl={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},zg=new d,Gg=new d,Vg=new d;fi.localFrameToFixedFrameGenerator=function(e,t){if(!MW.hasOwnProperty(e)||!MW[e].hasOwnProperty(t))throw new de("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=MW[e][t],i,o=e+t;return l(NW[o])?i=NW[o]:(i=function(r,a,s){if(l(s)||(s=new P),d.equalsEpsilon(r,d.ZERO,D.EPSILON14))d.unpack(LI[e],0,zg),d.unpack(LI[t],0,Gg),d.unpack(LI[n],0,Vg);else if(D.equalsEpsilon(r.x,0,D.EPSILON14)&&D.equalsEpsilon(r.y,0,D.EPSILON14)){let c=D.sign(r.z);d.unpack(LI[e],0,zg),e!=="east"&&e!=="west"&&d.multiplyByScalar(zg,c,zg),d.unpack(LI[t],0,Gg),t!=="east"&&t!=="west"&&d.multiplyByScalar(Gg,c,Gg),d.unpack(LI[n],0,Vg),n!=="east"&&n!=="west"&&d.multiplyByScalar(Vg,c,Vg)}else{a=a??te.default,a.geodeticSurfaceNormal(r,Hl.up);let c=Hl.up,u=Hl.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,Hl.east),d.cross(c,u,Hl.north),d.multiplyByScalar(Hl.up,-1,Hl.down),d.multiplyByScalar(Hl.east,-1,Hl.west),d.multiplyByScalar(Hl.north,-1,Hl.south),zg=Hl[e],Gg=Hl[t],Vg=Hl[n]}return s[0]=zg.x,s[1]=zg.y,s[2]=zg.z,s[3]=0,s[4]=Gg.x,s[5]=Gg.y,s[6]=Gg.z,s[7]=0,s[8]=Vg.x,s[9]=Vg.y,s[10]=Vg.z,s[11]=0,s[12]=r.x,s[13]=r.y,s[14]=r.z,s[15]=1,s},NW[o]=i),i};fi.eastNorthUpToFixedFrame=fi.localFrameToFixedFrameGenerator("east","north");fi.northEastDownToFixedFrame=fi.localFrameToFixedFrameGenerator("north","east");fi.northUpEastToFixedFrame=fi.localFrameToFixedFrameGenerator("north","up");fi.northWestUpToFixedFrame=fi.localFrameToFixedFrameGenerator("north","west");var TRe=new Qe,SRe=new d(1,1,1),wRe=new P;fi.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??fi.eastNorthUpToFixedFrame;let r=Qe.fromHeadingPitchRoll(t,TRe),a=P.fromTranslationQuaternionRotationScale(d.ZERO,r,SRe,wRe);return o=i(e,n,o),P.multiply(o,a,o)};var BRe=new P,DRe=new J;fi.headingPitchRollQuaternion=function(e,t,n,i,o){let r=fi.headingPitchRollToFixedFrame(e,t,n,i,BRe),a=P.getMatrix3(r,DRe);return Qe.fromRotationMatrix(a,o)};var vRe=new d(1,1,1),PRe=new d,$ne=new P,RRe=new P,MRe=new J,NRe=new Qe;fi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??te.default,n=n??fi.eastNorthUpToFixedFrame,l(i)||(i=new Rc);let o=P.getTranslation(e,PRe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=P.inverseTransformation(n(o,t,$ne),$ne),a=P.setScale(e,vRe,RRe);a=P.setTranslation(a,d.ZERO,a),r=P.multiply(r,a,r);let s=Qe.fromRotationMatrix(P.getMatrix3(r,MRe),NRe);return s=Qe.normalize(s,s),Rc.fromQuaternion(s,i)};var LRe=6*3600+2460+50.54841,ORe=8640184812866e-6,FRe=.093104,QRe=-62e-7,kRe=11772758384668e-32,URe=72921158553e-15,zRe=D.TWO_PI/86400,WM=new X;fi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=fi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=fi.computeTemeToPseudoFixedMatrix(e,t)),n};fi.computeTemeToPseudoFixedMatrix=function(e,t){WM=X.addSeconds(e,-X.computeTaiMinusUtc(e),WM);let n=WM.dayNumber,i=WM.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/ci.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/ci.DAYS_PER_JULIAN_CENTURY;let s=(LRe+o*(ORe+o*(FRe+o*QRe)))*zRe%D.TWO_PI,c=URe+kRe*(n-24515455e-1),u=(i+ci.SECONDS_PER_DAY*.5)%ci.SECONDS_PER_DAY,f=s+c*u,h=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new J(h,p,0,-p,h,0,0,0,1)};fi.iau2006XysData=new UM;fi.earthOrientationParameters=FM.NONE;var FW=32.184,GRe=2451545;fi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+FW,i=e.stop.dayNumber,o=e.stop.secondsOfDay+FW;return fi.iau2006XysData.preload(t,n,i,o)};fi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new J);let n=fi.computeFixedToIcrfMatrix(e,t);if(l(n))return J.transpose(n,t)};var VRe=32.184,HRe=2451545,jM=new Rc,WRe=new J,jRe=new X;fi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new J);let n=X.addSeconds(e,VRe,jRe),i=X.totalDays(n)-HRe,o=D.toRadians(12.112)-D.toRadians(.052992)*i,r=D.toRadians(24.224)-D.toRadians(.105984)*i,a=D.toRadians(227.645)+D.toRadians(13.012)*i,s=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return jM.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(o)-D.toRadians(.12)*Math.sin(r)+D.toRadians(.07)*Math.sin(a)-D.toRadians(.017)*Math.sin(s),jM.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(o)+D.toRadians(.24)*Math.cos(r)-D.toRadians(.028)*Math.cos(a)+D.toRadians(.007)*Math.cos(s),jM.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(o)+D.toRadians(.121)*Math.sin(r)-D.toRadians(.064)*Math.sin(a)+D.toRadians(.016)*Math.sin(s)+D.toRadians(.025)*Math.sin(c),J.fromHeadingPitchRoll(jM,WRe)};fi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new J);let n=fi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return J.transpose(n,t)};var YRe=new MI(0,0,0),qRe=new DC(0,0,0,0,0,0),LW=new J,OW=new J;fi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new J);let n=fi.earthOrientationParameters.compute(e,qRe);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+FW,r=fi.iau2006XysData.computeXysRadians(i,o,YRe);if(!l(r))return;let a=r.x+n.xPoleOffset,s=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-a*a-s*s)),u=LW;u[0]=1-c*a*a,u[3]=-c*a*s,u[6]=a,u[1]=-c*a*s,u[4]=1-c*s*s,u[7]=s,u[2]=-a,u[5]=-s,u[8]=1-c*(a*a+s*s);let f=J.fromRotationZ(-r.s,OW),h=J.multiply(u,f,LW),p=e.dayNumber,A=e.secondsOfDay-X.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,_=A/ci.SECONDS_PER_DAY,y=.779057273264+_+.00273781191135448*(m+_);y=y%1*D.TWO_PI;let C=J.fromRotationZ(y,OW),E=J.multiply(h,C,LW),I=Math.cos(n.xPoleWander),x=Math.cos(n.yPoleWander),S=Math.sin(n.xPoleWander),w=Math.sin(n.yPoleWander),v=i-GRe+o/ci.SECONDS_PER_DAY;v/=36525;let R=-47e-6*v*D.RADIANS_PER_DEGREE/3600,N=Math.cos(R),L=Math.sin(R),g=OW;return g[0]=I*N,g[1]=I*L,g[2]=S,g[3]=-x*L+w*S*N,g[4]=x*N+w*S*L,g[5]=-w*I,g[6]=-w*L-x*S*N,g[7]=w*N-x*S*L,g[8]=x*I,J.multiply(E,g,t)};var KRe=new ie;fi.pointToWindowCoordinates=function(e,t,n,i){return i=fi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};fi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new Q);let o=KRe;return P.multiplyByVector(e,ie.fromElements(n.x,n.y,n.z,1,o),o),ie.multiplyByScalar(o,1/o.w,o),P.multiplyByVector(t,o,o),Q.fromCartesian4(o,i)};var XRe=new d,JRe=new d,ZRe=new d;fi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??te.default).geodeticSurfaceNormal(e,XRe),r=d.cross(t,o,JRe);d.equalsEpsilon(r,d.ZERO,D.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let a=d.cross(r,t,ZRe);return d.normalize(a,a),d.cross(t,a,r),d.negate(r,r),d.normalize(r,r),l(i)||(i=new J),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]=a.x,i[7]=a.y,i[8]=a.z,i};fi.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var eie=new me,QW=new d,$Re=new d,eMe=new J,kW=new P,tie=new P;fi.basisTo2D=function(e,t,n){let i=P.getTranslation(t,$Re),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,QW);else{let f=o.cartesianToCartographic(i,eie);r=e.project(f,QW),d.fromElements(r.z,r.x,r.y,r)}let a=fi.eastNorthUpToFixedFrame(i,o,kW),s=P.inverseTransformation(a,tie),c=P.getMatrix3(t,eMe),u=P.multiplyByMatrix3(s,c,n);return P.multiply(fi.SWIZZLE_3D_TO_2D_MATRIX,u,n),P.setTranslation(n,r,n),n};fi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=fi.eastNorthUpToFixedFrame(t,i,kW),r=P.inverseTransformation(o,tie),a=i.cartesianToCartographic(t,eie),s=e.project(a,QW);d.fromElements(s.z,s.x,s.y,s);let c=P.fromTranslation(s,kW);return P.multiply(fi.SWIZZLE_3D_TO_2D_MATRIX,r,n),P.multiply(c,n,n),n};var At=fi;function Qn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(Qn.prototype,{width:{get:function(){return Qn.computeWidth(this)}},height:{get:function(){return Qn.computeHeight(this)}}});Qn.packedLength=4;Qn.pack=function(e,t,n){return n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};Qn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Qn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};Qn.computeWidth=function(e){let t=e.east,n=e.west;return t<n&&(t+=D.TWO_PI),t-n};Qn.computeHeight=function(e){return e.north-e.south};Qn.fromDegrees=function(e,t,n,i,o){return e=D.toRadians(e??0),t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),l(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new Qn(e,t,n,i)};Qn.fromRadians=function(e,t,n,i,o){return l(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new Qn(e,t,n,i)};Qn.fromCartographicArray=function(e,t){let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,a=Number.MAX_VALUE,s=-Number.MAX_VALUE;for(let c=0,u=e.length;c<u;c++){let f=e[c];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),a=Math.min(a,f.latitude),s=Math.max(s,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+D.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>D.PI&&(i=i-D.TWO_PI),n>D.PI&&(n=n-D.TWO_PI)),l(t)?(t.west=n,t.south=a,t.east=i,t.north=s,t):new Qn(n,a,i,s)};Qn.fromCartesianArray=function(e,t,n){t=t??te.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),s=Math.min(s,h.latitude),c=Math.max(c,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+D.TWO_PI;r=Math.min(r,p),a=Math.max(a,p)}return o-i>a-r&&(i=r,o=a,o>D.PI&&(o=o-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=s,n.east=o,n.north=c,n):new Qn(i,s,o,c)};var tMe=new d,nMe=new d,iMe=new d,oMe=new d,rMe=new d,UW=new Array(5);for(let e=0;e<UW.length;++e)UW[e]=new d;Qn.fromBoundingSphere=function(e,t,n){let i=e.center,o=e.radius;if(l(t)||(t=te.default),l(n)||(n=new Qn),d.equals(i,d.ZERO))return Qn.clone(Qn.MAX_VALUE,n),n;let r=At.eastNorthUpToFixedFrame(i,t,tMe),a=P.multiplyByPointAsVector(r,d.UNIT_X,nMe);d.normalize(a,a);let s=P.multiplyByPointAsVector(r,d.UNIT_Y,iMe);d.normalize(s,s),d.multiplyByScalar(s,o,s),d.multiplyByScalar(a,o,a);let c=d.negate(s,rMe),u=d.negate(a,oMe),f=UW,h=f[0];return d.add(i,s,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,c,h),h=f[3],d.add(i,a,h),f[4]=i,Qn.fromCartesianArray(f,t,n)};Qn.clone=function(e,t){if(l(e))return l(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new Qn(e.west,e.south,e.east,e.north)};Qn.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};Qn.prototype.clone=function(e){return Qn.clone(this,e)};Qn.prototype.equals=function(e){return Qn.equals(this,e)};Qn.equals=function(e,t){return e===t||l(e)&&l(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};Qn.prototype.equalsEpsilon=function(e,t){return Qn.equalsEpsilon(this,e,t)};Qn._validate=function(e){};Qn.southwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new me(e.west,e.south)};Qn.northwest=function(e,t){return l(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new me(e.west,e.north)};Qn.northeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new me(e.east,e.north)};Qn.southeast=function(e,t){return l(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new me(e.east,e.south)};Qn.center=function(e,t){let n=e.east,i=e.west;n<i&&(n+=D.TWO_PI);let o=D.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return l(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new me(o,r)};Qn.intersection=function(e,t,n){let i=e.east,o=e.west,r=t.east,a=t.west;i<o&&r>0?i+=D.TWO_PI:r<a&&i>0&&(r+=D.TWO_PI),i<o&&a<0?a+=D.TWO_PI:r<a&&o<0&&(o+=D.TWO_PI);let s=D.negativePiToPi(Math.max(o,a)),c=D.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&c<=s)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return l(n)?(n.west=s,n.south=u,n.east=c,n.north=f,n):new Qn(s,u,c,f)};Qn.simpleIntersection=function(e,t,n){let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),a=Math.min(e.north,t.north);if(!(o>=a||i>=r))return l(n)?(n.west=i,n.south=o,n.east=r,n.north=a,n):new Qn(i,o,r,a)};Qn.union=function(e,t,n){l(n)||(n=new Qn);let i=e.east,o=e.west,r=t.east,a=t.west;i<o&&r>0?i+=D.TWO_PI:r<a&&i>0&&(r+=D.TWO_PI),i<o&&a<0?a+=D.TWO_PI:r<a&&o<0&&(o+=D.TWO_PI);let s=D.negativePiToPi(Math.min(o,a)),c=D.negativePiToPi(Math.max(i,r));return n.west=s,n.south=Math.min(e.south,t.south),n.east=c,n.north=Math.max(e.north,t.north),n};Qn.expand=function(e,t,n){return l(n)||(n=new Qn),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};Qn.contains=function(e,t){let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=D.TWO_PI,n<0&&(n+=D.TWO_PI)),(n>o||D.equalsEpsilon(n,o,D.EPSILON14))&&(n<r||D.equalsEpsilon(n,r,D.EPSILON14))&&i>=e.south&&i<=e.north};var aMe=new me;Qn.subsample=function(e,t,n,i){t=t??te.default,n=n??0,l(i)||(i=[]);let o=0,r=e.north,a=e.south,s=e.east,c=e.west,u=aMe;u.height=n,u.longitude=c,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:a>0?u.latitude=a:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*D.PI_OVER_TWO,Qn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=c,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};Qn.subsection=function(e,t,n,i,o,r){if(l(r)||(r=new Qn),e.west<=e.east){let s=e.east-e.west;r.west=e.west+t*s,r.east=e.west+i*s}else{let s=D.TWO_PI+e.east-e.west;r.west=D.negativePiToPi(e.west+t*s),r.east=D.negativePiToPi(e.west+i*s)}let a=e.north-e.south;return r.south=e.south+n*a,r.north=e.south+o*a,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};Qn.MAX_VALUE=Object.freeze(new Qn(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ce=Qn;function $r(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}$r.packedLength=4;$r.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};$r.unpack=function(e,t,n){return t=t??0,l(n)||(n=new $r),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};$r.fromPoints=function(e,t){if(l(t)||(t=new $r),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,a=e[0].y;for(let s=1;s<n;s++){let c=e[s],u=c.x,f=c.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),a=Math.max(f,a)}return t.x=i,t.y=o,t.width=r-i,t.height=a-o,t};var nie=new qi,sMe=new me,cMe=new me;$r.fromRectangle=function(e,t,n){if(l(n)||(n=new $r),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;nie._ellipsoid=te.default,t=t??nie;let i=t.project(ce.southwest(e,sMe)),o=t.project(ce.northeast(e,cMe));return Q.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};$r.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new $r(e.x,e.y,e.width,e.height)};$r.union=function(e,t,n){l(n)||(n=new $r);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),a=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=a-o,n};$r.expand=function(e,t,n){n=$r.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};$r.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Xt.OUTSIDE:Xt.INTERSECTING};$r.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};$r.prototype.clone=function(e){return $r.clone(this,e)};$r.prototype.intersect=function(e){return $r.intersect(this,e)};$r.prototype.equals=function(e){return $r.equals(this,e)};var et=$r;var fc={POINTS:ee.POINTS,LINES:ee.LINES,LINE_LOOP:ee.LINE_LOOP,LINE_STRIP:ee.LINE_STRIP,TRIANGLES:ee.TRIANGLES,TRIANGLE_STRIP:ee.TRIANGLE_STRIP,TRIANGLE_FAN:ee.TRIANGLE_FAN};fc.isLines=function(e){return e===fc.LINES||e===fc.LINE_LOOP||e===fc.LINE_STRIP};fc.isTriangles=function(e){return e===fc.TRIANGLES||e===fc.TRIANGLE_STRIP||e===fc.TRIANGLE_FAN};fc.validate=function(e){return e===fc.POINTS||e===fc.LINES||e===fc.LINE_LOOP||e===fc.LINE_STRIP||e===fc.TRIANGLES||e===fc.TRIANGLE_STRIP||e===fc.TRIANGLE_FAN};var Pe=Object.freeze(fc);var OI=`in vec4 position;
|
|
in vec2 textureCoordinates;
|
|
|
|
out vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = position;
|
|
v_textureCoordinates = textureCoordinates;
|
|
}
|
|
`;var Or={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 xw(e){e=e??V.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Pe.TRIANGLES,this._vertexArray=e.vertexArray,this._count=e.count,this._offset=e.offset??0,this._instanceCount=e.instanceCount??0,this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=e.cull??!0,this.occlude=e.occlude??!0,this.executeInClosestFrustum=e.executeInClosestFrustum??!1,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.castShadows=e.castShadows??!1,this.receiveShadows=e.receiveShadows??!1,this.pickOnly=e.pickOnly??!1,this.depthForTranslucentClassification=e.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Mc(e,t){return(e._flags&t)===t}function Hg(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(xw.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 Mc(this,Or.CULL)},set:function(e){Mc(this,Or.CULL)!==e&&(Hg(this,Or.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Mc(this,Or.OCCLUDE)},set:function(e){Mc(this,Or.OCCLUDE)!==e&&(Hg(this,Or.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 Mc(this,Or.CAST_SHADOWS)},set:function(e){Mc(this,Or.CAST_SHADOWS)!==e&&(Hg(this,Or.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Mc(this,Or.RECEIVE_SHADOWS)},set:function(e){Mc(this,Or.RECEIVE_SHADOWS)!==e&&(Hg(this,Or.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 Mc(this,Or.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Mc(this,Or.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(Hg(this,Or.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 Mc(this,Or.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Mc(this,Or.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(Hg(this,Or.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 Mc(this,Or.PICK_ONLY)},set:function(e){Mc(this,Or.PICK_ONLY)!==e&&(Hg(this,Or.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Mc(this,Or.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Mc(this,Or.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(Hg(this,Or.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});xw.shallowClone=function(e,t){if(l(e))return l(t)||(t=new xw),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};xw.prototype.execute=function(e,t){e.draw(this,t)};var it=xw;var Di={UNSIGNED_BYTE:ee.UNSIGNED_BYTE,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,HALF_FLOAT:ee.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ee.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ee.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ee.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ee.UNSIGNED_SHORT_5_6_5};Di.toWebGLConstant=function(e,t){switch(e){case Di.UNSIGNED_BYTE:return ee.UNSIGNED_BYTE;case Di.UNSIGNED_SHORT:return ee.UNSIGNED_SHORT;case Di.UNSIGNED_INT:return ee.UNSIGNED_INT;case Di.FLOAT:return ee.FLOAT;case Di.HALF_FLOAT:return t.webgl2?ee.HALF_FLOAT:ee.HALF_FLOAT_OES;case Di.UNSIGNED_INT_24_8:return ee.UNSIGNED_INT_24_8;case Di.UNSIGNED_SHORT_4_4_4_4:return ee.UNSIGNED_SHORT_4_4_4_4;case Di.UNSIGNED_SHORT_5_5_5_1:return ee.UNSIGNED_SHORT_5_5_5_1;case Di.UNSIGNED_SHORT_5_6_5:return Di.UNSIGNED_SHORT_5_6_5}};Di.isPacked=function(e){return e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.sizeInBytes=function(e){switch(e){case Di.UNSIGNED_BYTE:return 1;case Di.UNSIGNED_SHORT:case Di.UNSIGNED_SHORT_4_4_4_4:case Di.UNSIGNED_SHORT_5_5_5_1:case Di.UNSIGNED_SHORT_5_6_5:case Di.HALF_FLOAT:return 2;case Di.UNSIGNED_INT:case Di.FLOAT:case Di.UNSIGNED_INT_24_8:return 4}};Di.validate=function(e){return e===Di.UNSIGNED_BYTE||e===Di.UNSIGNED_SHORT||e===Di.UNSIGNED_INT||e===Di.FLOAT||e===Di.HALF_FLOAT||e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.getTypedArrayConstructor=function(e){let t=Di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Di.FLOAT?Float32Array:Uint32Array};var He=Object.freeze(Di);var Je={DEPTH_COMPONENT:ee.DEPTH_COMPONENT,DEPTH_STENCIL:ee.DEPTH_STENCIL,ALPHA:ee.ALPHA,RED:ee.RED,R:ee.RED,RG:ee.RG,RGB:ee.RGB,RGBA:ee.RGBA,RED_INTEGER:ee.RED_INTEGER,RG_INTEGER:ee.RG_INTEGER,RGB_INTEGER:ee.RGB_INTEGER,RGBA_INTEGER:ee.RGBA_INTEGER,LUMINANCE:ee.LUMINANCE,LUMINANCE_ALPHA:ee.LUMINANCE_ALPHA,RGB_DXT1:ee.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ee.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ee.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ee.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ee.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ee.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ee.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ee.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ee.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ee.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ee.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ee.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ee.COMPRESSED_RGBA_BPTC_UNORM};Je.componentsLength=function(e){switch(e){case Je.RGB:case Je.RGB_INTEGER:return 3;case Je.RGBA:case Je.RGBA_INTEGER:return 4;case Je.LUMINANCE_ALPHA:case Je.RG:case Je.RG_INTEGER:return 2;case Je.ALPHA:case Je.RED:case Je.RED_INTEGER:case Je.LUMINANCE:return 1;case Je.R:return 4;default:return 1}};Je.validate=function(e){return e===Je.DEPTH_COMPONENT||e===Je.DEPTH_STENCIL||e===Je.ALPHA||e===Je.RED||e===Je.RG||e===Je.RGB||e===Je.RGBA||e===Je.RED_INTEGER||e===Je.RG_INTEGER||e===Je.RGB_INTEGER||e===Je.RGBA_INTEGER||e===Je.LUMINANCE||e===Je.LUMINANCE_ALPHA||e===Je.RGB_DXT1||e===Je.RGBA_DXT1||e===Je.RGBA_DXT3||e===Je.RGBA_DXT5||e===Je.RGB_PVRTC_4BPPV1||e===Je.RGB_PVRTC_2BPPV1||e===Je.RGBA_PVRTC_4BPPV1||e===Je.RGBA_PVRTC_2BPPV1||e===Je.RGBA_ASTC||e===Je.RGB_ETC1||e===Je.RGB8_ETC2||e===Je.RGBA8_ETC2_EAC||e===Je.RGBA_BC7||e===Je.R};Je.isColorFormat=function(e){return e===Je.RED||e===Je.ALPHA||e===Je.RGB||e===Je.RGBA||e===Je.LUMINANCE||e===Je.LUMINANCE_ALPHA||e===Je.R};Je.isDepthFormat=function(e){return e===Je.DEPTH_COMPONENT||e===Je.DEPTH_STENCIL};Je.isCompressedFormat=function(e){return e===Je.RGB_DXT1||e===Je.RGBA_DXT1||e===Je.RGBA_DXT3||e===Je.RGBA_DXT5||e===Je.RGB_PVRTC_4BPPV1||e===Je.RGB_PVRTC_2BPPV1||e===Je.RGBA_PVRTC_4BPPV1||e===Je.RGBA_PVRTC_2BPPV1||e===Je.RGBA_ASTC||e===Je.RGB_ETC1||e===Je.RGB8_ETC2||e===Je.RGBA8_ETC2_EAC||e===Je.RGBA_BC7};Je.isDXTFormat=function(e){return e===Je.RGB_DXT1||e===Je.RGBA_DXT1||e===Je.RGBA_DXT3||e===Je.RGBA_DXT5};Je.isPVRTCFormat=function(e){return e===Je.RGB_PVRTC_4BPPV1||e===Je.RGB_PVRTC_2BPPV1||e===Je.RGBA_PVRTC_4BPPV1||e===Je.RGBA_PVRTC_2BPPV1};Je.isASTCFormat=function(e){return e===Je.RGBA_ASTC};Je.isETC1Format=function(e){return e===Je.RGB_ETC1};Je.isETC2Format=function(e){return e===Je.RGB8_ETC2||e===Je.RGBA8_ETC2_EAC};Je.isBC7Format=function(e){return e===Je.RGBA_BC7};Je.compressedTextureSizeInBytes=function(e,t,n){switch(e){case Je.RGB_DXT1:case Je.RGBA_DXT1:case Je.RGB_ETC1:case Je.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case Je.RGBA_DXT3:case Je.RGBA_DXT5:case Je.RGBA_ASTC:case Je.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case Je.RGB_PVRTC_4BPPV1:case Je.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case Je.RGB_PVRTC_2BPPV1:case Je.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case Je.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};Je.textureSizeInBytes=function(e,t,n,i){let o=Je.componentsLength(e);return He.isPacked(t)&&(o=1),o*He.sizeInBytes(t)*n*i};Je.texture3DSizeInBytes=function(e,t,n,i,o){let r=Je.componentsLength(e);return He.isPacked(t)&&(r=1),r*He.sizeInBytes(t)*n*i*o};Je.alignmentInBytes=function(e,t,n){let i=Je.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};Je.createTypedArray=function(e,t,n,i){let o=He.getTypedArrayConstructor(t),r=Je.componentsLength(e)*n*i;return new o(r)};Je.flipY=function(e,t,n,i,o){if(o===1)return e;let r=Je.createTypedArray(t,n,i,o),a=Je.componentsLength(t),s=i*a;for(let c=0;c<o;++c){let u=c*i*a,f=(o-c-1)*i*a;for(let h=0;h<s;++h)r[f+h]=e[u+h]}return r};Je.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===Je.DEPTH_STENCIL)return ee.DEPTH24_STENCIL8;if(e===Je.DEPTH_COMPONENT){if(t===He.UNSIGNED_SHORT)return ee.DEPTH_COMPONENT16;if(t===He.UNSIGNED_INT)return ee.DEPTH_COMPONENT24}if(t===He.FLOAT)switch(e){case Je.RGBA:return ee.RGBA32F;case Je.RGB:return ee.RGB32F;case Je.RG:return ee.RG32F;case Je.RED:case Je.R:return ee.R32F}if(t===He.HALF_FLOAT)switch(e){case Je.RGBA:return ee.RGBA16F;case Je.RGB:return ee.RGB16F;case Je.RG:return ee.RG16F;case Je.RED:case Je.R:return ee.R16F}if(t===He.UNSIGNED_BYTE)switch(e){case Je.RGBA:return ee.RGBA8;case Je.RGB:return ee.RGB8;case Je.RG:return ee.RG8;case Je.RED:return ee.R8}if(t===He.INT)switch(e){case Je.RGBA_INTEGER:return ee.RGBA32I;case Je.RGB_INTEGER:return ee.RGB32I;case Je.RG_INTEGER:return ee.RG32I;case Je.RED_INTEGER:return ee.R32I}if(t===He.UNSIGNED_INT)switch(e){case Je.RGBA_INTEGER:return ee.RGBA32UI;case Je.RGB_INTEGER:return ee.RGB32UI;case Je.RG_INTEGER:return ee.RG32UI;case Je.RED_INTEGER:return ee.R32UI}return e};var Ke=Object.freeze(Je);var Dr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Dr,{maximumCombinedTextureImageUnits:{get:function(){return Dr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Dr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Dr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Dr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Dr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Dr._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Dr._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Dr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Dr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Dr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Dr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Dr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Dr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Dr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Dr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Dr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Dr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Dr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Dr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Dr._maximumColorAttachments}},maximumSamples:{get:function(){return Dr._maximumSamples}},highpFloatSupported:{get:function(){return Dr._highpFloatSupported}},highpIntSupported:{get:function(){return Dr._highpIntSupported}}});var Nt=Dr;function zW(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function YM(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Zd(e){e=e??V.EMPTY_OBJECT;let n=e.context._gl,i=Nt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let o=e.colorTextures,r=this._colorTextures.length=this._activeColorAttachments.length=o.length;for(let a=0;a<r;++a){let s=o[a],c=this._gl.COLOR_ATTACHMENT0+a;zW(this,c,s),this._activeColorAttachments[a]=c,this._colorTextures[a]=s}}if(l(e.colorRenderbuffers)){let o=e.colorRenderbuffers,r=this._colorRenderbuffers.length=this._activeColorAttachments.length=o.length;for(let a=0;a<r;++a){let s=o[a],c=this._gl.COLOR_ATTACHMENT0+a;YM(this,c,s),this._activeColorAttachments[a]=c,this._colorRenderbuffers[a]=s}}if(l(e.depthTexture)){let o=e.depthTexture;zW(this,this._gl.DEPTH_ATTACHMENT,o),this._depthTexture=o}if(l(e.depthRenderbuffer)){let o=e.depthRenderbuffer;YM(this,this._gl.DEPTH_ATTACHMENT,o),this._depthRenderbuffer=o}if(l(e.stencilRenderbuffer)){let o=e.stencilRenderbuffer;YM(this,this._gl.STENCIL_ATTACHMENT,o),this._stencilRenderbuffer=o}if(l(e.depthStencilTexture)){let o=e.depthStencilTexture;zW(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilTexture=o}if(l(e.depthStencilRenderbuffer)){let o=e.depthStencilRenderbuffer;YM(this,this._gl.DEPTH_STENCIL_ATTACHMENT,o),this._depthStencilRenderbuffer=o}this._unBind()}Object.defineProperties(Zd.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)}}});Zd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Zd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Zd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Zd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Zd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Zd.prototype.getColorTexture=function(e){return this._colorTextures[e]};Zd.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Zd.prototype.isDestroyed=function(){return!1};Zd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),fe(this)};var pa=Zd;var qM={CLOCKWISE:ee.CW,COUNTER_CLOCKWISE:ee.CCW};qM.validate=function(e){return e===qM.CLOCKWISE||e===qM.COUNTER_CLOCKWISE};var ts=Object.freeze(qM);function iie(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]=iie(e[t]));return Object.freeze(e)}var oie=iie;function Cm(e){let t=e??V.EMPTY_OBJECT,n=t.cull??V.EMPTY_OBJECT,i=t.polygonOffset??V.EMPTY_OBJECT,o=t.scissorTest??V.EMPTY_OBJECT,r=o.rectangle??V.EMPTY_OBJECT,a=t.depthRange??V.EMPTY_OBJECT,s=t.depthTest??V.EMPTY_OBJECT,c=t.colorMask??V.EMPTY_OBJECT,u=t.blending??V.EMPTY_OBJECT,f=u.color??V.EMPTY_OBJECT,h=t.stencilTest??V.EMPTY_OBJECT,p=h.frontOperation??V.EMPTY_OBJECT,A=h.backOperation??V.EMPTY_OBJECT,m=t.sampleCoverage??V.EMPTY_OBJECT,_=t.viewport;this.frontFace=t.frontFace??ts.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ee.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:et.clone(r)},this.depthRange={near:a.near??0,far:a.far??1},this.depthTest={enabled:s.enabled??!1,func:s.func??ee.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new U(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ee.FUNC_ADD,equationAlpha:u.equationAlpha??ee.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ee.ONE,functionSourceAlpha:u.functionSourceAlpha??ee.ONE,functionDestinationRgb:u.functionDestinationRgb??ee.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ee.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ee.ALWAYS,backFunction:h.backFunction??ee.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ee.KEEP,zFail:p.zFail??ee.KEEP,zPass:p.zPass??ee.KEEP},backOperation:{fail:A.fail??ee.KEEP,zFail:A.zFail??ee.KEEP,zPass:A.zPass??ee.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(_)?new et(_.x,_.y,_.width,_.height):void 0,this.id=0,this._applyFunctions=[]}var lMe=0,ym={};Cm.fromCache=function(e){let t=JSON.stringify(e),n=ym[t];if(l(n))return++n.referenceCount,n.state;let i=new Cm(e),o=JSON.stringify(i);return n=ym[o],l(n)||(i.id=lMe++,n={referenceCount:0,state:i},ym[o]=n),++n.referenceCount,ym[t]={referenceCount:1,state:n.state},n.state};Cm.removeFromCache=function(e){let t=new Cm(e),n=JSON.stringify(t),i=ym[n],o=JSON.stringify(e),r=ym[o];l(r)&&(--r.referenceCount,r.referenceCount===0&&(delete ym[o],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete ym[n]};Cm.getCache=function(){return ym};Cm.clearCache=function(){ym={}};function LC(e,t,n){n?e.enable(t):e.disable(t)}function rie(e,t){e.frontFace(t.frontFace)}function aie(e,t){let n=t.cull,i=n.enabled;LC(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function sie(e,t){e.lineWidth(t.lineWidth)}function cie(e,t){let n=t.polygonOffset,i=n.enabled;LC(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function lie(e,t,n){let i=t.scissorTest,o=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(LC(e,e.SCISSOR_TEST,o),o){let r=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function uie(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function fie(e,t){let n=t.depthTest,i=n.enabled;LC(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function die(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function hie(e,t){e.depthMask(t.depthMask)}function mie(e,t){e.stencilMask(t.stencilMask)}function uMe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function pie(e,t,n){let i=t.blending,o=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;LC(e,e.BLEND,o),o&&(uMe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Aie(e,t){let n=t.stencilTest,i=n.enabled;if(LC(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,a=n.reference,s=n.mask;e.stencilFunc(o,a,s),e.stencilFuncSeparate(e.BACK,r,a,s),e.stencilFuncSeparate(e.FRONT,o,a,s);let c=n.frontOperation,u=c.fail,f=c.zFail,h=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,A=p.fail,m=p.zFail,_=p.zPass;e.stencilOpSeparate(e.BACK,A,m,_)}}function gie(e,t){let n=t.sampleCoverage,i=n.enabled;LC(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var fMe=new et;function _ie(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=fMe,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)}Cm.apply=function(e,t,n){rie(e,t),aie(e,t),sie(e,t),cie(e,t),uie(e,t),fie(e,t),die(e,t),hie(e,t),mie(e,t),Aie(e,t),gie(e,t),lie(e,t,n),pie(e,t,n),_ie(e,t,n)};function dMe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(rie),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(aie),e.lineWidth!==t.lineWidth&&n.push(sie),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(cie),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(uie),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(fie),(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(die),e.depthMask!==t.depthMask&&n.push(hie),e.stencilMask!==t.stencilMask&&n.push(mie),(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(Aie),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(gie),n}Cm.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=dMe(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let a=l(i.scissorTest)?i.scissorTest:t.scissorTest,s=l(o.scissorTest)?o.scissorTest:n.scissorTest;(a!==s||r)&&lie(e,n,o);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&pie(e,n,o),(t!==n||i!==o||i.context!==o.context)&&_ie(e,n,o)};Cm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:et.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:U.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?et.clone(e.viewport):void 0}};var Ve=Cm;function rn(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}rn.packedLength=4;rn.pack=function(e,t,n){return n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};rn.unpack=function(e,t,n){return t=t??0,l(n)||(n=new rn),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};rn.packArray=function(e,t){let n=e.length,i=n*4;l(t)?!Array.isArray(t)&&t.length!==i||t.length!==i&&(t.length=i):t=new Array(i);for(let o=0;o<n;++o)rn.pack(e[o],t,o*4);return t};rn.unpackArray=function(e,t){let n=e.length;l(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=rn.unpack(e,i,t[o])}return t};rn.clone=function(e,t){if(l(e))return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new rn(e[0],e[2],e[1],e[3])};rn.fromArray=rn.unpack;rn.fromColumnMajorArray=function(e,t){return rn.clone(e,t)};rn.fromRowMajorArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new rn(e[0],e[1],e[2],e[3])};rn.fromScale=function(e,t){return l(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new rn(e.x,0,0,e.y)};rn.fromUniformScale=function(e,t){return l(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new rn(e,0,0,e)};rn.fromRotation=function(e,t){let n=Math.cos(e),i=Math.sin(e);return l(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new rn(n,-i,i,n)};rn.toArray=function(e,t){return l(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};rn.getElementIndex=function(e,t){return e*2+t};rn.getColumn=function(e,t,n){let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};rn.setColumn=function(e,t,n,i){i=rn.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};rn.getRow=function(e,t,n){let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};rn.setRow=function(e,t,n,i){return i=rn.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var hMe=new Q;rn.setScale=function(e,t,n){let i=rn.getScale(e,hMe),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 mMe=new Q;rn.setUniformScale=function(e,t,n){let i=rn.getScale(e,mMe),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 yie=new Q;rn.getScale=function(e,t){return t.x=Q.magnitude(Q.fromElements(e[0],e[1],yie)),t.y=Q.magnitude(Q.fromElements(e[2],e[3],yie)),t};var Cie=new Q;rn.getMaximumScale=function(e){return rn.getScale(e,Cie),Q.maximumComponent(Cie)};var pMe=new Q;rn.setRotation=function(e,t,n){let i=rn.getScale(e,pMe);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 AMe=new Q;rn.getRotation=function(e,t){let n=rn.getScale(e,AMe);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};rn.multiply=function(e,t,n){let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],a=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=a,n};rn.add=function(e,t,n){return n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};rn.subtract=function(e,t,n){return n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};rn.multiplyByVector=function(e,t,n){let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};rn.multiplyByScalar=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};rn.multiplyByScale=function(e,t,n){return n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};rn.multiplyByUniformScale=function(e,t,n){return n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};rn.negate=function(e,t){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};rn.transpose=function(e,t){let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};rn.abs=function(e,t){return t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};rn.equals=function(e,t){return e===t||l(e)&&l(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};rn.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]};rn.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};rn.IDENTITY=Object.freeze(new rn(1,0,0,1));rn.ZERO=Object.freeze(new rn(0,0,0,0));rn.COLUMN0ROW0=0;rn.COLUMN0ROW1=1;rn.COLUMN1ROW0=2;rn.COLUMN1ROW1=3;Object.defineProperties(rn.prototype,{length:{get:function(){return rn.packedLength}}});rn.prototype.clone=function(e){return rn.clone(this,e)};rn.prototype.equals=function(e){return rn.equals(this,e)};rn.prototype.equalsEpsilon=function(e,t){return rn.equalsEpsilon(this,e,t)};rn.prototype.toString=function(){return`(${this[0]}, ${this[2]})
|
|
(${this[1]}, ${this[3]})`};var Ki=rn;function gMe(e,t,n,i){switch(t.type){case e.FLOAT:return new Eie(e,t,n,i);case e.FLOAT_VEC2:return new Iie(e,t,n,i);case e.FLOAT_VEC3:return new bie(e,t,n,i);case e.FLOAT_VEC4:return new xie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:case e.SAMPLER_2D_ARRAY:return new KM(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new KM(e,t,n,i);case e.INT:case e.BOOL:return new Tie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Sie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new wie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new Bie(e,t,n,i);case e.FLOAT_MAT2:return new Die(e,t,n,i);case e.FLOAT_MAT3:return new vie(e,t,n,i);case e.FLOAT_MAT4:return new Pie(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Eie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Eie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function Iie(e,t,n,i){this.name=n,this.value=void 0,this._value=new Q,this._gl=e,this._location=i}Iie.prototype.set=function(){let e=this.value;Q.equals(e,this._value)||(Q.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function bie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}bie.prototype.set=function(){let e=this.value;e&&(l(e.red)?U.equals(e,this._value)||(this._value=U.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue)):l(e.x)&&(d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z))))};function xie(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}xie.prototype.set=function(){let e=this.value;l(e.red)?U.equals(e,this._value)||(this._value=U.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha)):l(e.x)&&(ie.equals(e,this._value)||(this._value=ie.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w)))};function KM(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}KM.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;t&&e.bindTexture(t._target,t._texture)};KM.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function Tie(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}Tie.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function Sie(e,t,n,i){this.name=n,this.value=void 0,this._value=new Q,this._gl=e,this._location=i}Sie.prototype.set=function(){let e=this.value;Q.equals(e,this._value)||(Q.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function wie(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}wie.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function Bie(e,t,n,i){this.name=n,this.value=void 0,this._value=new ie,this._gl=e,this._location=i}Bie.prototype.set=function(){let e=this.value;ie.equals(e,this._value)||(ie.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var _Me=new Float32Array(4);function Die(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ki,this._gl=e,this._location=i}Die.prototype.set=function(){if(!Ki.equalsArray(this.value,this._value,0)){Ki.clone(this.value,this._value);let e=Ki.toArray(this.value,_Me);this._gl.uniformMatrix2fv(this._location,!1,e)}};var yMe=new Float32Array(9);function vie(e,t,n,i){this.name=n,this.value=void 0,this._value=new J,this._gl=e,this._location=i}vie.prototype.set=function(){if(!J.equalsArray(this.value,this._value,0)){J.clone(this.value,this._value);let e=J.toArray(this.value,yMe);this._gl.uniformMatrix3fv(this._location,!1,e)}};var CMe=new Float32Array(16);function Pie(e,t,n,i){this.name=n,this.value=void 0,this._value=new P,this._gl=e,this._location=i}Pie.prototype.set=function(){if(!P.equalsArray(this.value,this._value,0)){P.clone(this.value,this._value);let e=P.toArray(this.value,CMe);this._gl.uniformMatrix4fv(this._location,!1,e)}};var XM=gMe;function EMe(e,t,n,i){switch(t.type){case e.FLOAT:return new Rie(e,t,n,i);case e.FLOAT_VEC2:return new Mie(e,t,n,i);case e.FLOAT_VEC3:return new Nie(e,t,n,i);case e.FLOAT_VEC4:return new Lie(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new GW(e,t,n,i);case e.INT:case e.BOOL:return new Oie(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new Fie(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new Qie(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new kie(e,t,n,i);case e.FLOAT_MAT2:return new Uie(e,t,n,i);case e.FLOAT_MAT3:return new zie(e,t,n,i);case e.FLOAT_MAT4:return new Gie(e,t,n,i);default:throw new ue(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function Rie(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]}Rie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function Mie(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]}Mie.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 a=e[r];Q.equalsArray(a,n,o)||(Q.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function Nie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}Nie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let a=e[r];l(a.red)?(a.red!==n[o]||a.green!==n[o+1]||a.blue!==n[o+2])&&(n[o]=a.red,n[o+1]=a.green,n[o+2]=a.blue,i=!0):l(a.x)&&(d.equalsArray(a,n,o)||(d.pack(a,n,o),i=!0)),o+=3}i&&this._gl.uniform3fv(this._location,n)};function Lie(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}Lie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let a=e[r];l(a.red)?U.equalsArray(a,n,o)||(U.pack(a,n,o),i=!0):l(a.x)&&(ie.equalsArray(a,n,o)||(ie.pack(a,n,o),i=!0)),o+=4}i&&this._gl.uniform4fv(this._location,n)};function GW(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}GW.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];r&&(e.activeTexture(t+o),e.bindTexture(r._target,r._texture))}};GW.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 Oie(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]}Oie.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 Fie(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]}Fie.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 a=e[r];Q.equalsArray(a,n,o)||(Q.pack(a,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function Qie(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]}Qie.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 a=e[r];d.equalsArray(a,n,o)||(d.pack(a,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function kie(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]}kie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let a=e[r];ie.equalsArray(a,n,o)||(ie.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function Uie(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]}Uie.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let a=e[r];Ki.equalsArray(a,n,o)||(Ki.pack(a,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function zie(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]}zie.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 a=e[r];J.equalsArray(a,n,o)||(J.pack(a,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function Gie(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]}Gie.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 a=e[r];P.equalsArray(a,n,o)||(P.pack(a,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var JM=EMe;var IMe=0;function aA(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=bMe(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=IMe++}aA.fromCache=function(e){return e=e??V.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};aA.replaceCache=function(e){return e=e??V.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(aA.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return ZM(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return ZM(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return ZM(this),this._uniformsByName}}});function Vie(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),a=r.slice(r.lastIndexOf(" ")+1);t.push(a)}}return t}function bMe(e,t){let n={};if(!Nt.highpFloatSupported||!Nt.highpIntSupported){let i,o,r,a,s=Vie(e),c=Vie(t),u=s.length,f=c.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(s[i]===c[o]){r=s[i],a=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,a),n[a]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Em="[Cesium WebGL] ";function xMe(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 a=e.createProgram();e.attachShader(a,o),e.attachShader(a,r);let s=t._attributeLocations;if(l(s))for(let p in s)s.hasOwnProperty(p)&&e.bindAttribLocation(a,s[p],p);e.linkProgram(a);let c;if(e.getProgramParameter(a,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Em}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Em}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(a),l(c)&&c.length>0&&console.log(`${Em}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),a;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(a),console.error(`${Em}Shader program link log: ${c}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Em}Vertex shader compile log: ${c}`),console.error(`${Em} Vertex shader source:
|
|
${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Em}Fragment shader compile log: ${c}`),console.error(`${Em} Fragment shader source:
|
|
${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(a),new ue(u);function h(p,A){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Em}${A} shader translation failed.`);return}console.error(`${Em}Translated ${A} shaderSource:
|
|
${m}`)}}function TMe(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),a=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:a}}return i}function SMe(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let a=0;a<r;++a){let s=e.getActiveUniform(t,a),c="[0]",u=s.name.indexOf(c,s.name.length-c.length)!==-1?s.name.slice(0,s.name.length-3):s.name;if(u.indexOf("gl_")!==0)if(s.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=XM(e,s,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,A,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;h=f._locations,h.length<=1&&(p=f.value,A=e.getUniformLocation(t,u),A!==null&&(h.push(A),p.push(e.getUniform(t,A))))}else{h=[];for(let _=0;_<s.size;++_)A=e.getUniformLocation(t,`${u}[${_}]`),A!==null&&h.push(A);f=JM(e,s,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function wMe(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],a=o,s=e._duplicateUniformNames[a];l(s)&&(r.name=s,a=s);let c=Og[a];l(c)?n.push({uniform:r,automaticUniform:c}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function BMe(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 ZM(e){l(e._program)||Hie(e)}function Hie(e){let t=e._program,n=e._gl,i=xMe(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=SMe(n,i),a=wMe(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=TMe(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=a.automaticUniforms,e._manualUniforms=a.manualUniforms,e.maximumTextureUnitIndex=BMe(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(s,c,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,A=/ ! = /g;e._vertexShaderText=s.replace(A," != "),e._fragmentShaderText=c.replace(A," != ");try{Hie(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let y=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(y?y[1]:m.message)}})}aA.prototype._bind=function(){ZM(this),this._gl.useProgram(this._program)};aA.prototype._setUniforms=function(e,t,n){let i,o;if(l(e)){let s=this._manualUniforms;for(i=s.length,o=0;o<i;++o){let c=s[o];c.value=e[c.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let s=r[o];s.uniform.value=s.automaticUniform.getValue(t)}let a=this._uniforms;for(i=a.length,o=0;o<i;++o)a[o].set();if(n){let s=this._gl,c=this._program;s.validateProgram(c)}};aA.prototype.isDestroyed=function(){return!1};aA.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};aA.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),fe(this)};var $t=aA;function $M(e){this._context=e}var Tw,DMe=new it({primitiveType:Pe.TRIANGLES}),vMe=new ui({color:new U(0,0,0,0)});function PMe(e,t){return new pa({context:e,colorTextures:[t],destroyAttachments:!1})}function RMe(e,t){return $t.fromCache({context:e,vertexShaderSource:OI,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function MMe(e,t){return(!l(Tw)||Tw.viewport.width!==e||Tw.viewport.height!==t)&&(Tw=Ve.fromCache({viewport:new et(0,0,e,t)})),Tw}$M.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=l(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),a=l(e.shaderProgram)?e.shaderProgram:RMe(o,e.fragmentShaderSource),s=PMe(o,t),c=MMe(n,i),u=e.uniformMap,f=vMe;f.framebuffer=s,f.renderState=c,f.execute(o);let h=DMe;h.vertexArray=r,h.renderState=c,h.shaderProgram=a,h.uniformMap=u,h.framebuffer=s,h.execute(o),s.destroy(),e.persists||(a.destroy(),l(e.vertexArray)&&r.destroy()),l(e.postExecute)&&e.postExecute(t)};$M.prototype.isDestroyed=function(){return!1};$M.prototype.destroy=function(){return fe(this)};var eN=$M;var Pn={BYTE:ee.BYTE,UNSIGNED_BYTE:ee.UNSIGNED_BYTE,SHORT:ee.SHORT,UNSIGNED_SHORT:ee.UNSIGNED_SHORT,INT:ee.INT,UNSIGNED_INT:ee.UNSIGNED_INT,FLOAT:ee.FLOAT,DOUBLE:ee.DOUBLE};Pn.getSizeInBytes=function(e){switch(e){case Pn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Pn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Pn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Pn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Pn.INT:return Int32Array.BYTES_PER_ELEMENT;case Pn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Pn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Pn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Pn.fromTypedArray=function(e){if(e instanceof Int8Array)return Pn.BYTE;if(e instanceof Uint8Array)return Pn.UNSIGNED_BYTE;if(e instanceof Int16Array)return Pn.SHORT;if(e instanceof Uint16Array)return Pn.UNSIGNED_SHORT;if(e instanceof Int32Array)return Pn.INT;if(e instanceof Uint32Array)return Pn.UNSIGNED_INT;if(e instanceof Float32Array)return Pn.FLOAT;if(e instanceof Float64Array)return Pn.DOUBLE};Pn.validate=function(e){return l(e)&&(e===Pn.BYTE||e===Pn.UNSIGNED_BYTE||e===Pn.SHORT||e===Pn.UNSIGNED_SHORT||e===Pn.INT||e===Pn.UNSIGNED_INT||e===Pn.FLOAT||e===Pn.DOUBLE)};Pn.createTypedArray=function(e,t){switch(e){case Pn.BYTE:return new Int8Array(t);case Pn.UNSIGNED_BYTE:return new Uint8Array(t);case Pn.SHORT:return new Int16Array(t);case Pn.UNSIGNED_SHORT:return new Uint16Array(t);case Pn.INT:return new Int32Array(t);case Pn.UNSIGNED_INT:return new Uint32Array(t);case Pn.FLOAT:return new Float32Array(t);case Pn.DOUBLE:return new Float64Array(t)}};Pn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/Pn.getSizeInBytes(e),e){case Pn.BYTE:return new Int8Array(t,n,i);case Pn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case Pn.SHORT:return new Int16Array(t,n,i);case Pn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case Pn.INT:return new Int32Array(t,n,i);case Pn.UNSIGNED_INT:return new Uint32Array(t,n,i);case Pn.FLOAT:return new Float32Array(t,n,i);case Pn.DOUBLE:return new Float64Array(t,n,i)}};Pn.fromName=function(e){switch(e){case"BYTE":return Pn.BYTE;case"UNSIGNED_BYTE":return Pn.UNSIGNED_BYTE;case"SHORT":return Pn.SHORT;case"UNSIGNED_SHORT":return Pn.UNSIGNED_SHORT;case"INT":return Pn.INT;case"UNSIGNED_INT":return Pn.UNSIGNED_INT;case"FLOAT":return Pn.FLOAT;case"DOUBLE":return Pn.DOUBLE}};var j=Object.freeze(Pn);var NMe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},$d=Object.freeze(NMe);function VW(e){e=e??V.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Pe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??$d.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}VW.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var LMe=new me,OMe=new d,Wie=new P,FMe=[new me,new me,new me],QMe=[new Q,new Q,new Q],kMe=[new Q,new Q,new Q],UMe=new d,zMe=new Qe,GMe=new P,VMe=new Ki;VW._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,LMe),a=me.toCartesian(r,n,OMe),s=At.eastNorthUpToFixedFrame(a,n,Wie),c=P.inverse(s,Wie),u=QMe,f=FMe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=UMe;for(o=0;o<3;o++)me.toCartesian(f[o],n,h),h=P.multiplyByPointAsVector(c,h,h),u[o].x=h.x,u[o].y=h.y;let p=Qe.fromAxisAngle(d.UNIT_Z,-t,zMe),A=J.fromQuaternion(p,GMe),m=e.length,_=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=P.multiplyByPointAsVector(c,e[o],h),h=J.multiplyByVector(A,h,h),_=Math.min(_,h.x),y=Math.min(y,h.y),C=Math.max(C,h.x),E=Math.max(E,h.y);let I=Ki.fromRotation(t,VMe),x=kMe;x[0].x=_,x[0].y=y,x[1].x=_,x[1].y=E,x[2].x=C,x[2].y=y;let S=u[0],w=u[2].x-S.x,v=u[1].y-S.y;for(o=0;o<3;o++){let b=x[o];Ki.multiplyByVector(I,b,b),b.x=(b.x-S.x)/w,b.y=(b.y-S.y)/v}let R=x[0],N=x[1],L=x[2],g=new Array(6);return Q.pack(R,g),Q.pack(N,g,2),Q.pack(L,g,4),g};var yt=VW;function HMe(e){e=e??V.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Me=HMe;function FI(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(FI.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}}});FI.clone=function(e){if(l(e))return new FI(e._format,e._datatype,e._width,e._height,e._buffer)};FI.prototype.clone=function(){return FI.clone(this)};var tN=FI;var jie=Na(Fu(),1);function Yie(){if(!l(ks._canTransferArrayBuffer)){let e=jW("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return ks._canTransferArrayBuffer=!1,ks._canTransferArrayBuffer}ks._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,a=l(r)&&r[0]===t;i(a),e.terminate(),ks._canTransferArrayBuffer=a}})}return ks._canTransferArrayBuffer}var WW=new _e;function HW(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 jW(e){let t=new jie.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,a;if(vC(e))a=e;else if(!n){let s=Zt(`${ks._workerModulePrefix}/${i}.js`);vC(s)&&(a=s)}if(a){let s=`import "${a}";`;return r=HW(s),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let s=`
|
|
importScripts("${HW(CESIUM_WORKERS)}");
|
|
CesiumWorkers["${i}"]();
|
|
`;return r=HW(s),new Worker(r,o)}if(r=e,n||(r=Zt(`${ks._workerModulePrefix+i}.js`)),!hn.supportsEsmWebWorkers())throw new ue("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function WMe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!hn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ue(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function ks(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var jMe=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let a=r.error;a.name==="RuntimeError"?(a=new ue(r.error.message),a.stack=r.error.stack):a.name==="DeveloperError"?(a=new de(r.error.message),a.stack=r.error.stack):a.name==="Error"&&(a=new Error(r.error.message),a.stack=r.error.stack),WW.raiseEvent(a),i(a)}else WW.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},YMe=[];async function qMe(e,t,n){let i=await Promise.resolve(Yie());l(n)?i||(n.length=0):n=YMe;let o=e._nextID++,r=new Promise((a,s)=>{e._worker.addEventListener("message",jMe(e._worker,o,a,s))});return e._worker.postMessage({id:o,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function KMe(e,t,n){++e._activeTasks;try{let i=await qMe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}ks.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=jW(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return KMe(this,e,t)};ks.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=jW(this._workerPath),i=await WMe(this,e),o=await Promise.resolve(Yie()),r,a=i.wasmBinary;l(a)&&o&&(r=[a]);let s=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new ue("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),s};return this._webAssemblyPromise=t(),this._webAssemblyPromise};ks.prototype.isDestroyed=function(){return!1};ks.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),fe(this)};ks.taskCompletedEvent=WW;ks._defaultWorkerModulePrefix="Workers/";ks._workerModulePrefix=ks._defaultWorkerModulePrefix;ks._canTransferArrayBuffer=void 0;var Zn=ks;function sA(){}sA._transcodeTaskProcessor=new Zn("transcodeKTX2",Number.POSITIVE_INFINITY);sA._readyPromise=void 0;function XMe(){let e=sA._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return sA._transcodeTaskProcessor;throw new ue("KTX2 transcoder could not be initialized.")});sA._readyPromise=e}sA.transcode=function(e,t){return l(sA._readyPromise)||XMe(),sA._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 a=n[r];for(let s=0;s<o.length;s++){let c=a[o[s]];a[o[s]]=new tN(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var nN=sA;var qie;Kie.setKTX2SupportedFormats=function(e,t,n,i,o,r){qie={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function Kie(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return nN.transcode(n,qie)})}var ku=Kie;function JMe(e,t){this.start=e??0,this.stop=t??0}var ea=JMe;function Cn(e,t){this.center=d.clone(e??d.ZERO),this.radius=t??0}var KW=new d,XW=new d,JW=new d,ZW=new d,$W=new d,ej=new d,tj=new d,Us=new d,nj=new d,ij=new d,oj=new d,rj=new d,ZMe=4/3*D.PI;Cn.fromPoints=function(e,t){if(l(t)||(t=new Cn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],tj),i=d.clone(n,KW),o=d.clone(n,XW),r=d.clone(n,JW),a=d.clone(n,ZW),s=d.clone(n,$W),c=d.clone(n,ej),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let R=n.x,N=n.y,L=n.z;R<i.x&&d.clone(n,i),R>a.x&&d.clone(n,a),N<o.y&&d.clone(n,o),N>s.y&&d.clone(n,s),L<r.z&&d.clone(n,r),L>c.z&&d.clone(n,c)}let h=d.magnitudeSquared(d.subtract(a,i,Us)),p=d.magnitudeSquared(d.subtract(s,o,Us)),A=d.magnitudeSquared(d.subtract(c,r,Us)),m=i,_=a,y=h;p>y&&(y=p,m=o,_=s),A>y&&(y=A,m=r,_=c);let C=nj;C.x=(m.x+_.x)*.5,C.y=(m.y+_.y)*.5,C.z=(m.z+_.z)*.5;let E=d.magnitudeSquared(d.subtract(_,C,Us)),I=Math.sqrt(E),x=ij;x.x=i.x,x.y=o.y,x.z=r.z;let S=oj;S.x=a.x,S.y=s.y,S.z=c.z;let w=d.midpoint(x,S,rj),v=0;for(f=0;f<u;f++){d.clone(e[f],n);let R=d.magnitude(d.subtract(n,w,Us));R>v&&(v=R);let N=d.magnitudeSquared(d.subtract(n,C,Us));if(N>E){let L=Math.sqrt(N);I=(I+L)*.5,E=I*I;let g=L-I;C.x=(I*C.x+g*n.x)/L,C.y=(I*C.y+g*n.y)/L,C.z=(I*C.z+g*n.z)/L}}return I<v?(d.clone(C,t.center),t.radius=I):(d.clone(w,t.center),t.radius=v),t};var Xie=new qi,$Me=new d,eNe=new d,YW=new me,qW=new me;Cn.fromRectangle2D=function(e,t,n){return Cn.fromRectangleWithHeights2D(e,t,0,0,n)};Cn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(l(o)||(o=new Cn),!l(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;Xie._ellipsoid=te.default,t=t??Xie,ce.southwest(e,YW),YW.height=n,ce.northeast(e,qW),qW.height=i;let r=t.project(YW,$Me),a=t.project(qW,eNe),s=a.x-r.x,c=a.y-r.y,u=a.z-r.z;o.radius=Math.sqrt(s*s+c*c+u*u)*.5;let f=o.center;return f.x=r.x+s*.5,f.y=r.y+c*.5,f.z=r.z+u*.5,o};var tNe=[];Cn.fromRectangle3D=function(e,t,n,i){if(t=t??te.default,n=n??0,l(i)||(i=new Cn),!l(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,tNe);return Cn.fromPoints(o,i)};Cn.fromVertices=function(e,t,n,i){if(l(i)||(i=new Cn),!l(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=t??d.ZERO,n=n??3;let o=tj;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,KW),a=d.clone(o,XW),s=d.clone(o,JW),c=d.clone(o,ZW),u=d.clone(o,$W),f=d.clone(o,ej),h=e.length,p;for(p=0;p<h;p+=n){let L=e[p]+t.x,g=e[p+1]+t.y,b=e[p+2]+t.z;o.x=L,o.y=g,o.z=b,L<r.x&&d.clone(o,r),L>c.x&&d.clone(o,c),g<a.y&&d.clone(o,a),g>u.y&&d.clone(o,u),b<s.z&&d.clone(o,s),b>f.z&&d.clone(o,f)}let A=d.magnitudeSquared(d.subtract(c,r,Us)),m=d.magnitudeSquared(d.subtract(u,a,Us)),_=d.magnitudeSquared(d.subtract(f,s,Us)),y=r,C=c,E=A;m>E&&(E=m,y=a,C=u),_>E&&(E=_,y=s,C=f);let I=nj;I.x=(y.x+C.x)*.5,I.y=(y.y+C.y)*.5,I.z=(y.z+C.z)*.5;let x=d.magnitudeSquared(d.subtract(C,I,Us)),S=Math.sqrt(x),w=ij;w.x=r.x,w.y=a.y,w.z=s.z;let v=oj;v.x=c.x,v.y=u.y,v.z=f.z;let R=d.midpoint(w,v,rj),N=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let L=d.magnitude(d.subtract(o,R,Us));L>N&&(N=L);let g=d.magnitudeSquared(d.subtract(o,I,Us));if(g>x){let b=Math.sqrt(g);S=(S+b)*.5,x=S*S;let T=b-S;I.x=(S*I.x+T*o.x)/b,I.y=(S*I.y+T*o.y)/b,I.z=(S*I.z+T*o.z)/b}}return S<N?(d.clone(I,i.center),i.radius=S):(d.clone(R,i.center),i.radius=N),i};Cn.fromEncodedCartesianVertices=function(e,t,n){if(l(n)||(n=new Cn),!l(e)||!l(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=tj;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,KW),r=d.clone(i,XW),a=d.clone(i,JW),s=d.clone(i,ZW),c=d.clone(i,$W),u=d.clone(i,ej),f=e.length,h;for(h=0;h<f;h+=3){let N=e[h]+t[h],L=e[h+1]+t[h+1],g=e[h+2]+t[h+2];i.x=N,i.y=L,i.z=g,N<o.x&&d.clone(i,o),N>s.x&&d.clone(i,s),L<r.y&&d.clone(i,r),L>c.y&&d.clone(i,c),g<a.z&&d.clone(i,a),g>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(s,o,Us)),A=d.magnitudeSquared(d.subtract(c,r,Us)),m=d.magnitudeSquared(d.subtract(u,a,Us)),_=o,y=s,C=p;A>C&&(C=A,_=r,y=c),m>C&&(C=m,_=a,y=u);let E=nj;E.x=(_.x+y.x)*.5,E.y=(_.y+y.y)*.5,E.z=(_.z+y.z)*.5;let I=d.magnitudeSquared(d.subtract(y,E,Us)),x=Math.sqrt(I),S=ij;S.x=o.x,S.y=r.y,S.z=a.z;let w=oj;w.x=s.x,w.y=c.y,w.z=u.z;let v=d.midpoint(S,w,rj),R=0;for(h=0;h<f;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let N=d.magnitude(d.subtract(i,v,Us));N>R&&(R=N);let L=d.magnitudeSquared(d.subtract(i,E,Us));if(L>I){let g=Math.sqrt(L);x=(x+g)*.5,I=x*x;let b=g-x;E.x=(x*E.x+b*i.x)/g,E.y=(x*E.y+b*i.y)/g,E.z=(x*E.z+b*i.z)/g}}return x<R?(d.clone(E,n.center),n.radius=x):(d.clone(v,n.center),n.radius=R),n};Cn.fromCornerPoints=function(e,t,n){l(n)||(n=new Cn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};Cn.fromEllipsoid=function(e,t){return l(t)||(t=new Cn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var nNe=new d;Cn.fromBoundingSpheres=function(e,t){if(l(t)||(t=new Cn),!l(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return Cn.clone(e[0],t);if(n===2)return Cn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=Cn.fromPoints(i,t);let r=t.center,a=t.radius;for(o=0;o<n;o++){let s=e[o];a=Math.max(a,d.distance(r,s.center,nNe)+s.radius)}return t.radius=a,t};var iNe=new d,oNe=new d,rNe=new d;Cn.fromOrientedBoundingBox=function(e,t){l(t)||(t=new Cn);let n=e.halfAxes,i=J.getColumn(n,0,iNe),o=J.getColumn(n,1,oNe),r=J.getColumn(n,2,rNe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var aNe=new d,sNe=new d;Cn.fromTransformation=function(e,t){l(t)||(t=new Cn);let n=P.getTranslation(e,aNe),i=P.getScale(e,sNe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};Cn.clone=function(e,t){if(l(e))return l(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new Cn(e.center,e.radius)};Cn.packedLength=4;Cn.pack=function(e,t,n){n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};Cn.unpack=function(e,t,n){t=t??0,l(n)||(n=new Cn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var cNe=new d,lNe=new d;Cn.union=function(e,t,n){l(n)||(n=new Cn);let i=e.center,o=e.radius,r=t.center,a=t.radius,s=d.subtract(r,i,cNe),c=d.magnitude(s);if(o>=c+a)return e.clone(n),n;if(a>=c+o)return t.clone(n),n;let u=(o+c+a)*.5,f=d.multiplyByScalar(s,(-o+u)/c,lNe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var uNe=new d;Cn.expand=function(e,t,n){n=Cn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,uNe));return i>n.radius&&(n.radius=i),n};Cn.intersectPlane=function(e,t){let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Xt.OUTSIDE:r<i?Xt.INTERSECTING:Xt.INSIDE};Cn.transform=function(e,t,n){return l(n)||(n=new Cn),n.center=P.multiplyByPoint(t,e.center,n.center),n.radius=P.getMaximumScale(t)*e.radius,n};var fNe=new d;Cn.distanceSquaredTo=function(e,t){let n=d.subtract(e.center,t,fNe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};Cn.transformWithoutScale=function(e,t,n){return l(n)||(n=new Cn),n.center=P.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var dNe=new d;Cn.computePlaneDistances=function(e,t,n,i){l(i)||(i=new ea);let o=d.subtract(e.center,t,dNe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var Jie=new d,hNe=new d,mNe=new d,pNe=new d,ANe=new d,gNe=new me,$ie=new Array(8);for(let e=0;e<8;++e)$ie[e]=new d;var Zie=new qi;Cn.projectTo2D=function(e,t,n){Zie._ellipsoid=te.default,t=t??Zie;let i=t.ellipsoid,o=e.center,r=e.radius,a;d.equals(o,d.ZERO)?a=d.clone(d.UNIT_X,Jie):a=i.geodeticSurfaceNormal(o,Jie);let s=d.cross(d.UNIT_Z,a,hNe);d.normalize(s,s);let c=d.cross(a,s,mNe);d.normalize(c,c),d.multiplyByScalar(a,r,a),d.multiplyByScalar(c,r,c),d.multiplyByScalar(s,r,s);let u=d.negate(c,ANe),f=d.negate(s,pNe),h=$ie,p=h[0];d.add(a,c,p),d.add(p,s,p),p=h[1],d.add(a,c,p),d.add(p,f,p),p=h[2],d.add(a,u,p),d.add(p,f,p),p=h[3],d.add(a,u,p),d.add(p,s,p),d.negate(a,a),p=h[4],d.add(a,c,p),d.add(p,s,p),p=h[5],d.add(a,c,p),d.add(p,f,p),p=h[6],d.add(a,u,p),d.add(p,f,p),p=h[7],d.add(a,u,p),d.add(p,s,p);let A=h.length;for(let C=0;C<A;++C){let E=h[C];d.add(o,E,E);let I=i.cartesianToCartographic(E,gNe);t.project(I,E)}n=Cn.fromPoints(h,n),o=n.center;let m=o.x,_=o.y,y=o.z;return o.x=y,o.y=m,o.z=_,n};Cn.isOccluded=function(e,t){return!t.isBoundingSphereVisible(e)};Cn.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};Cn.prototype.intersectPlane=function(e){return Cn.intersectPlane(this,e)};Cn.prototype.distanceSquaredTo=function(e){return Cn.distanceSquaredTo(this,e)};Cn.prototype.computePlaneDistances=function(e,t,n){return Cn.computePlaneDistances(this,e,t,n)};Cn.prototype.isOccluded=function(e){return Cn.isOccluded(this,e)};Cn.prototype.equals=function(e){return Cn.equals(this,e)};Cn.prototype.clone=function(e){return Cn.clone(this,e)};Cn.prototype.volume=function(){let e=this.radius;return ZMe*e*e*e};var le=Cn;function _Ne(e){e=e??V.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var En=_Ne;var yNe={NONE:0,TOP:1,ALL:2},mn=Object.freeze(yNe);function Oa(e){e=e??V.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}Oa.POSITION_ONLY=Object.freeze(new Oa({position:!0}));Oa.POSITION_AND_NORMAL=Object.freeze(new Oa({position:!0,normal:!0}));Oa.POSITION_NORMAL_AND_ST=Object.freeze(new Oa({position:!0,normal:!0,st:!0}));Oa.POSITION_AND_ST=Object.freeze(new Oa({position:!0,st:!0}));Oa.POSITION_AND_COLOR=Object.freeze(new Oa({position:!0,color:!0}));Oa.ALL=Object.freeze(new Oa({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Oa.DEFAULT=Oa.POSITION_NORMAL_AND_ST;Oa.packedLength=6;Oa.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Oa.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Oa),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};Oa.clone=function(e,t){if(l(e))return l(t)||(t=new Oa),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 ke=Oa;var CNe=new d;function Uu(e){e=e??V.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??ke.DEFAULT;this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Uu.fromDimensions=function(e){e=e??V.EMPTY_OBJECT;let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new Uu({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Uu.fromAxisAlignedBoundingBox=function(e){return new Uu({minimum:e.minimum,maximum:e.maximum})};Uu.packedLength=2*d.packedLength+ke.packedLength+1;Uu.pack=function(e,t,n){return n=n??0,d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),ke.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+ke.packedLength]=e._offsetAttribute??-1,t};var toe=new d,noe=new d,ioe=new ke,eoe={minimum:toe,maximum:noe,vertexFormat:ioe,offsetAttribute:void 0};Uu.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,toe),o=d.unpack(e,t+d.packedLength,noe),r=ke.unpack(e,t+2*d.packedLength,ioe),a=e[t+2*d.packedLength+ke.packedLength];return l(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=ke.clone(r,n._vertexFormat),n._offsetAttribute=a===-1?void 0:a,n):(eoe.offsetAttribute=a===-1?void 0:a,new Uu(eoe))};Uu.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new En,r,a;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(a=new Float64Array(72),a[0]=t.x,a[1]=t.y,a[2]=n.z,a[3]=n.x,a[4]=t.y,a[5]=n.z,a[6]=n.x,a[7]=n.y,a[8]=n.z,a[9]=t.x,a[10]=n.y,a[11]=n.z,a[12]=t.x,a[13]=t.y,a[14]=t.z,a[15]=n.x,a[16]=t.y,a[17]=t.z,a[18]=n.x,a[19]=n.y,a[20]=t.z,a[21]=t.x,a[22]=n.y,a[23]=t.z,a[24]=n.x,a[25]=t.y,a[26]=t.z,a[27]=n.x,a[28]=n.y,a[29]=t.z,a[30]=n.x,a[31]=n.y,a[32]=n.z,a[33]=n.x,a[34]=t.y,a[35]=n.z,a[36]=t.x,a[37]=t.y,a[38]=t.z,a[39]=t.x,a[40]=n.y,a[41]=t.z,a[42]=t.x,a[43]=n.y,a[44]=n.z,a[45]=t.x,a[46]=t.y,a[47]=n.z,a[48]=t.x,a[49]=n.y,a[50]=t.z,a[51]=n.x,a[52]=n.y,a[53]=t.z,a[54]=n.x,a[55]=n.y,a[56]=n.z,a[57]=t.x,a[58]=n.y,a[59]=n.z,a[60]=t.x,a[61]=t.y,a[62]=t.z,a[63]=n.x,a[64]=t.y,a[65]=t.z,a[66]=n.x,a[67]=t.y,a[68]=n.z,a[69]=t.x,a[70]=t.y,a[71]=n.z,o.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(36),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else a=new Float64Array(24),a[0]=t.x,a[1]=t.y,a[2]=t.z,a[3]=n.x,a[4]=t.y,a[5]=t.z,a[6]=n.x,a[7]=n.y,a[8]=t.z,a[9]=t.x,a[10]=n.y,a[11]=t.z,a[12]=t.x,a[13]=t.y,a[14]=n.z,a[15]=n.x,a[16]=t.y,a[17]=n.z,a[18]=n.x,a[19]=n.y,a[20]=n.z,a[21]=t.x,a[22]=n.y,a[23]=n.z,o.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a}),r=new Uint16Array(36),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let s=d.subtract(n,t,CNe),c=d.magnitude(s)*.5;if(l(e._offsetAttribute)){let u=a.length,f=e._offsetAttribute===mn.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new yt({attributes:o,indices:r,primitiveType:Pe.TRIANGLES,boundingSphere:new le(d.ZERO,c),offsetAttribute:e._offsetAttribute})};var aj;Uu.getUnitBox=function(){return l(aj)||(aj=Uu.createGeometry(Uu.fromDimensions({dimensions:new d(1,1,1),vertexFormat:ke.POSITION_ONLY}))),aj};var Nc=Uu;var Ao={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ao.getMathType=function(e){switch(e){case Ao.SCALAR:return Number;case Ao.VEC2:return Q;case Ao.VEC3:return d;case Ao.VEC4:return ie;case Ao.MAT2:return Ki;case Ao.MAT3:return J;case Ao.MAT4:return P}};Ao.getNumberOfComponents=function(e){switch(e){case Ao.SCALAR:return 1;case Ao.VEC2:return 2;case Ao.VEC3:return 3;case Ao.VEC4:case Ao.MAT2:return 4;case Ao.MAT3:return 9;case Ao.MAT4:return 16}};Ao.getAttributeLocationCount=function(e){switch(e){case Ao.SCALAR:case Ao.VEC2:case Ao.VEC3:case Ao.VEC4:return 1;case Ao.MAT2:return 2;case Ao.MAT3:return 3;case Ao.MAT4:return 4}};Ao.getGlslType=function(e){switch(e){case Ao.SCALAR:return"float";case Ao.VEC2:return"vec2";case Ao.VEC3:return"vec3";case Ao.VEC4:return"vec4";case Ao.MAT2:return"mat2";case Ao.MAT3:return"mat3";case Ao.MAT4:return"mat4"}};var zt=Object.freeze(Ao);var ooe=1/256,ENe=65536,cj=256,bo={};bo.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,o=n.y;n.x=(1-Math.abs(o))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(o)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};bo.octEncode=function(e,t){return bo.octEncodeInRange(e,255,t)};var Sw=new Q,roe=new Uint8Array(1);function iN(e){return roe[0]=e,roe[0]}bo.octEncodeToCartesian4=function(e,t){return bo.octEncodeInRange(e,65535,Sw),t.x=iN(Sw.x*ooe),t.y=iN(Sw.x),t.z=iN(Sw.y*ooe),t.w=iN(Sw.y),t};bo.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*D.signNotZero(o),i.y=(1-Math.abs(o))*D.signNotZero(i.y)}return d.normalize(i,i)};bo.octDecode=function(e,t,n){return bo.octDecodeInRange(e,t,255,n)};bo.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,o=e.z,r=e.w,a=n*cj+i,s=o*cj+r;return bo.octDecodeInRange(a,s,65535,t)};bo.octPackFloat=function(e){return 256*e.x+e.y};var lj=new Q;bo.octEncodeFloat=function(e){return bo.octEncode(e,lj),bo.octPackFloat(lj)};bo.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),o=(n-i)*256;return bo.octDecode(i,o,t)};bo.octPack=function(e,t,n,i){let o=bo.octEncodeFloat(e),r=bo.octEncodeFloat(t),a=bo.octEncode(n,lj);return i.x=65536*a.x+o,i.y=65536*a.y+r,i};bo.octUnpack=function(e,t,n,i){let o=e.x/65536,r=Math.floor(o),a=(o-r)*65536;o=e.y/65536;let s=Math.floor(o),c=(o-s)*65536;bo.octDecodeFloat(a,t),bo.octDecodeFloat(c,n),bo.octDecode(r,s,i)};bo.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};bo.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function sj(e){return e>>1^-(e&1)}bo.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,a=0;for(let s=0;s<i;++s)o+=sj(e[s]),r+=sj(t[s]),e[s]=o,t[s]=r,l(n)&&(a+=sj(n[s]),n[s]=a)};bo.dequantize=function(e,t,n,i){let o=zt.getNumberOfComponents(n),r;switch(t){case j.BYTE:r=127;break;case j.UNSIGNED_BYTE:r=255;break;case j.SHORT:r=32767;break;case j.UNSIGNED_SHORT:r=65535;break;case j.INT:r=2147483647;break;case j.UNSIGNED_INT:r=4294967295;break}let a=new Float32Array(i*o);for(let s=0;s<i;s++)for(let c=0;c<o;c++){let u=s*o+c;a[u]=Math.max(e[u]/r,-1)}return a};bo.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*ENe+Math.round(D.clamp(e.green*255,0,255))*cj+Math.round(D.clamp(e.blue*255,0,255))};bo.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};bo.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,a=1/63;for(let s=0;s<n;s++){let c=e[s],u=c>>11,f=c>>5&o,h=c&i,p=3*s;t[p]=u*r,t[p+1]=f*a,t[p+2]=h*r}return t};var tn=bo;var aoe=new d,soe=new d,coe=new d;function INe(e,t,n,i,o){l(o)||(o=new d);let r,a,s,c,u,f,h,p;if(l(t.z)){if(d.equalsEpsilon(e,t,D.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,D.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,D.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,aoe),a=d.subtract(i,t,soe),s=d.subtract(e,t,coe),c=d.dot(r,r),u=d.dot(r,a),f=d.dot(r,s),h=d.dot(a,a),p=d.dot(a,s)}else{if(Q.equalsEpsilon(e,t,D.EPSILON14))return d.clone(d.UNIT_X,o);if(Q.equalsEpsilon(e,n,D.EPSILON14))return d.clone(d.UNIT_Y,o);if(Q.equalsEpsilon(e,i,D.EPSILON14))return d.clone(d.UNIT_Z,o);r=Q.subtract(n,t,aoe),a=Q.subtract(i,t,soe),s=Q.subtract(e,t,coe),c=Q.dot(r,r),u=Q.dot(r,a),f=Q.dot(r,s),h=Q.dot(a,a),p=Q.dot(a,s)}o.y=h*f-u*p,o.z=c*p-u*f;let A=c*h-u*u;if(A!==0)return o.y/=A,o.z/=A,o.x=1-o.y-o.z,o}var QI=INe;function Im(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}Im.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var cA={high:0,low:0};Im.fromCartesian=function(e,t){l(t)||(t=new Im);let n=t.high,i=t.low;return Im.encode(e.x,cA),n.x=cA.high,i.x=cA.low,Im.encode(e.y,cA),n.y=cA.high,i.y=cA.low,Im.encode(e.z,cA),n.z=cA.high,i.z=cA.low,t};var uj=new Im;Im.writeElements=function(e,t,n){Im.fromCartesian(e,uj);let i=uj.high,o=uj.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 xn=Im;var fj={};fj.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function loe(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}fj.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,a=loe(o,-r,D.EPSILON14);if(a<0)return[];let s=-.5*loe(t,D.sign(t)*Math.sqrt(a),D.EPSILON14);return t>0?[s/e,n/s]:[n/s,s/e]};var Wl=fj;var hj={};hj.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,a=n*n,s=i*i;return 18*e*t*n*i+r*a-27*o*s-4*(e*a*n+r*t*i)};function dj(e,t,n,i){let o=e,r=t/3,a=n/3,s=i,c=o*a,u=r*s,f=r*r,h=a*a,p=o*a-f,A=o*s-r*a,m=r*s-h,_=4*p*m-A*A,y,C;if(_<0){let H,Y,$;f*u>=c*h?(H=o,Y=p,$=-2*r*p+o*A):(H=s,Y=m,$=-s*A+2*a*m);let K=-($<0?-1:1)*Math.abs(H)*Math.sqrt(-_);C=-$+K;let Z=C/2,pe=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),ge=C===K?-pe:-Y/pe;return y=Y<=0?pe+ge:-$/(pe*pe+ge*ge+Y),f*u>=c*h?[(y-r)/o]:[-s/(y+a)]}let E=p,I=-2*r*p+o*A,x=m,S=-s*A+2*a*m,w=Math.sqrt(_),v=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*w,-I)/3);y=2*Math.sqrt(-E);let N=Math.cos(R);C=y*N;let L=y*(-N/2-v*Math.sin(R)),g=C+L>2*r?C-r:L-r,b=o,T=g/b;R=Math.abs(Math.atan2(s*w,-S)/3),y=2*Math.sqrt(-x),N=Math.cos(R),C=y*N,L=y*(-N/2-v*Math.sin(R));let B=-s,M=C+L<2*a?C+a:L+a,O=B/M,G=b*M,k=-g*M-b*B,z=g*B,F=(a*k-r*z)/(-r*k+a*G);return T<=F?T<=O?F<=O?[T,F,O]:[T,O,F]:[O,T,F]:T<=O?[F,T,O]:F<=O?[F,O,T]:[O,F,T]}hj.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Wl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let a=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[a,a,a]}else if(i===0)return o=Wl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return dj(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):dj(e,t,0,i);if(i===0)return o=Wl.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 dj(e,t,n,i)};var kI=hj;var mj={};mj.computeDiscriminant=function(e,t,n,i,o){let r=e*e,a=r*e,s=t*t,c=s*t,u=n*n,f=u*n,h=i*i,p=h*i,A=o*o,m=A*o;return s*u*h-4*c*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*a*m+o*(18*c*n*i-4*s*f+16*e*u*u-80*e*t*u*i-6*e*s*h+144*r*n*h)+A*(144*e*s*n-27*s*s-128*r*u-192*r*t*i)};function eh(e,t,n,i){let o=e*e,r=t-3*o/8,a=n-t*e/2+o*e/8,s=i-n*e/4+t*o/16-3*o*o/256,c=kI.computeRealRoots(1,2*r,r*r-4*s,-a*a);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let h=Wl.computeRealRoots(1,r,s);if(h.length===2){let p=h[0],A=h[1],m;if(p>=0&&A>=0){let _=Math.sqrt(p),y=Math.sqrt(A);return[u-y,u-_,u+_,u+y]}else{if(p>=0&&A<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&A>=0)return m=Math.sqrt(A),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-a/h)/2,A=(r+f+a/h)/2,m=Wl.computeRealRoots(1,h,p),_=Wl.computeRealRoots(1,-h,A);return m.length!==0?(m[0]+=u,m[1]+=u,_.length!==0?(_[0]+=u,_[1]+=u,m[1]<=_[0]?[m[0],m[1],_[0],_[1]]:_[1]<=m[0]?[_[0],_[1],m[0],m[1]]:m[0]>=_[0]&&m[1]<=_[1]?[_[0],m[0],m[1],_[1]]:_[0]>=m[0]&&_[1]<=m[1]?[m[0],_[0],_[1],m[1]]:m[0]>_[0]&&m[0]<_[1]?[_[0],m[0],_[1],m[1]]:[m[0],_[0],m[1],_[1]]):m):_.length!==0?(_[0]+=u,_[1]+=u,_):[]}}return[]}function ww(e,t,n,i){let o=n*n,r=t*t,a=e*e,s=-2*t,c=n*e+r-4*i,u=a*i-n*t*e+o,f=kI.computeRealRoots(1,s,c,u);if(f.length>0){let h=f[0],p=t-h,A=p*p,m=e/2,_=p/2,y=A-4*i,C=A+4*Math.abs(i),E=a-4*h,I=a+4*Math.abs(h),x,S;if(h<0||y*I<E*C){let b=Math.sqrt(E);x=b/2,S=b===0?0:(e*_-n)/b}else{let b=Math.sqrt(y);x=b===0?0:(e*_-n)/b,S=b/2}let w,v;m===0&&x===0?(w=0,v=0):D.sign(m)===D.sign(x)?(w=m+x,v=h/w):(v=m-x,w=h/v);let R,N;_===0&&S===0?(R=0,N=0):D.sign(_)===D.sign(S)?(R=_+S,N=i/R):(N=_-S,R=i/N);let L=Wl.computeRealRoots(1,w,R),g=Wl.computeRealRoots(1,v,N);if(L.length!==0)return g.length!==0?L[1]<=g[0]?[L[0],L[1],g[0],g[1]]:g[1]<=L[0]?[g[0],g[1],L[0],L[1]]:L[0]>=g[0]&&L[1]<=g[1]?[g[0],L[0],L[1],g[1]]:g[0]>=L[0]&&g[1]<=L[1]?[L[0],g[0],g[1],L[1]]:L[0]>g[0]&&L[0]<g[1]?[g[0],L[0],g[1],L[1]]:[L[0],g[0],L[1],g[1]]:L;if(g.length!==0)return g}return[]}mj.computeRealRoots=function(e,t,n,i,o){if(Math.abs(e)<D.EPSILON15)return kI.computeRealRoots(t,n,i,o);let r=t/e,a=n/e,s=i/e,c=o/e,u=r<0?1:0;switch(u+=a<0?u+1:u,u+=s<0?u+1:u,u+=c<0?u+1:u,u){case 0:return eh(r,a,s,c);case 1:return ww(r,a,s,c);case 2:return ww(r,a,s,c);case 3:return eh(r,a,s,c);case 4:return eh(r,a,s,c);case 5:return ww(r,a,s,c);case 6:return eh(r,a,s,c);case 7:return eh(r,a,s,c);case 8:return ww(r,a,s,c);case 9:return eh(r,a,s,c);case 10:return eh(r,a,s,c);case 11:return ww(r,a,s,c);case 12:return eh(r,a,s,c);case 13:return eh(r,a,s,c);case 14:return eh(r,a,s,c);case 15:return eh(r,a,s,c);default:return}};var oN=mj;function rN(e,t){t=d.clone(t??d.ZERO),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(e??d.ZERO),this.direction=t}rN.clone=function(e,t){if(l(e))return l(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new rN(e.origin,e.direction)};rN.getPoint=function(e,t,n){return l(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var In=rN;var Jo={};Jo.rayPlane=function(e,t,n){l(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,a=d.dot(r,o);if(Math.abs(a)<D.EPSILON15)return;let s=(-t.distance-d.dot(r,i))/a;if(!(s<0))return n=d.multiplyByScalar(o,s,n),d.add(i,n,n)};var bNe=new d,xNe=new d,goe=new d,uoe=new d,foe=new d;Jo.rayTriangleParametric=function(e,t,n,i,o){o=o??!1;let r=e.origin,a=e.direction,s=d.subtract(n,t,bNe),c=d.subtract(i,t,xNe),u=d.cross(a,c,goe),f=d.dot(s,u),h,p,A,m,_;if(o){if(f<D.EPSILON6||(h=d.subtract(r,t,uoe),A=d.dot(h,u),A<0||A>f)||(p=d.cross(h,s,foe),m=d.dot(a,p),m<0||A+m>f))return;_=d.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let y=1/f;if(h=d.subtract(r,t,uoe),A=d.dot(h,u)*y,A<0||A>1||(p=d.cross(h,s,foe),m=d.dot(a,p)*y,m<0||A+m>1))return;_=d.dot(c,p)*y}return _};Jo.rayTriangle=function(e,t,n,i,o,r){let a=Jo.rayTriangleParametric(e,t,n,i,o);if(!(!l(a)||a<0))return l(r)||(r=new d),d.multiplyByScalar(e.direction,a,r),d.add(e.origin,r,r)};var TNe=new In;Jo.lineSegmentTriangle=function(e,t,n,i,o,r,a){let s=TNe;d.clone(e,s.origin),d.subtract(t,e,s.direction),d.normalize(s.direction,s.direction);let c=Jo.rayTriangleParametric(s,n,i,o,r);if(!(!l(c)||c<0||c>d.distance(e,t)))return l(a)||(a=new d),d.multiplyByScalar(s.direction,c,a),d.add(s.origin,a,a)};function SNe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let a=1/(2*e),s=Math.sqrt(o),c=(-t+s)*a,u=(-t-s)*a;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var wNe={root0:0,root1:0};function _oe(e,t,n){l(n)||(n=new ea);let i=e.origin,o=e.direction,r=t.center,a=t.radius*t.radius,s=d.subtract(i,r,goe),c=d.dot(o,o),u=2*d.dot(o,s),f=d.magnitudeSquared(s)-a,h=SNe(c,u,f,wNe);if(l(h))return n.start=h.root0,n.stop=h.root1,n}Jo.raySphere=function(e,t,n){if(n=_oe(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var BNe=new In;Jo.lineSegmentSphere=function(e,t,n,i){let o=BNe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),a=d.magnitude(r);if(d.normalize(r,r),i=_oe(o,n,i),!(!l(i)||i.stop<0||i.start>a))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,a),i};var DNe=new d,vNe=new d;Jo.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,DNe),o=d.multiplyComponents(n,e.direction,vNe),r=d.magnitudeSquared(i),a=d.dot(i,o),s,c,u,f,h;if(r>1){if(a>=0)return;let p=a*a;if(s=r-1,c=d.magnitudeSquared(o),u=c*s,p<u)return;if(p>u){f=a*a-u,h=-a+Math.sqrt(f);let m=h/c,_=s/h;return m<_?new ea(m,_):{start:_,stop:m}}let A=Math.sqrt(s/c);return new ea(A,A)}else if(r<1)return s=r-1,c=d.magnitudeSquared(o),u=c*s,f=a*a-u,h=-a+Math.sqrt(f),new ea(0,h/c);if(a<0)return c=d.magnitudeSquared(o),new ea(0,-a/c)};var PNe=new ea,RNe=new ea,MNe=new ea;Jo.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new ea);let i=pj(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,PNe),o=pj(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,RNe),r=pj(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,MNe);if(n.start=i.start>o.start?i.start:o.start,n.stop=i.stop<o.stop?i.stop:o.stop,!(i.start>o.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop<n.stop&&(n.stop=r.stop),n};function pj(e,t,n,i,o){if(o.start=(n-e)/t,o.stop=(i-e)/t,o.stop<o.start){let r=o.stop;o.stop=o.start,o.start=r}return o}function OC(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Jo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,a=o*o,s=(e[J.COLUMN1ROW1]-e[J.COLUMN2ROW2])*a,c=o*(i*OC(e[J.COLUMN1ROW0],e[J.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[J.COLUMN0ROW0]*r+e[J.COLUMN2ROW2]*a+i*t.x+n,f=a*OC(e[J.COLUMN2ROW1],e[J.COLUMN1ROW2],D.EPSILON15),h=o*(i*OC(e[J.COLUMN2ROW0],e[J.COLUMN0ROW2])+t.z),p,A=[];if(h===0&&f===0){if(p=Wl.computeRealRoots(s,c,u),p.length===0)return A;let R=p[0],N=Math.sqrt(Math.max(1-R*R,0));if(A.push(new d(i,o*R,o*-N)),A.push(new d(i,o*R,o*N)),p.length===2){let L=p[1],g=Math.sqrt(Math.max(1-L*L,0));A.push(new d(i,o*L,o*-g)),A.push(new d(i,o*L,o*g))}return A}let m=h*h,_=f*f,y=s*s,C=h*f,E=y+_,I=2*(c*s+C),x=2*u*s+c*c-_+m,S=2*(u*c-C),w=u*u-m;if(E===0&&I===0&&x===0&&S===0)return A;p=oN.computeRealRoots(E,I,x,S,w);let v=p.length;if(v===0)return A;for(let R=0;R<v;++R){let N=p[R],L=N*N,g=Math.max(1-L,0),b=Math.sqrt(g),T;D.sign(s)===D.sign(u)?T=OC(s*L+u,c*N,D.EPSILON12):D.sign(u)===D.sign(c*N)?T=OC(s*L,c*N+u,D.EPSILON12):T=OC(s*L+c*N,u,D.EPSILON12);let B=OC(f*N,h,D.EPSILON15),M=T*B;M<0?A.push(new d(i,o*N,o*b)):M>0?A.push(new d(i,o*N,o*-b)):b!==0?(A.push(new d(i,o*N,o*-b)),A.push(new d(i,o*N,o*b)),++R):A.push(new d(i,o*N,o*b))}return A};var Aj=new d,doe=new d,hoe=new d,aN=new d,NNe=new d,LNe=new J,ONe=new J,FNe=new J,QNe=new J,kNe=new J,moe=new J,poe=new J,Aoe=new d,UNe=new d,zNe=new me;Jo.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let w=t.geodeticSurfaceNormal(n,Aj);if(d.dot(i,w)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Aj),a=d.normalize(r,r),s=d.mostOrthogonalAxis(r,aN),c=d.normalize(d.cross(s,a,doe),doe),u=d.normalize(d.cross(a,c,hoe),hoe),f=LNe;f[0]=a.x,f[1]=a.y,f[2]=a.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=J.transpose(f,ONe),p=J.fromScale(t.radii,FNe),A=J.fromScale(t.oneOverRadii,QNe),m=kNe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let _=J.multiply(J.multiply(h,A,moe),m,moe),y=J.multiply(J.multiply(_,p,poe),f,poe),C=J.multiplyByVector(_,n,NNe),E=Jo.quadraticVectorExpression(y,d.negate(C,Aj),0,0,1),I,x,S=E.length;if(S>0){let w=d.clone(d.ZERO,UNe),v=Number.NEGATIVE_INFINITY;for(let N=0;N<S;++N){I=J.multiplyByVector(p,J.multiplyByVector(f,E[N],Aoe),Aoe);let L=d.normalize(d.subtract(I,n,aN),aN),g=d.dot(L,i);g>v&&(v=g,w=d.clone(I,w))}let R=t.cartesianToCartographic(w,zNe);return v=D.clamp(v,0,1),x=d.magnitude(d.subtract(w,n,aN))*Math.sqrt(1-v*v),x=o?-x:x,R.height=x,t.cartographicToCartesian(R,new d)}};var GNe=new d;Jo.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new d);let o=d.subtract(t,e,GNe),r=n.normal,a=d.dot(r,o);if(Math.abs(a)<D.EPSILON6)return;let s=d.dot(r,e),c=-(n.distance+s)/a;if(!(c<0||c>1))return d.multiplyByScalar(o,c,i),d.add(e,i,i),i};Jo.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,a=d.dot(o,e)+r<0,s=d.dot(o,t)+r<0,c=d.dot(o,n)+r<0,u=0;u+=a?1:0,u+=s?1:0,u+=c?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(a)return Jo.lineSegmentPlane(e,t,i,f),Jo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(s)return Jo.lineSegmentPlane(t,n,i,f),Jo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Jo.lineSegmentPlane(n,e,i,f),Jo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(a)if(s){if(!c)return Jo.lineSegmentPlane(e,n,i,f),Jo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Jo.lineSegmentPlane(n,t,i,f),Jo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Jo.lineSegmentPlane(t,e,i,f),Jo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var di=Jo;function ys(e,t){this.normal=d.clone(e),this.distance=t}ys.fromPointNormal=function(e,t,n){let i=-d.dot(t,e);return l(n)?(d.clone(t,n.normal),n.distance=i,n):new ys(t,i)};var VNe=new d;ys.fromCartesian4=function(e,t){let n=d.fromCartesian4(e,VNe),i=e.w;return l(t)?(d.clone(n,t.normal),t.distance=i,t):new ys(n,i)};ys.getPointDistance=function(e,t){return d.dot(e.normal,t)+e.distance};var HNe=new d;ys.projectPointOntoPlane=function(e,t,n){l(n)||(n=new d);let i=ys.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,HNe);return d.subtract(t,o,n)};var WNe=new P,jNe=new ie,YNe=new d;ys.transform=function(e,t,n){let i=e.normal,o=e.distance,r=P.inverseTranspose(t,WNe),a=ie.fromElements(i.x,i.y,i.z,o,jNe);a=P.multiplyByVector(r,a,a);let s=d.fromCartesian4(a,YNe);return a=ie.divideByScalar(a,d.magnitude(s),a),ys.fromCartesian4(a,n)};ys.clone=function(e,t){return l(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new ys(e.normal,e.distance)};ys.equals=function(e,t){return e.distance===t.distance&&d.equals(e.normal,t.normal)};ys.ORIGIN_XY_PLANE=Object.freeze(new ys(d.UNIT_Z,0));ys.ORIGIN_YZ_PLANE=Object.freeze(new ys(d.UNIT_X,0));ys.ORIGIN_ZX_PLANE=Object.freeze(new ys(d.UNIT_Y,0));var cn=ys;var gj={};gj.calculateACMR=function(e){e=e??V.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let s=0,c=t[s];for(;s<o;)c>n&&(n=c),++s,c=t[s]}let r=[];for(let s=0;s<n+1;s++)r[s]=0;let a=i+1;for(let s=0;s<o;++s)a-r[t[s]]>i&&(r[t[s]]=a,++a);return(a-i+1)/(o/3)};gj.tipsify=function(e){e=e??V.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,b,T,B){for(;b.length>=1;){let M=b[b.length-1];if(b.splice(b.length-1,1),g[M].numLiveTriangles>0)return M}for(;o<B;){if(g[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function a(g,b,T,B,M,O,G){let k=-1,z,F=-1,H=0;for(;H<T.length;){let Y=T[H];B[Y].numLiveTriangles&&(z=0,M-B[Y].timeStamp+2*B[Y].numLiveTriangles<=b&&(z=M-B[Y].timeStamp),(z>F||F===-1)&&(F=z,k=Y)),++H}return k===-1?r(B,O,g,G):k}let s=t.length,c=0,u=0,f=t[u],h=s;if(l(n))c=n+1;else{for(;u<h;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],A;for(A=0;A<c;A++)p[A]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let _=0,y=i+1;o=1;let C=[],E=[],I,x,S=0,w=[],v=s/3,R=[];for(A=0;A<v;A++)R[A]=!1;let N,L;for(;_!==-1;){C=[],x=p[_],L=x.vertexTriangles.length;for(let g=0;g<L;++g)if(m=x.vertexTriangles[g],!R[m]){R[m]=!0,u=m+m+m;for(let b=0;b<3;++b)N=t[u],C.push(N),E.push(N),w[S]=N,++S,I=p[N],--I.numLiveTriangles,y-I.timeStamp>i&&(I.timeStamp=y,++y),++u}_=a(t,i,C,p,y,E,c)}return w};var sN=gj;var cl={};function mN(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function qNe(e){let t=e.length,n=t/3*6,i=Ue.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)mN(i,o,e[r],e[r+1],e[r+2]);return i}function KNe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Ue.createTypedArray(t,n);mN(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)mN(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function XNe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Ue.createTypedArray(t,n),o=e[0],r=0;for(let a=1;a<t;++a,r+=6)mN(i,r,o,e[a],e[a+1]);return i}return new Uint16Array}cl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Pe.TRIANGLES:e.indices=qNe(t);break;case Pe.TRIANGLE_STRIP:e.indices=KNe(t);break;case Pe.TRIANGLE_FAN:e.indices=XNe(t);break}e.primitiveType=Pe.LINES}return e};cl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,a=new Float64Array(2*r),s=0;for(let f=0;f<r;f+=3)a[s++]=i[f],a[s++]=i[f+1],a[s++]=i[f+2],a[s++]=i[f]+o[f]*n,a[s++]=i[f+1]+o[f+1]*n,a[s++]=i[f+2]+o[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new le(u.center,u.radius+n)),new yt({attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})},primitiveType:Pe.LINES,boundingSphere:c})};cl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,a=t.length;for(r=0;r<a;++r){let s=t[r];l(n[s])&&(i[s]=o++)}for(let s in n)n.hasOwnProperty(s)&&!l(i[s])&&(i[s]=o++);return i};cl.reorderForPreVertexCache=function(e){let t=yt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,a=Ue.createTypedArray(t,r),s=0,c=0,u=0,f;for(;s<r;)f=i[o[s]],f!==-1?a[c]=f:(f=o[s],i[f]=u,a[c]=u,++u),++s,++c;e.indices=a;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&l(h[p])&&l(h[p].values)){let A=h[p],m=A.values,_=0,y=A.componentsPerAttribute,C=j.createTypedArray(A.componentDatatype,u*y);for(;_<t;){let E=i[_];if(E!==-1)for(let I=0;I<y;I++)C[y*E+I]=m[y*_+I];++_}A.values=C}}return e};cl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Pe.TRIANGLES&&l(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=sN.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function yoe(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Me({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function JNe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}cl.fitToUnsignedShortIndices=function(e){let t=[],n=yt.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,a=yoe(e.attributes),s=e.indices,c=s.length,u;e.primitiveType===Pe.TRIANGLES?u=3:e.primitiveType===Pe.LINES?u=2:e.primitiveType===Pe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let h=0;h<u;++h){let p=s[f+h],A=i[p];l(A)||(A=r++,i[p]=A,JNe(a,e.attributes,p)),o.push(A)}r+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new yt({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,a=yoe(e.attributes))}o.length!==0&&t.push(new yt({attributes:a,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Coe=new d,ZNe=new me;cl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new qi;let a=o.ellipsoid,s=r.values,c=new Float64Array(s.length),u=0;for(let f=0;f<s.length;f+=3){let h=d.fromArray(s,f,Coe),p=a.cartesianToCartographic(h,ZNe),A=o.project(p,Coe);c[u++]=A.x,c[u++]=A.y,c[u++]=A.z}return e.attributes[n]=r,e.attributes[i]=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var _j={high:0,low:0};cl.encodeAttribute=function(e,t,n,i){let o=e.attributes[t],r=o.values,a=r.length,s=new Float32Array(a),c=new Float32Array(a);for(let f=0;f<a;++f)xn.encode(r[f],_j),s[f]=_j.high,c[f]=_j.low;let u=o.componentsPerAttribute;return e.attributes[n]=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:u,values:s}),e.attributes[i]=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var nh=new d;function yj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,nh),P.multiplyByPoint(e,nh,nh),d.pack(nh,n,o)}}function Cj(e,t){if(l(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,nh),J.multiplyByVector(e,nh,nh),nh=d.normalize(nh,nh),d.pack(nh,n,o)}}var cN=new P,lN=new J;cl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(P.equals(t,P.IDENTITY))return e;let n=e.geometry.attributes;yj(t,n.position),yj(t,n.prevPosition),yj(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(P.inverse(t,cN),P.transpose(cN,cN),P.getMatrix3(cN,lN),Cj(lN,n.normal),Cj(lN,n.tangent),Cj(lN,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=P.clone(P.IDENTITY),e};function $Ne(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&l(o[r])&&l(o[r].values)){let a=o[r],s=a.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!l(f)||a.componentDatatype!==f.componentDatatype||a.componentsPerAttribute!==f.componentsPerAttribute||a.normalize!==f.normalize){c=!1;break}s+=f.values.length}c&&(i[r]=new Me({componentDatatype:a.componentDatatype,componentsPerAttribute:a.componentsPerAttribute,normalize:a.normalize,values:j.createTypedArray(a.componentDatatype,s)}))}return i}var eLe=new d;function Ej(e,t){let n=e.length,i,o,r,a,s=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=$Ne(e,t),h,p,A;for(i in f)if(f.hasOwnProperty(i))for(h=f[i].values,a=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,A=p.length,r=0;r<A;++r)h[a++]=p[r];let m;if(c){let E=0;for(o=0;o<n;++o)E+=e[o][t].indices.length;let I=yt.computeNumberOfVertices(new yt({attributes:f,primitiveType:Pe.POINTS})),x=Ue.createTypedArray(I,E),S=0,w=0;for(o=0;o<n;++o){let v=e[o][t].indices,R=v.length;for(a=0;a<R;++a)x[S++]=w+v[a];w+=yt.computeNumberOfVertices(e[o][t])}m=x}let _=new d,y=0,C;for(o=0;o<n;++o){if(C=e[o][t].boundingSphere,!l(C)){_=void 0;break}d.add(C.center,_,_)}if(l(_))for(d.divideByScalar(_,n,_),o=0;o<n;++o){C=e[o][t].boundingSphere;let E=d.magnitude(d.subtract(C.center,_,eLe))+C.radius;E>y&&(y=E)}return new yt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(_)?new le(_,y):void 0})}cl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r];l(a.geometry)?t.push(a):l(a.westHemisphereGeometry)&&l(a.eastHemisphereGeometry)&&n.push(a)}let o=[];return t.length>0&&o.push(Ej(t,"geometry")),n.length>0&&(o.push(Ej(n,"westHemisphereGeometry")),o.push(Ej(n,"eastHemisphereGeometry"))),o};var Qf=new d,Bw=new d,UI=new d,zI=new d;cl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,a=new Array(o),s=new Array(r/3),c=new Array(r),u;for(u=0;u<o;u++)a[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],_=t[u+1],y=t[u+2],C=m*3,E=_*3,I=y*3;Bw.x=i[C],Bw.y=i[C+1],Bw.z=i[C+2],UI.x=i[E],UI.y=i[E+1],UI.z=i[E+2],zI.x=i[I],zI.y=i[I+1],zI.z=i[I+2],a[m].count++,a[_].count++,a[y].count++,d.subtract(UI,Bw,UI),d.subtract(zI,Bw,zI),s[f]=d.cross(UI,zI,new d),f++}let h=0;for(u=0;u<o;u++)a[u].indexOffset+=h,h+=a[u].count;f=0;let p;for(u=0;u<r;u+=3){p=a[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=a[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=a[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let A=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=a[u],d.clone(d.ZERO,Qf),p.count>0){for(f=0;f<p.count;f++)d.add(Qf,s[c[p.indexOffset+f]],Qf);d.equalsEpsilon(d.ZERO,Qf,D.EPSILON10)&&d.clone(s[c[p.indexOffset]],Qf)}d.equalsEpsilon(d.ZERO,Qf,D.EPSILON10)&&(Qf.z=1),d.normalize(Qf,Qf),A[m]=Qf.x,A[m+1]=Qf.y,A[m+2]=Qf.z}return e.attributes.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A}),e};var tLe=new d,Eoe=new d,nLe=new d;cl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,a=e.attributes.position.values.length/3,s=n.length,c=new Array(a*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,h,p;for(u=0;u<s;u+=3){let _=n[u],y=n[u+1],C=n[u+2];f=_*3,h=y*3,p=C*3;let E=_*2,I=y*2,x=C*2,S=i[f],w=i[f+1],v=i[f+2],R=r[E],N=r[E+1],L=r[I+1]-N,g=r[x+1]-N,b=1/((r[I]-R)*g-(r[x]-R)*L),T=(g*(i[h]-S)-L*(i[p]-S))*b,B=(g*(i[h+1]-w)-L*(i[p+1]-w))*b,M=(g*(i[h+2]-v)-L*(i[p+2]-v))*b;c[f]+=T,c[f+1]+=B,c[f+2]+=M,c[h]+=T,c[h+1]+=B,c[h+2]+=M,c[p]+=T,c[p+1]+=B,c[p+2]+=M}let A=new Float32Array(a*3),m=new Float32Array(a*3);for(u=0;u<a;u++){f=u*3,h=f+1,p=f+2;let _=d.fromArray(o,f,tLe),y=d.fromArray(c,f,nLe),C=d.dot(_,y);d.multiplyByScalar(_,C,Eoe),d.normalize(d.subtract(y,Eoe,y),y),A[f]=y.x,A[h]=y.y,A[p]=y.z,d.normalize(d.cross(_,y,y),y),m[f]=y.x,m[h]=y.y,m[p]=y.z}return e.attributes.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A}),e.attributes.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m}),e};var Dw=new Q,th=new d,Ioe=new d,boe=new d,uN=new Q;cl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let w=t.values;i=w.length/3;let v=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(d.fromArray(w,n*3,th),d.equals(th,d.ZERO)){R+=2;continue}uN=tn.octEncodeInRange(th,65535,uN),v[R++]=uN.x,v[R++]=uN.y}return e.attributes.compressedAttributes=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:v}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,a=l(o),s=l(r);if(!a&&!s)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),h=l(u),p,A,m,_;a&&(p=o.values),s&&(A=r.values),f&&(m=c.values),h&&(_=u.values),i=(a?p.length:A.length)/(a?3:2);let E=i,I=s&&a?2:1;I+=f||h?1:0,E*=I;let x=new Float32Array(E),S=0;for(n=0;n<i;++n){s&&(Q.fromArray(A,n*2,Dw),x[S++]=tn.compressTextureCoordinates(Dw));let w=n*3;a&&l(m)&&l(_)?(d.fromArray(p,w,th),d.fromArray(m,w,Ioe),d.fromArray(_,w,boe),tn.octPack(th,Ioe,boe,Dw),x[S++]=Dw.x,x[S++]=Dw.y):(a&&(d.fromArray(p,w,th),x[S++]=tn.octEncodeFloat(th)),f&&(d.fromArray(m,w,th),x[S++]=tn.octEncodeFloat(th)),h&&(d.fromArray(_,w,th),x[S++]=tn.octEncodeFloat(th)))}return e.attributes.compressedAttributes=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:I,values:x}),a&&delete e.attributes.normal,s&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function iLe(e){if(l(e.indices))return e;let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function oLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Pe.TRIANGLES,e}function rLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Pe.TRIANGLES,e}function aLe(e){if(l(e.indices))return e;let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function sLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Pe.LINES,e}function cLe(e){let t=yt.computeNumberOfVertices(e),n=Ue.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Pe.LINES,e}function lLe(e){switch(e.primitiveType){case Pe.TRIANGLE_FAN:return oLe(e);case Pe.TRIANGLE_STRIP:return rLe(e);case Pe.TRIANGLES:return iLe(e);case Pe.LINE_STRIP:return sLe(e);case Pe.LINE_LOOP:return cLe(e);case Pe.LINES:return aLe(e)}return e}function Wg(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function uLe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Wg(e,e.y<0),Wg(t,t.y<0),Wg(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),a;i>o?i>r?a=D.sign(e.y):a=D.sign(n.y):o>r?a=D.sign(t.y):a=D.sign(n.y);let s=a<0;Wg(e,s),Wg(t,s),Wg(n,s)}var xoe=new d;function kf(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,xoe),e.y/(e.y-t.y),xoe),n),d.clone(n,i),Wg(n,!0),Wg(i,!1)}var FC=new d,QC=new d,kC=new d,UC=new d,Ij={positions:new Array(7),indices:new Array(9)};function fLe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;uLe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,a=0;a+=i?1:0,a+=o?1:0,a+=r?1:0;let s=Ij.indices;a===1?(s[1]=3,s[2]=4,s[5]=6,s[7]=6,s[8]=5,i?(kf(e,t,FC,kC),kf(e,n,QC,UC),s[0]=0,s[3]=1,s[4]=2,s[6]=1):o?(kf(t,n,FC,kC),kf(t,e,QC,UC),s[0]=1,s[3]=2,s[4]=0,s[6]=2):r&&(kf(n,e,FC,kC),kf(n,t,QC,UC),s[0]=2,s[3]=0,s[4]=1,s[6]=0)):a===2&&(s[2]=4,s[4]=4,s[5]=3,s[7]=5,s[8]=6,i?o?r||(kf(n,e,FC,kC),kf(n,t,QC,UC),s[0]=0,s[1]=1,s[3]=0,s[6]=2):(kf(t,n,FC,kC),kf(t,e,QC,UC),s[0]=2,s[1]=0,s[3]=2,s[6]=1):(kf(e,t,FC,kC),kf(e,n,QC,UC),s[0]=1,s[1]=2,s[3]=1,s[6]=0));let c=Ij.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(a===1||a===2)&&(c[3]=FC,c[4]=QC,c[5]=kC,c[6]=UC,c.length=7),Ij}function Toe(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=j.createTypedArray(r.componentDatatype,r.values)}let i=yt.computeNumberOfVertices(e);return e.indices=Ue.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function VI(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Me({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new yt({attributes:n,indices:[],primitiveType:e.primitiveType})}function Sj(e,t,n){let i=l(e.geometry.boundingSphere);t=Toe(t,i),n=Toe(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function wj(e,t){let n=new e,i=new e,o=new e;return function(r,a,s,c,u,f,h,p){let A=e.fromArray(u,r*t,n),m=e.fromArray(u,a*t,i),_=e.fromArray(u,s*t,o);e.multiplyByScalar(A,c.x,A),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(_,c.z,_);let y=e.add(A,m,A);e.add(y,_,y),p&&e.normalize(y,y),e.pack(y,f,h*t)}}var dLe=wj(ie,4),hN=wj(d,3),Poe=wj(Q,2),hLe=function(e,t,n,i,o,r,a){let s=o[e]*i.x,c=o[t]*i.y,u=o[n]*i.z;r[a]=s+c+u>D.EPSILON6?1:0},vw=new d,bj=new d,xj=new d,mLe=new d;function fN(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_){if(!l(r)&&!l(a)&&!l(s)&&!l(c)&&!l(u)&&A===0)return;let y=d.fromArray(o,e*3,vw),C=d.fromArray(o,t*3,bj),E=d.fromArray(o,n*3,xj),I=QI(i,y,C,E,mLe);if(l(I)){if(l(r)&&hN(e,t,n,I,r,h.normal.values,_,!0),l(u)){let x=d.fromArray(u,e*3,vw),S=d.fromArray(u,t*3,bj),w=d.fromArray(u,n*3,xj);d.multiplyByScalar(x,I.x,x),d.multiplyByScalar(S,I.y,S),d.multiplyByScalar(w,I.z,w);let v;!d.equals(x,d.ZERO)||!d.equals(S,d.ZERO)||!d.equals(w,d.ZERO)?(v=d.add(x,S,x),d.add(v,w,v),d.normalize(v,v)):(v=vw,v.x=0,v.y=0,v.z=0),d.pack(v,h.extrudeDirection.values,_*3)}if(l(f)&&hLe(e,t,n,I,f,h.applyOffset.values,_),l(a)&&hN(e,t,n,I,a,h.tangent.values,_,!0),l(s)&&hN(e,t,n,I,s,h.bitangent.values,_,!0),l(c)&&Poe(e,t,n,I,c,h.st.values,_),A>0)for(let x=0;x<A;x++){let S=p[x];pLe(e,t,n,I,_,m[S],h[S])}}}function pLe(e,t,n,i,o,r,a){let s=r.componentsPerAttribute,c=r.values,u=a.values;switch(s){case 4:dLe(e,t,n,i,c,u,o,!1);break;case 3:hN(e,t,n,i,c,u,o,!1);break;case 2:Poe(e,t,n,i,c,u,o,!1);break;default:u[o]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function bm(e,t,n,i,o,r){let a=e.position.values.length/3;if(o!==-1){let s=i[o],c=n[s];return c===-1?(n[s]=a,e.position.values.push(r.x,r.y,r.z),t.push(a),a):(t.push(c),c)}return e.position.values.push(r.x,r.y,r.z),t.push(a),a}var ALe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Soe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.normal)?n.normal.values:void 0,r=l(n.bitangent)?n.bitangent.values:void 0,a=l(n.tangent)?n.tangent.values:void 0,s=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let v in n)n.hasOwnProperty(v)&&!ALe[v]&&l(n[v])&&h.push(v);let p=h.length,A=VI(t),m=VI(t),_,y,C,E,I,x=[];x.length=i.length/3;let S=[];for(S.length=i.length/3,I=0;I<x.length;++I)x[I]=-1,S[I]=-1;let w=f.length;for(I=0;I<w;I+=3){let v=f[I],R=f[I+1],N=f[I+2],L=d.fromArray(i,v*3),g=d.fromArray(i,R*3),b=d.fromArray(i,N*3),T=fLe(L,g,b);if(l(T)&&T.positions.length>3){let B=T.positions,M=T.indices,O=M.length;for(let G=0;G<O;++G){let k=M[G],z=B[k];z.y<0?(_=m.attributes,y=m.indices,C=x):(_=A.attributes,y=A.indices,C=S),E=bm(_,y,C,f,k<3?I+k:-1,z),fN(v,R,N,z,i,o,a,r,s,c,u,_,h,p,n,E)}}else l(T)&&(L=T.positions[0],g=T.positions[1],b=T.positions[2]),L.y<0?(_=m.attributes,y=m.indices,C=x):(_=A.attributes,y=A.indices,C=S),E=bm(_,y,C,f,I,L),fN(v,R,N,L,i,o,a,r,s,c,u,_,h,p,n,E),E=bm(_,y,C,f,I+1,g),fN(v,R,N,g,i,o,a,r,s,c,u,_,h,p,n,E),E=bm(_,y,C,f,I+2,b),fN(v,R,N,b,i,o,a,r,s,c,u,_,h,p,n,E)}Sj(e,m,A)}var Roe=cn.fromPointNormal(d.ZERO,d.UNIT_Y),gLe=new d,_Le=new d;function GI(e,t,n,i,o,r,a){if(!l(a))return;let s=d.fromArray(i,e*3,vw);d.equalsEpsilon(s,n,D.EPSILON10)?r.applyOffset.values[o]=a[e]:r.applyOffset.values[o]=a[t]}function woe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=l(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,a=VI(t),s=VI(t),c,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,h[c]=-1;for(c=0;c<u;c+=2){let p=r[c],A=r[c+1],m=d.fromArray(i,p*3,vw),_=d.fromArray(i,A*3,bj),y;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(_.y)<D.EPSILON6&&(_.y<0?_.y=-D.EPSILON6:_.y=D.EPSILON6);let C=a.attributes,E=a.indices,I=h,x=s.attributes,S=s.indices,w=f,v=di.lineSegmentPlane(m,_,Roe,xj);if(l(v)){let R=d.multiplyByScalar(d.UNIT_Y,5*D.EPSILON9,gLe);m.y<0&&(d.negate(R,R),C=s.attributes,E=s.indices,I=f,x=a.attributes,S=a.indices,w=h);let N=d.add(v,R,_Le);y=bm(C,E,I,r,c,m),GI(p,A,m,i,y,C,o),y=bm(C,E,I,r,-1,N),GI(p,A,N,i,y,C,o),d.negate(R,R),d.add(v,R,N),y=bm(x,S,w,r,-1,N),GI(p,A,N,i,y,x,o),y=bm(x,S,w,r,c+1,_),GI(p,A,_,i,y,x,o)}else{let R,N,L;m.y<0?(R=s.attributes,N=s.indices,L=f):(R=a.attributes,N=a.indices,L=h),y=bm(R,N,L,r,c,m),GI(p,A,m,i,y,R,o),y=bm(R,N,L,r,c+1,_),GI(p,A,_,i,y,R,o)}}Sj(e,s,a)}var Boe=new Q,yLe=new Q,Moe=new d,Noe=new d,Tj=new d,CLe=new d,ELe=new d,ILe=new d,Doe=new ie;function voe(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let a=0;a<r;a+=3){let s=d.unpack(n,a,Moe);if(s.x>0)continue;let c=d.unpack(i,a,Noe);(s.y<0&&c.y>0||s.y>0&&c.y<0)&&(a-3>0?(i[a]=n[a-3],i[a+1]=n[a-2],i[a+2]=n[a-1]):d.pack(s,i,a));let u=d.unpack(o,a,Tj);(s.y<0&&u.y>0||s.y>0&&u.y<0)&&(a+3<r?(o[a]=n[a+3],o[a+1]=n[a+4],o[a+2]=n[a+5]):d.pack(s,o,a))}}var bLe=5*D.EPSILON9,dN=D.EPSILON6;function xLe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,a=n.expandAndWidth.values,s=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=VI(t),f=VI(t),h,p,A,m=!1,_=i.length/3;for(h=0;h<_;h+=4){let y=h,C=h+2,E=d.fromArray(i,y*3,Moe),I=d.fromArray(i,C*3,Noe);if(Math.abs(E.y)<dN)for(E.y=dN*(I.y<0?-1:1),i[h*3+1]=E.y,i[(h+1)*3+1]=E.y,p=y*3;p<y*3+12;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(I.y)<dN)for(I.y=dN*(E.y<0?-1:1),i[(h+2)*3+1]=I.y,i[(h+3)*3+1]=I.y,p=y*3;p<y*3+12;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let x=u.attributes,S=u.indices,w=f.attributes,v=f.indices,R=di.lineSegmentPlane(E,I,Roe,CLe);if(l(R)){m=!0;let N=d.multiplyByScalar(d.UNIT_Y,bLe,ELe);E.y<0&&(d.negate(N,N),x=f.attributes,S=f.indices,w=u.attributes,v=u.indices);let L=d.add(R,N,ILe);x.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.position.values.push(L.x,L.y,L.z),x.position.values.push(L.x,L.y,L.z),x.prevPosition.values.push(o[y*3],o[y*3+1],o[y*3+2]),x.prevPosition.values.push(o[y*3+3],o[y*3+4],o[y*3+5]),x.prevPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),x.nextPosition.values.push(L.x,L.y,L.z),d.negate(N,N),d.add(R,N,L),w.position.values.push(L.x,L.y,L.z),w.position.values.push(L.x,L.y,L.z),w.position.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.prevPosition.values.push(L.x,L.y,L.z),w.nextPosition.values.push(I.x,I.y,I.z,I.x,I.y,I.z),w.nextPosition.values.push(r[C*3],r[C*3+1],r[C*3+2]),w.nextPosition.values.push(r[C*3+3],r[C*3+4],r[C*3+5]);let g=Q.fromArray(a,y*2,Boe),b=Math.abs(g.y);x.expandAndWidth.values.push(-1,b,1,b),x.expandAndWidth.values.push(-1,-b,1,-b),w.expandAndWidth.values.push(-1,b,1,b),w.expandAndWidth.values.push(-1,-b,1,-b);let T=d.magnitudeSquared(d.subtract(R,E,Tj));if(T/=d.magnitudeSquared(d.subtract(I,E,Tj)),l(c)){let B=ie.fromArray(c,y*4,Doe),M=ie.fromArray(c,C*4,Doe),O=D.lerp(B.x,M.x,T),G=D.lerp(B.y,M.y,T),k=D.lerp(B.z,M.z,T),z=D.lerp(B.w,M.w,T);for(p=y*4;p<y*4+8;++p)x.color.values.push(c[p]);for(x.color.values.push(O,G,k,z),x.color.values.push(O,G,k,z),w.color.values.push(O,G,k,z),w.color.values.push(O,G,k,z),p=C*4;p<C*4+8;++p)w.color.values.push(c[p])}if(l(s)){let B=Q.fromArray(s,y*2,Boe),M=Q.fromArray(s,(h+3)*2,yLe),O=D.lerp(B.x,M.x,T);for(p=y*2;p<y*2+4;++p)x.st.values.push(s[p]);for(x.st.values.push(O,B.y),x.st.values.push(O,M.y),w.st.values.push(O,B.y),w.st.values.push(O,M.y),p=C*2;p<C*2+4;++p)w.st.values.push(s[p])}A=x.position.values.length/3-4,S.push(A,A+2,A+1),S.push(A+1,A+2,A+3),A=w.position.values.length/3-4,v.push(A,A+2,A+1),v.push(A+1,A+2,A+3)}else{let N,L;for(E.y<0?(N=f.attributes,L=f.indices):(N=u.attributes,L=u.indices),N.position.values.push(E.x,E.y,E.z),N.position.values.push(E.x,E.y,E.z),N.position.values.push(I.x,I.y,I.z),N.position.values.push(I.x,I.y,I.z),p=h*3;p<h*3+12;++p)N.prevPosition.values.push(o[p]),N.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+8;++p)N.expandAndWidth.values.push(a[p]),l(s)&&N.st.values.push(s[p]);if(l(c))for(p=h*4;p<h*4+16;++p)N.color.values.push(c[p]);A=N.position.values.length/3-4,L.push(A,A+2,A+1),L.push(A+1,A+2,A+3)}}m&&(voe(f),voe(u)),Sj(e,f,u)}cl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING))return e;if(t.geometryType!==$d.NONE)switch(t.geometryType){case $d.POLYLINES:xLe(e);break;case $d.TRIANGLES:Soe(e);break;case $d.LINES:woe(e);break}else lLe(t),t.primitiveType===Pe.TRIANGLES?Soe(e):t.primitiveType===Pe.LINES&&woe(e);return e};var jn=cl;function Pw(e,t,n,i,o,r,a,s,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=a,this._internalFormat=o,this._pixelFormat=r,this._size=s,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(Pw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});Pw.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:a}=i,s=this._context._gl,c=this._textureTarget,u=this._targetFace;s.activeTexture(s.TEXTURE0),s.bindTexture(c,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,A=this._internalFormat,m=this._pixelDatatype,_=this._preMultiplyAlpha,y=this._flipY,C=4;l(f)&&(C=Ke.alignmentInBytes(p,m,r)),s.pixelStorei(s.UNPACK_ALIGNMENT,C),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let E=!1;if(!this._initialized){let I;t===0&&n===0&&r===h&&a===h?(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),y&&(f=Ke.flipY(f,p,m,h,h)),I=f):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y),I=i),E=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),I=Ke.createTypedArray(p,m,h,h)),s.texImage2D(u,0,A,h,h,0,p,He.toWebGLConstant(m,this._context),I),this._initialized=!0}E||(l(f)?(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),y&&(f=Ke.flipY(f,p,m,r,a)),s.texSubImage2D(u,0,t,n,r,a,p,He.toWebGLConstant(m,this._context),f)):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,_),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,y),s.texSubImage2D(u,0,t,n,p,He.toWebGLConstant(m,this._context),i))),s.bindTexture(c,null)};Pw.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),a.bindTexture(s,null),this._initialized=!0};Pw.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,a=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(a,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(a,null),this._initialized=!0};var pN=Pw;var AN={DONT_CARE:ee.DONT_CARE,FASTEST:ee.FASTEST,NICEST:ee.NICEST,validate:function(e){return e===AN.DONT_CARE||e===AN.FASTEST||e===AN.NICEST}},ih=Object.freeze(AN);var gN={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR};gN.validate=function(e){return e===gN.NEAREST||e===gN.LINEAR};var si=Object.freeze(gN);var jg={NEAREST:ee.NEAREST,LINEAR:ee.LINEAR,NEAREST_MIPMAP_NEAREST:ee.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ee.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ee.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ee.LINEAR_MIPMAP_LINEAR};jg.validate=function(e){return e===jg.NEAREST||e===jg.LINEAR||e===jg.NEAREST_MIPMAP_NEAREST||e===jg.LINEAR_MIPMAP_NEAREST||e===jg.NEAREST_MIPMAP_LINEAR||e===jg.LINEAR_MIPMAP_LINEAR};var Wt=Object.freeze(jg);var _N={CLAMP_TO_EDGE:ee.CLAMP_TO_EDGE,REPEAT:ee.REPEAT,MIRRORED_REPEAT:ee.MIRRORED_REPEAT,validate:function(e){return e===_N.CLAMP_TO_EDGE||e===_N.REPEAT||e===_N.MIRRORED_REPEAT}},pn=Object.freeze(_N);function Rw(e){e=e??V.EMPTY_OBJECT;let{wrapR:t=pn.CLAMP_TO_EDGE,wrapS:n=pn.CLAMP_TO_EDGE,wrapT:i=pn.CLAMP_TO_EDGE,minificationFilter:o=Wt.LINEAR,magnificationFilter:r=si.LINEAR,maximumAnisotropy:a=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=a}Object.defineProperties(Rw.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});Rw.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};Rw.NEAREST=Object.freeze(new Rw({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST}));var jt=Rw;function TLe(e,t){if(!e)throw new de(t)}var Loe=TLe;function SLe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),a=t.value?t.value.length:t.componentsPerAttribute,s={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:a,componentDatatype:t.componentDatatype??j.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)s.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},s.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(s.componentsPerAttribute){case 1:s.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:s.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:s.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:s.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}s.disableVertexAttribArray=function(c){}}e.push(s)}function Foe(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function oh(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,a=[],s=1,c=!1,u=!1,f=i.length;for(r=0;r<f;++r)SLe(a,i[r],r,t);for(f=a.length,r=0;r<f;++r){let p=a[r];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let A=p.strideInBytes||p.componentsPerAttribute*j.getSizeInBytes(p.componentDatatype);s=p.vertexBuffer.sizeInBytes/A;break}}for(r=0;r<f;++r)a[r].instanceDivisor>0&&(c=!0),l(a[r].value)&&(u=!0);let h;t.vertexArrayObject&&(h=t.glCreateVertexArray(),t.glBindVertexArray(h),Foe(n,a,o),t.glBindVertexArray(null)),this._numberOfVertices=s,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=h,this._attributes=a,this._indexBuffer=o}function Ooe(e){return e.values.length/e.componentsPerAttribute}function wLe(e){return j.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function BLe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===j.DOUBLE&&(e[n].componentDatatype=j.FLOAT,e[n].values=j.createTypedArray(j.FLOAT,e[n].values)));let r,a=o.length;if(a>0)for(r=Ooe(e[o[0]]),t=1;t<a;++t){let u=Ooe(e[o[t]]);if(u!==r)throw new ue(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return j.getSizeInBytes(e[f].componentDatatype)-j.getSizeInBytes(e[u].componentDatatype)});let s=0,c={};for(t=0;t<a;++t)n=o[t],i=e[n],c[n]=s,s+=wLe(i);if(s>0){let u=j.getSizeInBytes(e[o[0]].componentDatatype),f=s%u;f!==0&&(s+=u-f);let h=r*s,p=new ArrayBuffer(h),A={};for(t=0;t<a;++t){n=o[t];let m=j.getSizeInBytes(e[n].componentDatatype);A[n]={pointer:j.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:s/m}}for(t=0;t<r;++t)for(let m=0;m<a;++m){n=o[m],i=e[n];let _=i.values,y=A[n],C=y.pointer,E=i.componentsPerAttribute;for(let I=0;I<E;++I)C[y.index+I]=_[t*E+I];y.index+=y.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:s}}}oh.fromGeometry=function(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=e.geometry??V.EMPTY_OBJECT,i=e.bufferUsage??Re.DYNAMIC_DRAW,o=e.attributeLocations??V.EMPTY_OBJECT,r=e.interleave??!1,a=e.vertexArrayAttributes,s,c,u,f=l(a)?a:[],h=n.attributes;if(r){let m=BLe(h);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let _=m.offsetsInBytes,y=m.vertexSizeInBytes;for(s in h)h.hasOwnProperty(s)&&l(h[s])&&(c=h[s],l(c.values)?f.push({index:o[s],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:_[s],strideInBytes:y}):f.push({index:o[s],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(s in h)if(h.hasOwnProperty(s)&&l(h[s])){c=h[s];let m=c.componentDatatype;m===j.DOUBLE&&(m=j.FLOAT);let _={};u=void 0,l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:j.createTypedArray(m,c.values),usage:i}),_={index:o[s],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),_={index:o[s],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:zt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(_)}let p,A=n.indices;return l(A)&&(yt.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(A),usage:i,indexDatatype:Ue.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(A),usage:i,indexDatatype:Ue.UNSIGNED_SHORT})),new oh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(oh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});oh.prototype.getAttribute=function(e){return this._attributes[e]};function DLe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=Nt.maximumVertexAttributes,a;if(n){let s=o.length;for(a=0;a<s;++a){let c=o[a];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(a=0;a<r;++a)i[a]>0&&(t.glVertexAttribDivisor(a,0),i[a]=0)}function vLe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&l(r.value)&&r.vertexAttrib(t)}}oh.prototype.copyAttributeFromRange=function(e,t,n,i){let o=this.getAttribute(e),r=o.vertexBuffer,a=o.componentsPerAttribute,s=t.constructor,c=n*a*s.BYTES_PER_ELEMENT,u=new s(t.buffer,t.byteOffset+c,i*a);r.copyFromArrayView(u,c)};oh.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,o=e.constructor,r=t*o.BYTES_PER_ELEMENT,a=new o(e.buffer,e.byteOffset+r,n);i.copyFromArrayView(a,r)};oh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&DLe(this),this._hasConstantAttributes&&vLe(this,this._gl)):Foe(this._gl,this._attributes,this._indexBuffer)};oh.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};oh.prototype.isDestroyed=function(){return!1};oh.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),fe(this)};var Vn=oh;function gr(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e,c=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let h=u,p=Ke.textureSizeInBytes(i,o,h,h)*6,A=Ke.toInternalFormat(i,o,t),m=t._gl,_=m.TEXTURE_CUBE_MAP,y=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=_,this._texture=y,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=r;let C=l(n);function E(I){return new pN(t,y,_,I,A,i,o,h,c,r,C)}this._positiveX=E(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=E(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=E(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=E(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=E(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=E(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=s,Qoe(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(_,y),a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let I of gr.faceNames())Bj(this[I],n?.[I],0);m.bindTexture(_,null)}gr.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new pa({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};gr.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*PLe(){yield gr.FaceName.POSITIVEX,yield gr.FaceName.NEGATIVEX,yield gr.FaceName.POSITIVEY,yield gr.FaceName.NEGATIVEY,yield gr.FaceName.POSITIVEZ,yield gr.FaceName.NEGATIVEZ}gr.faceNames=function(){return PLe()};function Bj(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,a=e._pixelDatatype,s=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!l(t)){h.texImage2D(i,n,s,o,o,0,r,He.toWebGLConstant(a,f),null);return}let{arrayBufferView:p}=t,A=4;l(p)&&(A=Ke.alignmentInBytes(r,a,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,A),l(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=Ke.flipY(p,r,a,o,o)),h.texImage2D(i,n,s,o,o,0,r,He.toWebGLConstant(a,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,c),h.texImage2D(i,n,s,r,He.toWebGLConstant(a,f),t))}gr.loadFace=Bj;Object.defineProperties(gr.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Qoe(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});gr.getDirection=function(e,t){switch(e){case gr.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case gr.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case gr.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case gr.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case gr.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case gr.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function Qoe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelDatatype;(a===He.FLOAT&&!r.textureFloatLinear||a===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=si.NEAREST);let s=r._gl,c=e._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(c,e._texture),s.texParameteri(c,s.TEXTURE_MIN_FILTER,n),s.texParameteri(c,s.TEXTURE_MAG_FILTER,i),s.texParameteri(c,s.TEXTURE_WRAP_S,t.wrapS),s.texParameteri(c,s.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&s.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),s.bindTexture(c,null)}gr.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,o=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(o,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let r=0;r<e.length;r++){let a=e[r],s=r+1;for(let c of gr.faceNames())Bj(this[c],a[c],s)}n.bindTexture(o,null),this._hasMipmap=!0};gr.prototype.generateMipmap=function(e){e=e??ih.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};gr.createVertexArray=function(e){let t=Nc.createGeometry(Nc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:ke.POSITION_ONLY})),n=this._attributeLocations=jn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Re.STATIC_DRAW})};gr.prototype.isDestroyed=function(){return!1};gr.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=fe(this._positiveX),this._negativeX=fe(this._negativeX),this._positiveY=fe(this._positiveY),this._negativeY=fe(this._negativeY),this._positiveZ=fe(this._positiveZ),this._negativeZ=fe(this._negativeZ),fe(this)};var ta=gr;function RLe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var ll=RLe;var Dj=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},yN=Dj;var CN=`/**
|
|
* A built-in GLSL floating-point constant for converting radians to degrees.
|
|
*
|
|
* @alias czm_degreesPerRadian
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.DEGREES_PER_RADIAN
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_degreesPerRadian = ...;
|
|
*
|
|
* // Example
|
|
* float deg = czm_degreesPerRadian * rad;
|
|
*/
|
|
const float czm_degreesPerRadian = 57.29577951308232;
|
|
`;var EN=`/**
|
|
* A built-in GLSL vec2 constant for defining the depth range.
|
|
* This is a workaround to a bug where IE11 does not implement gl_DepthRange.
|
|
*
|
|
* @alias czm_depthRange
|
|
* @glslConstant
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* float depthRangeNear = czm_depthRange.near;
|
|
* float depthRangeFar = czm_depthRange.far;
|
|
*
|
|
*/
|
|
const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
|
|
`;var IN=`/**
|
|
* 0.1
|
|
*
|
|
* @name czm_epsilon1
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon1 = 0.1;
|
|
`;var bN=`/**
|
|
* 0.01
|
|
*
|
|
* @name czm_epsilon2
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon2 = 0.01;
|
|
`;var xN=`/**
|
|
* 0.001
|
|
*
|
|
* @name czm_epsilon3
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon3 = 0.001;
|
|
`;var TN=`/**
|
|
* 0.0001
|
|
*
|
|
* @name czm_epsilon4
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon4 = 0.0001;
|
|
`;var SN=`/**
|
|
* 0.00001
|
|
*
|
|
* @name czm_epsilon5
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon5 = 0.00001;
|
|
`;var wN=`/**
|
|
* 0.000001
|
|
*
|
|
* @name czm_epsilon6
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon6 = 0.000001;
|
|
`;var BN=`/**
|
|
* 0.0000001
|
|
*
|
|
* @name czm_epsilon7
|
|
* @glslConstant
|
|
*/
|
|
const float czm_epsilon7 = 0.0000001;
|
|
`;var DN=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_infinity
|
|
* @glslConstant
|
|
*/
|
|
const float czm_infinity = 5906376272000.0; // Distance from the Sun to Pluto in meters. TODO: What is best given lowp, mediump, and highp?
|
|
`;var vN=`/**
|
|
* A built-in GLSL floating-point constant for <code>1/pi</code>.
|
|
*
|
|
* @alias czm_oneOverPi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.ONE_OVER_PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_oneOverPi = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 1.0 / czm_oneOverPi;
|
|
*/
|
|
const float czm_oneOverPi = 0.3183098861837907;
|
|
`;var PN=`/**
|
|
* A built-in GLSL floating-point constant for <code>1/2pi</code>.
|
|
*
|
|
* @alias czm_oneOverTwoPi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.ONE_OVER_TWO_PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_oneOverTwoPi = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 2.0 * czm_oneOverTwoPi;
|
|
*/
|
|
const float czm_oneOverTwoPi = 0.15915494309189535;
|
|
`;var RN=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE}
|
|
*
|
|
* @name czm_passCesium3DTile
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTile = 5.0;
|
|
`;var MN=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION}
|
|
*
|
|
* @name czm_passCesium3DTileClassification
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileClassification = 6.0;
|
|
`;var NN=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW}
|
|
*
|
|
* @name czm_passCesium3DTileClassificationIgnoreShow
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileClassificationIgnoreShow = 7.0;
|
|
`;var LN=`/**
|
|
* The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_EDGES}
|
|
*
|
|
* @name czm_passCesium3DTileEdges
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCesium3DTileEdges = 4.0;
|
|
|
|
`;var ON=`/**
|
|
* The automatic GLSL constant for {@link Pass#CLASSIFICATION}
|
|
*
|
|
* @name czm_passClassification
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passClassification = 7.0;
|
|
`;var FN=`/**
|
|
* The automatic GLSL constant for {@link Pass#COMPUTE}
|
|
*
|
|
* @name czm_passCompute
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passCompute = 1.0;
|
|
`;var QN=`/**
|
|
* The automatic GLSL constant for {@link Pass#ENVIRONMENT}
|
|
*
|
|
* @name czm_passEnvironment
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passEnvironment = 0.0;
|
|
`;var kN=`/**
|
|
* The automatic GLSL constant for {@link Pass#GAUSSIAN_SPLATS}
|
|
*
|
|
* @name czm_passGaussianSplats
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passGaussianSplats = 11.0;
|
|
`;var UN=`/**
|
|
* The automatic GLSL constant for {@link Pass#GLOBE}
|
|
*
|
|
* @name czm_passGlobe
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passGlobe = 2.0;
|
|
`;var zN=`/**
|
|
* The automatic GLSL constant for {@link Pass#OPAQUE}
|
|
*
|
|
* @name czm_passOpaque
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passOpaque = 8.0;
|
|
`;var GN=`/**
|
|
* The automatic GLSL constant for {@link Pass#OVERLAY}
|
|
*
|
|
* @name czm_passOverlay
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passOverlay = 12.0;
|
|
`;var VN=`/**
|
|
* The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION}
|
|
*
|
|
* @name czm_passTerrainClassification
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passTerrainClassification = 3.0;
|
|
`;var HN=`/**
|
|
* The automatic GLSL constant for {@link Pass#TRANSLUCENT}
|
|
*
|
|
* @name czm_passTranslucent
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passTranslucent = 9.0;
|
|
`;var WN=`/**
|
|
* The automatic GLSL constant for {@link Pass#VOXELS}
|
|
*
|
|
* @name czm_passVoxels
|
|
* @glslConstant
|
|
*
|
|
* @see czm_pass
|
|
*/
|
|
const float czm_passVoxels = 10.0;
|
|
`;var jN=`/**
|
|
* A built-in GLSL floating-point constant for <code>Math.PI</code>.
|
|
*
|
|
* @alias czm_pi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_pi = ...;
|
|
*
|
|
* // Example
|
|
* float twoPi = 2.0 * czm_pi;
|
|
*/
|
|
const float czm_pi = 3.141592653589793;
|
|
`;var YN=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/4</code>.
|
|
*
|
|
* @alias czm_piOverFour
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_FOUR
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverFour = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 4.0 * czm_piOverFour;
|
|
*/
|
|
const float czm_piOverFour = 0.7853981633974483;
|
|
`;var qN=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/6</code>.
|
|
*
|
|
* @alias czm_piOverSix
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_SIX
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverSix = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 6.0 * czm_piOverSix;
|
|
*/
|
|
const float czm_piOverSix = 0.5235987755982988;
|
|
`;var KN=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/3</code>.
|
|
*
|
|
* @alias czm_piOverThree
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_THREE
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverThree = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 3.0 * czm_piOverThree;
|
|
*/
|
|
const float czm_piOverThree = 1.0471975511965976;
|
|
`;var XN=`/**
|
|
* A built-in GLSL floating-point constant for <code>pi/2</code>.
|
|
*
|
|
* @alias czm_piOverTwo
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.PI_OVER_TWO
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_piOverTwo = ...;
|
|
*
|
|
* // Example
|
|
* float pi = 2.0 * czm_piOverTwo;
|
|
*/
|
|
const float czm_piOverTwo = 1.5707963267948966;
|
|
`;var JN=`/**
|
|
* A built-in GLSL floating-point constant for converting degrees to radians.
|
|
*
|
|
* @alias czm_radiansPerDegree
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.RADIANS_PER_DEGREE
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_radiansPerDegree = ...;
|
|
*
|
|
* // Example
|
|
* float rad = czm_radiansPerDegree * deg;
|
|
*/
|
|
const float czm_radiansPerDegree = 0.017453292519943295;
|
|
`;var ZN=`/**
|
|
* The constant identifier for the 2D {@link SceneMode}
|
|
*
|
|
* @name czm_sceneMode2D
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneModeColumbusView
|
|
* @see czm_sceneMode3D
|
|
* @see czm_sceneModeMorphing
|
|
*/
|
|
const float czm_sceneMode2D = 2.0;
|
|
`;var $N=`/**
|
|
* The constant identifier for the 3D {@link SceneMode}
|
|
*
|
|
* @name czm_sceneMode3D
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneMode2D
|
|
* @see czm_sceneModeColumbusView
|
|
* @see czm_sceneModeMorphing
|
|
*/
|
|
const float czm_sceneMode3D = 3.0;
|
|
`;var eL=`/**
|
|
* The constant identifier for the Columbus View {@link SceneMode}
|
|
*
|
|
* @name czm_sceneModeColumbusView
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneMode2D
|
|
* @see czm_sceneMode3D
|
|
* @see czm_sceneModeMorphing
|
|
*/
|
|
const float czm_sceneModeColumbusView = 1.0;
|
|
`;var tL=`/**
|
|
* The constant identifier for the Morphing {@link SceneMode}
|
|
*
|
|
* @name czm_sceneModeMorphing
|
|
* @glslConstant
|
|
* @see czm_sceneMode
|
|
* @see czm_sceneMode2D
|
|
* @see czm_sceneModeColumbusView
|
|
* @see czm_sceneMode3D
|
|
*/
|
|
const float czm_sceneModeMorphing = 0.0;
|
|
`;var nL=`/**
|
|
* A built-in GLSL floating-point constant for one solar radius.
|
|
*
|
|
* @alias czm_solarRadius
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.SOLAR_RADIUS
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_solarRadius = ...;
|
|
*/
|
|
const float czm_solarRadius = 695500000.0;
|
|
`;var iL=`/**
|
|
* A built-in GLSL floating-point constant for <code>3pi/2</code>.
|
|
*
|
|
* @alias czm_threePiOver2
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.THREE_PI_OVER_TWO
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_threePiOver2 = ...;
|
|
*
|
|
* // Example
|
|
* float pi = (2.0 / 3.0) * czm_threePiOver2;
|
|
*/
|
|
const float czm_threePiOver2 = 4.71238898038469;
|
|
`;var oL=`/**
|
|
* A built-in GLSL floating-point constant for <code>2pi</code>.
|
|
*
|
|
* @alias czm_twoPi
|
|
* @glslConstant
|
|
*
|
|
* @see CesiumMath.TWO_PI
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* const float czm_twoPi = ...;
|
|
*
|
|
* // Example
|
|
* float pi = czm_twoPi / 2.0;
|
|
*/
|
|
const float czm_twoPi = 6.283185307179586;
|
|
`;var rL=`/**
|
|
* The maximum latitude, in radians, both North and South, supported by a Web Mercator
|
|
* (EPSG:3857) projection. Technically, the Mercator projection is defined
|
|
* for any latitude up to (but not including) 90 degrees, but it makes sense
|
|
* to cut it off sooner because it grows exponentially with increasing latitude.
|
|
* The logic behind this particular cutoff value, which is the one used by
|
|
* Google Maps, Bing Maps, and Esri, is that it makes the projection
|
|
* square. That is, the rectangle is equal in the X and Y directions.
|
|
*
|
|
* The constant value is computed as follows:
|
|
* czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi)))
|
|
*
|
|
* @name czm_webMercatorMaxLatitude
|
|
* @glslConstant
|
|
*/
|
|
const float czm_webMercatorMaxLatitude = 1.4844222297453324;
|
|
`;var aL=`/**
|
|
* @name czm_depthRangeStruct
|
|
* @glslStruct
|
|
*/
|
|
struct czm_depthRangeStruct
|
|
{
|
|
float near;
|
|
float far;
|
|
};
|
|
`;var sL=`/**
|
|
* Holds material information that can be used for lighting. Returned by all czm_getMaterial functions.
|
|
*
|
|
* @name czm_material
|
|
* @glslStruct
|
|
*
|
|
* @property {vec3} diffuse Incoming light that scatters evenly in all directions.
|
|
* @property {float} specular Intensity of incoming light reflecting in a single direction.
|
|
* @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
|
|
* @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
|
|
* @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
|
|
* @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
|
|
*/
|
|
struct czm_material
|
|
{
|
|
vec3 diffuse;
|
|
float specular;
|
|
float shininess;
|
|
vec3 normal;
|
|
vec3 emission;
|
|
float alpha;
|
|
};
|
|
`;var cL=`/**
|
|
* Used as input to every material's czm_getMaterial function.
|
|
*
|
|
* @name czm_materialInput
|
|
* @glslStruct
|
|
*
|
|
* @property {float} s 1D texture coordinates.
|
|
* @property {vec2} st 2D texture coordinates.
|
|
* @property {vec3} str 3D texture coordinates.
|
|
* @property {vec3} normalEC Unperturbed surface normal in eye coordinates.
|
|
* @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space.
|
|
* @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye.
|
|
* @property {float} height The height of the terrain in meters above or below the ellipsoid. Only available for globe materials.
|
|
* @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials.
|
|
* @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials.
|
|
* @property {float} waterMask The value of the water mask. 0 is land, 1 is water. Only available for globe materials.
|
|
*/
|
|
struct czm_materialInput
|
|
{
|
|
float s;
|
|
vec2 st;
|
|
vec3 str;
|
|
vec3 normalEC;
|
|
mat3 tangentToEyeMatrix;
|
|
vec3 positionToEyeEC;
|
|
float height;
|
|
float slope;
|
|
float aspect;
|
|
float waterMask;
|
|
};
|
|
`;var lL=`/**
|
|
* Struct for representing a material for a {@link Model}. The model
|
|
* rendering pipeline will pass this struct between material, custom shaders,
|
|
* and lighting stages. This is not to be confused with {@link czm_material}
|
|
* which is used by the older Fabric materials system, although they are similar.
|
|
* <p>
|
|
* All color values (diffuse, specular, emissive) are in linear color space.
|
|
* </p>
|
|
*
|
|
* @name czm_modelMaterial
|
|
* @glslStruct
|
|
*
|
|
* @property {vec4} baseColor The base color of the material.
|
|
* @property {vec3} diffuse Incoming light that scatters evenly in all directions.
|
|
* @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque.
|
|
* @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature.
|
|
* @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces.
|
|
* @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal.
|
|
* @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded.
|
|
* @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light.
|
|
*/
|
|
struct czm_modelMaterial {
|
|
vec4 baseColor;
|
|
vec3 diffuse;
|
|
float alpha;
|
|
vec3 specular;
|
|
float roughness;
|
|
vec3 normalEC;
|
|
float occlusion;
|
|
vec3 emissive;
|
|
#ifdef USE_SPECULAR
|
|
float specularWeight;
|
|
#endif
|
|
#ifdef USE_ANISOTROPY
|
|
vec3 anisotropicT;
|
|
vec3 anisotropicB;
|
|
float anisotropyStrength;
|
|
#endif
|
|
#ifdef USE_CLEARCOAT
|
|
float clearcoatFactor;
|
|
float clearcoatRoughness;
|
|
vec3 clearcoatNormal;
|
|
// Add clearcoatF0 when KHR_materials_ior is implemented
|
|
#endif
|
|
};
|
|
`;var uL=`/**
|
|
* Struct for representing the output of a custom vertex shader.
|
|
*
|
|
* @name czm_modelVertexOutput
|
|
* @glslStruct
|
|
*
|
|
* @see {@link CustomShader}
|
|
* @see {@link Model}
|
|
*
|
|
* @property {vec3} positionMC The position of the vertex in model coordinates
|
|
* @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives.
|
|
*/
|
|
struct czm_modelVertexOutput {
|
|
vec3 positionMC;
|
|
float pointSize;
|
|
};
|
|
`;var fL=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_ray
|
|
* @glslStruct
|
|
*/
|
|
struct czm_ray
|
|
{
|
|
vec3 origin;
|
|
vec3 direction;
|
|
};
|
|
`;var dL=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_raySegment
|
|
* @glslStruct
|
|
*/
|
|
struct czm_raySegment
|
|
{
|
|
float start;
|
|
float stop;
|
|
};
|
|
|
|
/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_emptyRaySegment
|
|
* @glslConstant
|
|
*/
|
|
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
|
|
|
|
/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_fullRaySegment
|
|
* @glslConstant
|
|
*/
|
|
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
|
|
`;var hL=`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 mL=`// See:
|
|
// https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/
|
|
|
|
vec3 czm_acesTonemapping(vec3 color) {
|
|
float g = 0.985;
|
|
float a = 0.065;
|
|
float b = 0.0001;
|
|
float c = 0.433;
|
|
float d = 0.238;
|
|
|
|
color = (color * (color + a) - b) / (color * (g * color + c) + d);
|
|
|
|
color = clamp(color, 0.0, 1.0);
|
|
|
|
return color;
|
|
}
|
|
`;var pL=`/**
|
|
* @private
|
|
*/
|
|
float czm_alphaWeight(float a)
|
|
{
|
|
float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
|
|
|
|
// See Weighted Blended Order-Independent Transparency for examples of different weighting functions:
|
|
// http://jcgt.org/published/0002/02/09/
|
|
return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
|
|
}
|
|
`;var AL=`/**
|
|
* Procedural anti-aliasing by blurring two colors that meet at a sharp edge.
|
|
*
|
|
* @name czm_antialias
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} color1 The color on one side of the edge.
|
|
* @param {vec4} color2 The color on the other side of the edge.
|
|
* @param {vec4} currentcolor The current color, either <code>color1</code> or <code>color2</code>.
|
|
* @param {float} dist The distance to the edge in texture coordinates.
|
|
* @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors.
|
|
* @returns {vec4} The anti-aliased color.
|
|
*
|
|
* @example
|
|
* // GLSL declarations
|
|
* vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor);
|
|
* vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist);
|
|
*
|
|
* // get the color for a material that has a sharp edge at the line y = 0.5 in texture space
|
|
* float dist = abs(textureCoordinates.t - 0.5);
|
|
* vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t));
|
|
* vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1);
|
|
*/
|
|
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
|
|
{
|
|
float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
|
|
float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
|
|
val1 = val1 * (1.0 - val2);
|
|
val1 = val1 * val1 * (3.0 - (2.0 * val1));
|
|
val1 = pow(val1, 0.5); //makes the transition nicer
|
|
|
|
vec4 midColor = (color1 + color2) * 0.5;
|
|
return mix(midColor, currentColor, val1);
|
|
}
|
|
|
|
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
|
|
{
|
|
return czm_antialias(color1, color2, currentColor, dist, 0.1);
|
|
}
|
|
`;var gL=`/**
|
|
* Apply a HSB color shift to an RGB color.
|
|
*
|
|
* @param {vec3} rgb The color in RGB space.
|
|
* @param {vec3} hsbShift The amount to shift each component. The xyz components correspond to hue, saturation, and brightness. Shifting the hue by +/- 1.0 corresponds to shifting the hue by a full cycle. Saturation and brightness are clamped between 0 and 1 after the adjustment
|
|
* @param {bool} ignoreBlackPixels If true, black pixels will be unchanged. This is necessary in some shaders such as atmosphere-related effects.
|
|
*
|
|
* @return {vec3} The RGB color after shifting in HSB space and clamping saturation and brightness to a valid range.
|
|
*/
|
|
vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
|
|
// Convert rgb color to hsb
|
|
vec3 hsb = czm_RGBToHSB(rgb);
|
|
|
|
// Perform hsb shift
|
|
// Hue cycles around so no clamp is needed.
|
|
hsb.x += hsbShift.x; // hue
|
|
hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0); // saturation
|
|
|
|
// brightness
|
|
//
|
|
// Some shaders such as atmosphere-related effects need to leave black
|
|
// pixels unchanged
|
|
if (ignoreBlackPixels) {
|
|
hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
|
|
} else {
|
|
hsb.z = hsb.z + hsbShift.z;
|
|
}
|
|
hsb.z = clamp(hsb.z, 0.0, 1.0);
|
|
|
|
// Convert shifted hsb back to rgb
|
|
return czm_HSBToRGB(hsb);
|
|
}
|
|
`;var _L=`/**
|
|
* Approximately computes spherical coordinates given a normal.
|
|
* Uses approximate inverse trigonometry for speed and consistency,
|
|
* since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU.
|
|
*
|
|
* @name czm_approximateSphericalCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} normal arbitrary-length normal.
|
|
*
|
|
* @returns {vec2} Approximate latitude and longitude spherical coordinates.
|
|
*/
|
|
vec2 czm_approximateSphericalCoordinates(vec3 normal) {
|
|
// Project into plane with vertical for latitude
|
|
float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
|
|
float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
|
|
return vec2(latitudeApproximation, longitudeApproximation);
|
|
}
|
|
`;var yL=`/**
|
|
* Compute a rational approximation to tanh(x)
|
|
*
|
|
* @param {float} x A real number input
|
|
* @returns {float} An approximation for tanh(x)
|
|
*/
|
|
float czm_approximateTanh(float x) {
|
|
float x2 = x * x;
|
|
return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
|
|
}
|
|
`;var CL=`/**
|
|
* Determines if the fragment is back facing
|
|
*
|
|
* @name czm_backFacing
|
|
* @glslFunction
|
|
*
|
|
* @returns {bool} <code>true</code> if the fragment is back facing; otherwise, <code>false</code>.
|
|
*/
|
|
bool czm_backFacing()
|
|
{
|
|
// !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494.
|
|
return gl_FrontFacing == false;
|
|
}
|
|
`;var EL=`/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a float expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {float} a Value to return if the comparison is true.
|
|
* @param {float} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {float} equivalent of comparison ? a : b
|
|
*/
|
|
float czm_branchFreeTernary(bool comparison, float a, float b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
|
|
/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a vec2 expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {vec2} a Value to return if the comparison is true.
|
|
* @param {vec2} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {vec2} equivalent of comparison ? a : b
|
|
*/
|
|
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
|
|
/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a vec3 expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {vec3} a Value to return if the comparison is true.
|
|
* @param {vec3} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {vec3} equivalent of comparison ? a : b
|
|
*/
|
|
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
|
|
/**
|
|
* Branchless ternary operator to be used when it's inexpensive to explicitly
|
|
* evaluate both possibilities for a vec4 expression.
|
|
*
|
|
* @name czm_branchFreeTernary
|
|
* @glslFunction
|
|
*
|
|
* @param {bool} comparison A comparison statement
|
|
* @param {vec3} a Value to return if the comparison is true.
|
|
* @param {vec3} b Value to return if the comparison is false.
|
|
*
|
|
* @returns {vec3} equivalent of comparison ? a : b
|
|
*/
|
|
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
|
|
float useA = float(comparison);
|
|
return a * useA + b * (1.0 - useA);
|
|
}
|
|
`;var IL=`
|
|
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 bL=`
|
|
uniform vec4 shadowMap_cascadeDistances;
|
|
|
|
float czm_cascadeDistance(vec4 weights)
|
|
{
|
|
return dot(shadowMap_cascadeDistances, weights);
|
|
}
|
|
`;var xL=`
|
|
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 TL=`
|
|
uniform vec4 shadowMap_cascadeSplits[2];
|
|
|
|
vec4 czm_cascadeWeights(float depthEye)
|
|
{
|
|
// One component is set to 1.0 and all others set to 0.0.
|
|
vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
|
|
vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
|
|
return near * far;
|
|
}
|
|
`;var SL=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
|
|
float signedDistance = texture(clippingDistance, uv).r;
|
|
return (signedDistance - 0.5) * 2.0;
|
|
}
|
|
|
|
void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
|
|
// Position is completely outside of polygons bounds
|
|
vec2 rectUv = clippingPosition;
|
|
if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
|
|
#ifdef CLIPPING_INVERSE
|
|
discard;
|
|
#endif
|
|
return;
|
|
}
|
|
|
|
vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
|
|
vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
|
|
float dimension = float(extentsLength);
|
|
if (extentsLength > 2) {
|
|
dimension = ceil(log2(float(extentsLength)));
|
|
}
|
|
|
|
vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
|
|
vec2 uv = textureOffset + rectUv / dimension;
|
|
|
|
float signedDistance = getSignedDistance(uv, clippingDistance);
|
|
|
|
#ifdef CLIPPING_INVERSE
|
|
if (signedDistance > 0.0) {
|
|
discard;
|
|
}
|
|
#else
|
|
if (signedDistance < 0.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
}
|
|
`;var wL=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_columbusViewMorph
|
|
* @glslFunction
|
|
*/
|
|
vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
|
|
{
|
|
// Just linear for now.
|
|
// We're manually doing the equivalent of a \`mix\` here because, some GPUs
|
|
// (NVidia GeForce 3070 Ti and Intel Arc A750, to name two), \`mix\` seems to
|
|
// use an alternate formulation that introduces jitter even when \`time\` is
|
|
// 0.0 or 1.0. That is, the value of \`p\` won't be exactly \`position2D.xyz\`
|
|
// when \`time\` is 0.0 and it won't be exactly \`position3D.xyz\` when \`time\` is
|
|
// 1.0. The "textbook" formulation here, while probably a bit slower,
|
|
// does not have this problem.
|
|
vec3 p = position2D.xyz * (1.0 - time) + position3D.xyz * time;
|
|
return vec4(p, 1.0);
|
|
}
|
|
`;var BL=`/**
|
|
* Compute the atmosphere color, applying Rayleigh and Mie scattering. This
|
|
* builtin uses automatic uniforms so the atmophere settings are synced with the
|
|
* state of the Scene, even in other contexts like Model.
|
|
*
|
|
* @name czm_computeAtmosphereColor
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionWC Position of the fragment in world coords (low precision)
|
|
* @param {vec3} lightDirection Light direction from the sun or other light source.
|
|
* @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
|
|
* @param {vec3} mieColor The Mie scattering color computed by a scattering function
|
|
* @param {float} opacity The opacity computed by a scattering function.
|
|
*/
|
|
vec4 czm_computeAtmosphereColor(
|
|
vec3 positionWC,
|
|
vec3 lightDirection,
|
|
vec3 rayleighColor,
|
|
vec3 mieColor,
|
|
float opacity
|
|
) {
|
|
// Setup the primary ray: from the camera position to the vertex position.
|
|
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
|
|
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
|
|
|
|
float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
|
|
float cosAngleSq = cosAngle * cosAngle;
|
|
|
|
float G = czm_atmosphereMieAnisotropy;
|
|
float GSq = G * G;
|
|
|
|
// The Rayleigh phase function.
|
|
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
|
|
// The Mie phase function.
|
|
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
|
|
|
|
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
|
|
vec3 rayleigh = rayleighPhase * rayleighColor;
|
|
vec3 mie = miePhase * mieColor;
|
|
|
|
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
|
|
|
|
return vec4(color, opacity);
|
|
}
|
|
|
|
/**
|
|
* Compute the atmosphere color, applying Rayleigh and Mie scattering. This
|
|
* builtin uses automatic uniforms so the atmophere settings are synced with the
|
|
* state of the Scene, even in other contexts like Model.
|
|
*
|
|
* @name czm_computeAtmosphereColor
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} primaryRay Ray from the origin to sky fragment to in world coords (low precision)
|
|
* @param {vec3} lightDirection Light direction from the sun or other light source.
|
|
* @param {vec3} rayleighColor The Rayleigh scattering color computed by a scattering function
|
|
* @param {vec3} mieColor The Mie scattering color computed by a scattering function
|
|
* @param {float} opacity The opacity computed by a scattering function.
|
|
*/
|
|
vec4 czm_computeAtmosphereColor(
|
|
czm_ray primaryRay,
|
|
vec3 lightDirection,
|
|
vec3 rayleighColor,
|
|
vec3 mieColor,
|
|
float opacity
|
|
) {
|
|
vec3 direction = normalize(primaryRay.direction);
|
|
|
|
float cosAngle = dot(direction, lightDirection);
|
|
float cosAngleSq = cosAngle * cosAngle;
|
|
|
|
float G = czm_atmosphereMieAnisotropy;
|
|
float GSq = G * G;
|
|
|
|
// The Rayleigh phase function.
|
|
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
|
|
// The Mie phase function.
|
|
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
|
|
|
|
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
|
|
vec3 rayleigh = rayleighPhase * rayleighColor;
|
|
vec3 mie = miePhase * mieColor;
|
|
|
|
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
|
|
|
|
return vec4(color, opacity);
|
|
}
|
|
|
|
`;var DL=`/**
|
|
* Compute atmosphere scattering for the ground atmosphere and fog. This method
|
|
* uses automatic uniforms so it is always synced with the scene settings.
|
|
*
|
|
* @name czm_computeGroundAtmosphereScattering
|
|
* @glslfunction
|
|
*
|
|
* @param {vec3} positionWC The position of the fragment in world coordinates.
|
|
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
|
|
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
|
|
* @param {vec3} mieColor The variable the Mie scattering will be written to.
|
|
* @param {float} opacity The variable the transmittance will be written to.
|
|
*/
|
|
void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
|
|
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
|
|
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
|
|
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
|
|
|
|
float atmosphereInnerRadius = length(positionWC);
|
|
|
|
czm_computeScattering(
|
|
primaryRay,
|
|
length(cameraToPositionWC),
|
|
lightDirection,
|
|
atmosphereInnerRadius,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
}
|
|
`;var vL=`/**
|
|
* Returns a position in model coordinates relative to eye taking into
|
|
* account the current scene mode: 3D, 2D, or Columbus view.
|
|
* <p>
|
|
* This uses standard position attributes, <code>position3DHigh</code>,
|
|
* <code>position3DLow</code>, <code>position2DHigh</code>, and <code>position2DLow</code>,
|
|
* and should be used when writing a vertex shader for an {@link Appearance}.
|
|
* </p>
|
|
*
|
|
* @name czm_computePosition
|
|
* @glslFunction
|
|
*
|
|
* @returns {vec4} The position relative to eye.
|
|
*
|
|
* @example
|
|
* vec4 p = czm_computePosition();
|
|
* v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
|
|
* gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
*
|
|
* @see czm_translateRelativeToEye
|
|
*/
|
|
vec4 czm_computePosition();
|
|
`;var PL=`/**
|
|
* This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
|
|
* the transmittance value for the ray. This function uses automatic uniforms
|
|
* so the atmosphere settings are always synced with the current scene.
|
|
*
|
|
* @name czm_computeScattering
|
|
* @glslfunction
|
|
*
|
|
* @param {czm_ray} primaryRay The ray from the camera to the position.
|
|
* @param {float} primaryRayLength The length of the primary ray.
|
|
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
|
|
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
|
|
* @param {vec3} mieColor The variable the Mie scattering will be written to.
|
|
* @param {float} opacity The variable the transmittance will be written to.
|
|
*/
|
|
void czm_computeScattering(
|
|
czm_ray primaryRay,
|
|
float primaryRayLength,
|
|
vec3 lightDirection,
|
|
float atmosphereInnerRadius,
|
|
out vec3 rayleighColor,
|
|
out vec3 mieColor,
|
|
out float opacity
|
|
) {
|
|
const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
|
|
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
// Initialize the default scattering amounts to 0.
|
|
rayleighColor = vec3(0.0);
|
|
mieColor = vec3(0.0);
|
|
opacity = 0.0;
|
|
|
|
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
|
|
|
|
vec3 origin = vec3(0.0);
|
|
|
|
// Calculate intersection from the camera to the outer ring of the atmosphere.
|
|
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
|
|
|
|
// Return empty colors if no intersection with the atmosphere geometry.
|
|
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
|
|
return;
|
|
}
|
|
|
|
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
|
|
// we implement a split strategy: sky or horizon.
|
|
// For performance reasons, instead of a if/else branch
|
|
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
|
|
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
|
|
// Value close to 0.0: close to the horizon
|
|
// Value close to 1.0: above in the sky
|
|
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
|
|
|
|
// The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
|
|
float start_0 = primaryRayAtmosphereIntersect.start;
|
|
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
|
|
// The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
|
|
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
|
|
|
|
// For the number of ray steps, distinguish inside or outside atmosphere (outer space)
|
|
// (1) from outer space we have to use more ray steps to get a realistic rendering
|
|
// (2) within atmosphere we need fewer steps for faster rendering
|
|
float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
|
|
float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
|
|
int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
// Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
|
|
float rayPositionLength = primaryRayAtmosphereIntersect.start;
|
|
// (1) Outside the atmosphere: constant rayStepLength
|
|
// (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
|
|
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
|
|
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
|
|
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
|
|
|
|
vec3 rayleighAccumulation = vec3(0.0);
|
|
vec3 mieAccumulation = vec3(0.0);
|
|
vec2 opticalDepth = vec2(0.0);
|
|
vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);
|
|
|
|
// Sample positions on the primary ray.
|
|
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
|
|
|
|
// The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (i >= PRIMARY_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along viewpoint ray.
|
|
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
|
|
|
|
// Calculate height of sample position above ellipsoid.
|
|
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate and accumulate density of particles at the sample position.
|
|
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
|
|
opticalDepth += sampleDensity;
|
|
|
|
// Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
|
|
czm_ray lightRay = czm_ray(samplePosition, lightDirection);
|
|
czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
|
|
|
|
float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
|
|
float lightPositionLength = 0.0;
|
|
|
|
vec2 lightOpticalDepth = vec2(0.0);
|
|
|
|
// Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
|
|
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
|
|
|
|
// The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (j >= LIGHT_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along light ray.
|
|
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
|
|
|
|
// Calculate height of the light sample position above ellipsoid.
|
|
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate density of photons at the light sample position.
|
|
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
|
|
|
|
// Increment distance on light ray.
|
|
lightPositionLength += lightStepLength;
|
|
}
|
|
|
|
// Compute attenuation via the primary ray and the light ray.
|
|
vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
|
|
|
|
// Accumulate the scattering.
|
|
rayleighAccumulation += sampleDensity.x * attenuation;
|
|
mieAccumulation += sampleDensity.y * attenuation;
|
|
|
|
// Increment distance on primary ray.
|
|
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
|
|
}
|
|
|
|
// Compute the scattering amount.
|
|
rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
|
|
mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
|
|
|
|
// Compute the transmittance i.e. how much light is passing through the atmosphere.
|
|
opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
|
|
}
|
|
`;var RL=`/**
|
|
* Applies a 2D texture transformation matrix to texture coordinates.
|
|
* This function applies translation, rotation, and scaling transformations
|
|
* as specified by the KHR_texture_transform glTF extension.
|
|
*
|
|
* @name czm_computeTextureTransform
|
|
* @glslFunction
|
|
*
|
|
* @param {vec2} texCoord The texture coordinates to transform.
|
|
* @param {mat3} textureTransform The 3x3 transformation matrix.
|
|
*
|
|
* @returns {vec2} The transformed texture coordinates.
|
|
*
|
|
* @example
|
|
* // GLSL declaration
|
|
* vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform);
|
|
*
|
|
* // Apply texture transform to UV coordinates
|
|
* vec2 transformedUV = czm_computeTextureTransform(uv, u_textureTransform);
|
|
*/
|
|
vec2 czm_computeTextureTransform(vec2 texCoord, mat3 textureTransform)
|
|
{
|
|
return vec2(textureTransform * vec3(texCoord, 1.0));
|
|
}`;var ML=`/**
|
|
* @private
|
|
*/
|
|
vec2 cordic(float angle)
|
|
{
|
|
// Scale the vector by the appropriate factor for the 24 iterations to follow.
|
|
vec2 vector = vec2(6.0725293500888267e-1, 0.0);
|
|
// Iteration 1
|
|
float sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
// float factor = sense * 1.0; // 2^-0
|
|
mat2 rotation = mat2(1.0, sense, -sense, 1.0);
|
|
vector = rotation * vector;
|
|
angle -= sense * 7.8539816339744828e-1; // atan(2^-0)
|
|
// Iteration 2
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
float factor = sense * 5.0e-1; // 2^-1
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 4.6364760900080609e-1; // atan(2^-1)
|
|
// Iteration 3
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 2.5e-1; // 2^-2
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 2.4497866312686414e-1; // atan(2^-2)
|
|
// Iteration 4
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.25e-1; // 2^-3
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.2435499454676144e-1; // atan(2^-3)
|
|
// Iteration 5
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 6.25e-2; // 2^-4
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 6.2418809995957350e-2; // atan(2^-4)
|
|
// Iteration 6
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.125e-2; // 2^-5
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.1239833430268277e-2; // atan(2^-5)
|
|
// Iteration 7
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.5625e-2; // 2^-6
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.5623728620476831e-2; // atan(2^-6)
|
|
// Iteration 8
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 7.8125e-3; // 2^-7
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 7.8123410601011111e-3; // atan(2^-7)
|
|
// Iteration 9
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.90625e-3; // 2^-8
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.9062301319669718e-3; // atan(2^-8)
|
|
// Iteration 10
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.953125e-3; // 2^-9
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.9531225164788188e-3; // atan(2^-9)
|
|
// Iteration 11
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 9.765625e-4; // 2^-10
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 9.7656218955931946e-4; // atan(2^-10)
|
|
// Iteration 12
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 4.8828125e-4; // 2^-11
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 4.8828121119489829e-4; // atan(2^-11)
|
|
// Iteration 13
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 2.44140625e-4; // 2^-12
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 2.4414062014936177e-4; // atan(2^-12)
|
|
// Iteration 14
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.220703125e-4; // 2^-13
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.2207031189367021e-4; // atan(2^-13)
|
|
// Iteration 15
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 6.103515625e-5; // 2^-14
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 6.1035156174208773e-5; // atan(2^-14)
|
|
// Iteration 16
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.0517578125e-5; // 2^-15
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.0517578115526096e-5; // atan(2^-15)
|
|
// Iteration 17
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.52587890625e-5; // 2^-16
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.5258789061315762e-5; // atan(2^-16)
|
|
// Iteration 18
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 7.62939453125e-6; // 2^-17
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 7.6293945311019700e-6; // atan(2^-17)
|
|
// Iteration 19
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 3.814697265625e-6; // 2^-18
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 3.8146972656064961e-6; // atan(2^-18)
|
|
// Iteration 20
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.9073486328125e-6; // 2^-19
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 1.9073486328101870e-6; // atan(2^-19)
|
|
// Iteration 21
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 9.5367431640625e-7; // 2^-20
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 9.5367431640596084e-7; // atan(2^-20)
|
|
// Iteration 22
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 4.76837158203125e-7; // 2^-21
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 4.7683715820308884e-7; // atan(2^-21)
|
|
// Iteration 23
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 2.384185791015625e-7; // 2^-22
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
angle -= sense * 2.3841857910155797e-7; // atan(2^-22)
|
|
// Iteration 24
|
|
sense = (angle < 0.0) ? -1.0 : 1.0;
|
|
factor = sense * 1.1920928955078125e-7; // 2^-23
|
|
rotation[0][1] = factor;
|
|
rotation[1][0] = -factor;
|
|
vector = rotation * vector;
|
|
// angle -= sense * 1.1920928955078068e-7; // atan(2^-23)
|
|
|
|
return vector;
|
|
}
|
|
|
|
/**
|
|
* Computes the cosine and sine of the provided angle using the CORDIC algorithm.
|
|
*
|
|
* @name czm_cosineAndSine
|
|
* @glslFunction
|
|
*
|
|
* @param {float} angle The angle in radians.
|
|
*
|
|
* @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate).
|
|
*
|
|
* @example
|
|
* vec2 v = czm_cosineAndSine(czm_piOverSix);
|
|
* float cosine = v.x;
|
|
* float sine = v.y;
|
|
*/
|
|
vec2 czm_cosineAndSine(float angle)
|
|
{
|
|
if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
|
|
{
|
|
if (angle < 0.0)
|
|
{
|
|
return -cordic(angle + czm_pi);
|
|
}
|
|
else
|
|
{
|
|
return -cordic(angle - czm_pi);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
return cordic(angle);
|
|
}
|
|
}
|
|
`;var NL=`/**
|
|
* Decodes RGB values packed into a single float at 8-bit precision. Encoded
|
|
* representation is equivalent to 0xFFFFFF in JavaScript.
|
|
*
|
|
* @name czm_decodeRGB8
|
|
* @glslFunction
|
|
*
|
|
* @param {float} encoded Float-encoded RGB values.
|
|
* @returns {vec4} Decoded RGB values.
|
|
*/
|
|
vec4 czm_decodeRGB8(float encoded) {
|
|
const float SHIFT_RIGHT16 = 1.0 / 65536.0;
|
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
const float SHIFT_LEFT16 = 65536.0;
|
|
const float SHIFT_LEFT8 = 256.0;
|
|
|
|
vec4 color = vec4(255.0);
|
|
color.r = floor(encoded * SHIFT_RIGHT16);
|
|
color.g = floor((encoded - color.r * SHIFT_LEFT16) * SHIFT_RIGHT8);
|
|
color.b = floor(encoded - color.r * SHIFT_LEFT16 - color.g * SHIFT_LEFT8);
|
|
return color / 255.0;
|
|
}
|
|
`;var LL=`/**
|
|
* Decompresses texture coordinates that were packed into a single float.
|
|
*
|
|
* @name czm_decompressTextureCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {float} encoded The compressed texture coordinates.
|
|
* @returns {vec2} The decompressed texture coordinates.
|
|
*/
|
|
vec2 czm_decompressTextureCoordinates(float encoded)
|
|
{
|
|
float temp = encoded / 4096.0;
|
|
float xZeroTo4095 = floor(temp);
|
|
float stx = xZeroTo4095 / 4095.0;
|
|
float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
|
|
return vec2(stx, sty);
|
|
}
|
|
`;var OL=`// emulated noperspective
|
|
#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
|
|
out float v_WindowZ;
|
|
#endif
|
|
|
|
/**
|
|
* Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2.
|
|
* GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes,
|
|
* capping the shadow volume. More information here:
|
|
* https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt.
|
|
*
|
|
* When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring
|
|
* no geometry gets clipped by setting the clip space z value to 0.0 and then
|
|
* sending the unaltered screen space z value (using emulated noperspective
|
|
* interpolation) to the frag shader where it is clamped to [0,1] and then
|
|
* written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on:
|
|
* https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv.
|
|
*
|
|
* When GL_EXT_frag_depth is not available, which is the case on some mobile
|
|
* devices, we must attempt to fix this only in the vertex shader.
|
|
* The approach is to clamp the z value to the far plane, which closes the
|
|
* shadow volume but also distorts the geometry, so there can still be artifacts
|
|
* on frustum seams.
|
|
*
|
|
* @name czm_depthClamp
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} coords The vertex in clip coordinates.
|
|
* @returns {vec4} The modified vertex.
|
|
*
|
|
* @example
|
|
* gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0));
|
|
*
|
|
* @see czm_writeDepthClamp
|
|
*/
|
|
vec4 czm_depthClamp(vec4 coords)
|
|
{
|
|
#ifndef LOG_DEPTH
|
|
#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
|
|
v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
|
|
coords.z = 0.0;
|
|
#else
|
|
coords.z = min(coords.z, coords.w);
|
|
#endif
|
|
#endif
|
|
return coords;
|
|
}
|
|
`;var FL=`/**
|
|
* Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system
|
|
* to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the
|
|
* surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping.
|
|
* <br /><br />
|
|
* The ellipsoid is assumed to be centered at the model coordinate's origin.
|
|
*
|
|
* @name czm_eastNorthUpToEyeCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionMC The position on the ellipsoid in model coordinates.
|
|
* @param {vec3} normalEC The normalized ellipsoid surface normal, at <code>positionMC</code>, in eye coordinates.
|
|
*
|
|
* @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates.
|
|
*
|
|
* @example
|
|
* // Transform a vector defined in the east-north-up coordinate
|
|
* // system, (0, 0, 1) which is the surface normal, to eye
|
|
* // coordinates.
|
|
* mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
|
|
* vec3 normalEC = m * vec3(0.0, 0.0, 1.0);
|
|
*/
|
|
mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
|
|
{
|
|
vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates
|
|
vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordinates
|
|
vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates
|
|
|
|
return mat3(
|
|
tangentEC.x, tangentEC.y, tangentEC.z,
|
|
bitangentEC.x, bitangentEC.y, bitangentEC.z,
|
|
normalEC.x, normalEC.y, normalEC.z);
|
|
}
|
|
`;var QL=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_ellipsoidContainsPoint
|
|
* @glslFunction
|
|
*
|
|
*/
|
|
bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
|
|
{
|
|
vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
|
|
return (dot(scaled, scaled) <= 1.0);
|
|
}
|
|
`;var kL=`/**
|
|
* Approximate uv coordinates based on the ellipsoid normal.
|
|
*
|
|
* @name czm_ellipsoidTextureCoordinates
|
|
* @glslFunction
|
|
*/
|
|
vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
|
|
{
|
|
return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
|
|
}
|
|
`;var UL=`/**
|
|
* Compares <code>left</code> and <code>right</code> componentwise. Returns <code>true</code>
|
|
* if they are within <code>epsilon</code> and <code>false</code> otherwise. The inputs
|
|
* <code>left</code> and <code>right</code> can be <code>float</code>s, <code>vec2</code>s,
|
|
* <code>vec3</code>s, or <code>vec4</code>s.
|
|
*
|
|
* @name czm_equalsEpsilon
|
|
* @glslFunction
|
|
*
|
|
* @param {} left The first vector.
|
|
* @param {} right The second vector.
|
|
* @param {float} epsilon The epsilon to use for equality testing.
|
|
* @returns {bool} <code>true</code> if the components are within <code>epsilon</code> and <code>false</code> otherwise.
|
|
*
|
|
* @example
|
|
* // GLSL declarations
|
|
* bool czm_equalsEpsilon(float left, float right, float epsilon);
|
|
* bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon);
|
|
* bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon);
|
|
* bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon);
|
|
*/
|
|
bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
|
|
return all(lessThanEqual(abs(left - right), vec4(epsilon)));
|
|
}
|
|
|
|
bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
|
|
return all(lessThanEqual(abs(left - right), vec3(epsilon)));
|
|
}
|
|
|
|
bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
|
|
return all(lessThanEqual(abs(left - right), vec2(epsilon)));
|
|
}
|
|
|
|
bool czm_equalsEpsilon(float left, float right, float epsilon) {
|
|
return (abs(left - right) <= epsilon);
|
|
}
|
|
`;var zL=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_eyeOffset
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} positionEC DOC_TBA.
|
|
* @param {vec3} eyeOffset DOC_TBA.
|
|
*
|
|
* @returns {vec4} DOC_TBA.
|
|
*/
|
|
vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
|
|
{
|
|
// This equation is approximate in x and y.
|
|
vec4 p = positionEC;
|
|
vec4 zEyeOffset = normalize(p) * eyeOffset.z;
|
|
p.xy += eyeOffset.xy + zEyeOffset.xy;
|
|
p.z += zEyeOffset.z;
|
|
return p;
|
|
}
|
|
`;var GL=`/**
|
|
* Transforms a position from eye to window coordinates. The transformation
|
|
* from eye to clip coordinates is done using {@link czm_projection}.
|
|
* The transform from normalized device coordinates to window coordinates is
|
|
* done using {@link czm_viewportTransformation}, which assumes a depth range
|
|
* of <code>near = 0</code> and <code>far = 1</code>.
|
|
* <br /><br />
|
|
* This transform is useful when there is a need to manipulate window coordinates
|
|
* in a vertex shader as done by {@link BillboardCollection}.
|
|
*
|
|
* @name czm_eyeToWindowCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} position The position in eye coordinates to transform.
|
|
*
|
|
* @returns {vec4} The transformed position in window coordinates.
|
|
*
|
|
* @see czm_modelToWindowCoordinates
|
|
* @see czm_projection
|
|
* @see czm_viewportTransformation
|
|
* @see BillboardCollection
|
|
*
|
|
* @example
|
|
* vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
|
|
*/
|
|
vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
|
|
{
|
|
vec4 q = czm_projection * positionEC; // clip coordinates
|
|
q.xyz /= q.w; // normalized device coordinates
|
|
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
|
|
return q;
|
|
}
|
|
`;var VL=`/**
|
|
* Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input.
|
|
*
|
|
* Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on
|
|
* "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006.
|
|
* Adapted from ShaderFastLibs under MIT License.
|
|
*
|
|
* Chosen for the following characteristics over range [0, 1]:
|
|
* - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan)
|
|
* - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator)
|
|
*
|
|
* The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301);
|
|
* Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2.
|
|
*
|
|
* @name czm_fastApproximateAtan
|
|
* @glslFunction
|
|
*
|
|
* @param {float} x Value between 0 and 1 inclusive.
|
|
*
|
|
* @returns {float} Approximation of atan(x)
|
|
*/
|
|
float czm_fastApproximateAtan(float x) {
|
|
return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
|
|
}
|
|
|
|
/**
|
|
* Approximation of atan2.
|
|
*
|
|
* Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html
|
|
* However, we replaced their atan curve with Michael Drobot's (see above).
|
|
*
|
|
* @name czm_fastApproximateAtan
|
|
* @glslFunction
|
|
*
|
|
* @param {float} x Value between -1 and 1 inclusive.
|
|
* @param {float} y Value between -1 and 1 inclusive.
|
|
*
|
|
* @returns {float} Approximation of atan2(x, y)
|
|
*/
|
|
float czm_fastApproximateAtan(float x, float y) {
|
|
// atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications.
|
|
// So range-reduce using abs and by flipping whether x or y is on top.
|
|
float t = abs(x); // t used as swap and atan result.
|
|
float opposite = abs(y);
|
|
float adjacent = max(t, opposite);
|
|
opposite = min(t, opposite);
|
|
|
|
t = czm_fastApproximateAtan(opposite / adjacent);
|
|
|
|
// Undo range reduction
|
|
t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
|
|
t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
|
|
t = czm_branchFreeTernary(y < 0.0, -t, t);
|
|
return t;
|
|
}
|
|
`;var HL=`/**
|
|
* Gets the color with fog at a distance from the camera.
|
|
*
|
|
* @name czm_fog
|
|
* @glslFunction
|
|
*
|
|
* @param {float} distanceToCamera The distance to the camera in meters.
|
|
* @param {vec3} color The original color.
|
|
* @param {vec3} fogColor The color of the fog.
|
|
*
|
|
* @returns {vec3} The color adjusted for fog at the distance from the camera.
|
|
*/
|
|
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
|
|
{
|
|
float scalar = distanceToCamera * czm_fogDensity;
|
|
float fog = 1.0 - exp(-(scalar * scalar));
|
|
return mix(color, fogColor, fog);
|
|
}
|
|
|
|
/**
|
|
* Gets the color with fog at a distance from the camera.
|
|
*
|
|
* @name czm_fog
|
|
* @glslFunction
|
|
*
|
|
* @param {float} distanceToCamera The distance to the camera in meters.
|
|
* @param {vec3} color The original color.
|
|
* @param {vec3} fogColor The color of the fog.
|
|
* @param {float} fogModifierConstant A constant to modify the appearance of fog.
|
|
*
|
|
* @returns {vec3} The color adjusted for fog at the distance from the camera.
|
|
*/
|
|
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
|
|
{
|
|
float scalar = distanceToCamera * czm_fogDensity;
|
|
float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
|
|
return mix(color, fogColor, fog);
|
|
}
|
|
`;var WL=`/**
|
|
* Converts a color from RGB space to linear space.
|
|
*
|
|
* @name czm_gammaCorrect
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} color The color in RGB space.
|
|
* @returns {vec3} The color in linear space.
|
|
*/
|
|
vec3 czm_gammaCorrect(vec3 color) {
|
|
#ifdef HDR
|
|
color = pow(color, vec3(czm_gamma));
|
|
#endif
|
|
return color;
|
|
}
|
|
|
|
vec4 czm_gammaCorrect(vec4 color) {
|
|
#ifdef HDR
|
|
color.rgb = pow(color.rgb, vec3(czm_gamma));
|
|
#endif
|
|
return color;
|
|
}
|
|
`;var jL=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_geodeticSurfaceNormal
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionOnEllipsoid DOC_TBA
|
|
* @param {vec3} ellipsoidCenter DOC_TBA
|
|
* @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA
|
|
*
|
|
* @returns {vec3} DOC_TBA.
|
|
*/
|
|
vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
|
|
{
|
|
return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
|
|
}
|
|
`;var YL=`/**
|
|
* An czm_material with default values. Every material's czm_getMaterial
|
|
* should use this default material as a base for the material it returns.
|
|
* The default normal value is given by materialInput.normalEC.
|
|
*
|
|
* @name czm_getDefaultMaterial
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_materialInput} input The input used to construct the default material.
|
|
*
|
|
* @returns {czm_material} The default material.
|
|
*
|
|
* @see czm_materialInput
|
|
* @see czm_material
|
|
* @see czm_getMaterial
|
|
*/
|
|
czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material;
|
|
material.diffuse = vec3(0.0);
|
|
material.specular = 0.0;
|
|
material.shininess = 1.0;
|
|
material.normal = materialInput.normalEC;
|
|
material.emission = vec3(0.0);
|
|
material.alpha = 1.0;
|
|
return material;
|
|
}
|
|
`;var qL=`/**
|
|
* Select which direction vector to use for dynamic atmosphere lighting based on an enum value
|
|
*
|
|
* @name czm_getDynamicAtmosphereLightDirection
|
|
* @glslfunction
|
|
* @see DynamicAtmosphereLightingType.js
|
|
*
|
|
* @param {vec3} positionWC the position of the vertex/fragment in world coordinates. This is normalized and returned when dynamic lighting is turned off.
|
|
* @param {float} lightEnum The enum value for selecting between light sources.
|
|
* @return {vec3} The normalized light direction vector. Depending on the enum value, it is either positionWC, czm_lightDirectionWC or czm_sunDirectionWC
|
|
*/
|
|
vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
|
|
const float NONE = 0.0;
|
|
const float SCENE_LIGHT = 1.0;
|
|
const float SUNLIGHT = 2.0;
|
|
|
|
vec3 lightDirection =
|
|
positionWC * float(lightEnum == NONE) +
|
|
czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
|
|
czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
|
|
return normalize(lightDirection);
|
|
}
|
|
`;var KL=`/**
|
|
* Calculates the intensity of diffusely reflected light.
|
|
*
|
|
* @name czm_getLambertDiffuse
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
|
|
* @param {vec3} normalEC The surface normal in eye coordinates.
|
|
*
|
|
* @returns {float} The intensity of the diffuse reflection.
|
|
*
|
|
* @see czm_phong
|
|
*
|
|
* @example
|
|
* float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
|
|
* float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
|
|
* vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
|
|
*/
|
|
float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
|
|
{
|
|
return max(dot(lightDirectionEC, normalEC), 0.0);
|
|
}
|
|
`;var XL=`/**
|
|
* Calculates the specular intensity of reflected light.
|
|
*
|
|
* @name czm_getSpecular
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
|
|
* @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates.
|
|
* @param {vec3} normalEC The surface normal in eye coordinates.
|
|
* @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight.
|
|
*
|
|
* @returns {float} The intensity of the specular highlight.
|
|
*
|
|
* @see czm_phong
|
|
*
|
|
* @example
|
|
* float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC);
|
|
* float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200);
|
|
* vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity);
|
|
*/
|
|
float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
|
|
{
|
|
vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
|
|
float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
|
|
|
|
// pow has undefined behavior if both parameters <= 0.
|
|
// Prevent this by making sure shininess is at least czm_epsilon2.
|
|
return pow(specular, max(shininess, czm_epsilon2));
|
|
}
|
|
`;var JL=`/**
|
|
* @private
|
|
*/
|
|
vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
|
|
{
|
|
float cosAngle = cos(angleInRadians);
|
|
float sinAngle = sin(angleInRadians);
|
|
|
|
// time dependent sampling directions
|
|
vec2 s0 = vec2(1.0/17.0, 0.0);
|
|
vec2 s1 = vec2(-1.0/29.0, 0.0);
|
|
vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
|
|
vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);
|
|
|
|
// rotate sampling direction by specified angle
|
|
s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
|
|
s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
|
|
s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
|
|
s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));
|
|
|
|
vec2 uv0 = (uv/103.0) + (time * s0);
|
|
vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
|
|
vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
|
|
vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);
|
|
|
|
uv0 = fract(uv0);
|
|
uv1 = fract(uv1);
|
|
uv2 = fract(uv2);
|
|
uv3 = fract(uv3);
|
|
vec4 noise = (texture(normalMap, uv0)) +
|
|
(texture(normalMap, uv1)) +
|
|
(texture(normalMap, uv2)) +
|
|
(texture(normalMap, uv3));
|
|
|
|
// average and scale to between -1 and 1
|
|
return ((noise / 4.0) - 0.5) * 2.0;
|
|
}
|
|
`;var ZL=`/**
|
|
* Converts an HSB color (hue, saturation, brightness) to RGB
|
|
* HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
|
|
*
|
|
* @name czm_HSBToRGB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} hsb The color in HSB.
|
|
*
|
|
* @returns {vec3} The color in RGB.
|
|
*
|
|
* @example
|
|
* vec3 hsb = czm_RGBToHSB(rgb);
|
|
* hsb.z *= 0.1;
|
|
* rgb = czm_HSBToRGB(hsb);
|
|
*/
|
|
|
|
const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
|
|
|
vec3 czm_HSBToRGB(vec3 hsb)
|
|
{
|
|
vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
|
|
return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
|
|
}
|
|
`;var $L=`/**
|
|
* Converts an HSL color (hue, saturation, lightness) to RGB
|
|
* HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
|
|
*
|
|
* @name czm_HSLToRGB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in HSL.
|
|
*
|
|
* @returns {vec3} The color in RGB.
|
|
*
|
|
* @example
|
|
* vec3 hsl = czm_RGBToHSL(rgb);
|
|
* hsl.z *= 0.1;
|
|
* rgb = czm_HSLToRGB(hsl);
|
|
*/
|
|
|
|
vec3 hueToRGB(float hue)
|
|
{
|
|
float r = abs(hue * 6.0 - 3.0) - 1.0;
|
|
float g = 2.0 - abs(hue * 6.0 - 2.0);
|
|
float b = 2.0 - abs(hue * 6.0 - 4.0);
|
|
return clamp(vec3(r, g, b), 0.0, 1.0);
|
|
}
|
|
|
|
vec3 czm_HSLToRGB(vec3 hsl)
|
|
{
|
|
vec3 rgb = hueToRGB(hsl.x);
|
|
float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
|
|
return (rgb - 0.5) * c + hsl.z;
|
|
}
|
|
`;var eO=`/**
|
|
* Adjusts the hue of a color.
|
|
*
|
|
* @name czm_hue
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color.
|
|
* @param {float} adjustment The amount to adjust the hue of the color in radians.
|
|
*
|
|
* @returns {float} The color with the hue adjusted.
|
|
*
|
|
* @example
|
|
* vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi)
|
|
*/
|
|
vec3 czm_hue(vec3 rgb, float adjustment)
|
|
{
|
|
const mat3 toYIQ = mat3(0.299, 0.587, 0.114,
|
|
0.595716, -0.274453, -0.321263,
|
|
0.211456, -0.522591, 0.311135);
|
|
const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,
|
|
1.0, -0.2721, -0.6474,
|
|
1.0, -1.107, 1.7046);
|
|
|
|
vec3 yiq = toYIQ * rgb;
|
|
float hue = atan(yiq.z, yiq.y) + adjustment;
|
|
float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
|
|
|
|
vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
|
|
return toRGB * color;
|
|
}
|
|
`;var tO=`/**
|
|
* Converts a color in linear space to RGB space.
|
|
*
|
|
* @name czm_inverseGamma
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} color The color in linear space.
|
|
* @returns {vec3} The color in RGB space.
|
|
*/
|
|
vec3 czm_inverseGamma(vec3 color) {
|
|
return pow(color, vec3(1.0 / czm_gamma));
|
|
}
|
|
`;var nO=`/**
|
|
* Determines if a time interval is empty.
|
|
*
|
|
* @name czm_isEmpty
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_raySegment} interval The interval to test.
|
|
*
|
|
* @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
|
|
*
|
|
* @example
|
|
* bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
|
|
* bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
|
|
* bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
|
|
*/
|
|
bool czm_isEmpty(czm_raySegment interval)
|
|
{
|
|
return (interval.stop < 0.0);
|
|
}
|
|
`;var iO=`/**
|
|
* Determines if a time interval is empty.
|
|
*
|
|
* @name czm_isFull
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_raySegment} interval The interval to test.
|
|
*
|
|
* @returns {bool} <code>true</code> if the time interval is empty; otherwise, <code>false</code>.
|
|
*
|
|
* @example
|
|
* bool b0 = czm_isEmpty(czm_emptyRaySegment); // true
|
|
* bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false
|
|
* bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0.
|
|
*/
|
|
bool czm_isFull(czm_raySegment interval)
|
|
{
|
|
return (interval.start == 0.0 && interval.stop == czm_infinity);
|
|
}
|
|
`;var oO=`/**
|
|
* Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located.
|
|
*
|
|
* @name czm_latitudeToWebMercatorFraction
|
|
* @glslFunction
|
|
*
|
|
* @param {float} latitude The geodetic latitude, in radians.
|
|
* @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle.
|
|
* @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates.
|
|
*
|
|
* @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern
|
|
* boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return
|
|
* value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection.
|
|
*/
|
|
float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
|
|
{
|
|
float sinLatitude = sin(latitude);
|
|
float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
|
|
|
|
return (mercatorY - southMercatorY) * oneOverMercatorHeight;
|
|
}
|
|
`;var rO=`/**
|
|
* Converts a linear RGB color to an sRGB color.
|
|
*
|
|
* @param {vec3|vec4} linearIn The color in linear color space.
|
|
* @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input.
|
|
*/
|
|
vec3 czm_linearToSrgb(vec3 linearIn)
|
|
{
|
|
return pow(linearIn, vec3(1.0/2.2));
|
|
}
|
|
|
|
vec4 czm_linearToSrgb(vec4 linearIn)
|
|
{
|
|
vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
|
|
return vec4(srgbOut, linearIn.a);
|
|
}
|
|
`;var aO=`/**
|
|
* Computes distance from an point in 2D to a line in 2D.
|
|
*
|
|
* @name czm_lineDistance
|
|
* @glslFunction
|
|
*
|
|
* param {vec2} point1 A point along the line.
|
|
* param {vec2} point2 A point along the line.
|
|
* param {vec2} point A point that may or may not be on the line.
|
|
* returns {float} The distance from the point to the line.
|
|
*/
|
|
float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
|
|
return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
|
|
}
|
|
`;var sO=`/**
|
|
* Computes the luminance of a color.
|
|
*
|
|
* @name czm_luminance
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color.
|
|
*
|
|
* @returns {float} The luminance.
|
|
*
|
|
* @example
|
|
* float light = czm_luminance(vec3(0.0)); // 0.0
|
|
* float dark = czm_luminance(vec3(1.0)); // ~1.0
|
|
*/
|
|
float czm_luminance(vec3 rgb)
|
|
{
|
|
// Algorithm from Chapter 10 of Graphics Shaders.
|
|
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
return dot(rgb, W);
|
|
}
|
|
`;var cO=`/**
|
|
* Find the maximum component of a vector.
|
|
*
|
|
* @name czm_maximumComponent
|
|
* @glslFunction
|
|
*
|
|
* @param {vec2|vec3|vec4} v The input vector.
|
|
* @returns {float} The value of the largest component.
|
|
*/
|
|
float czm_maximumComponent(vec2 v)
|
|
{
|
|
return max(v.x, v.y);
|
|
}
|
|
float czm_maximumComponent(vec3 v)
|
|
{
|
|
return max(max(v.x, v.y), v.z);
|
|
}
|
|
float czm_maximumComponent(vec4 v)
|
|
{
|
|
return max(max(max(v.x, v.y), v.z), v.w);
|
|
}
|
|
`;var lO=`/**
|
|
* Computes the size of a pixel in meters at a distance from the eye.
|
|
* <p>
|
|
* Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel.
|
|
* </p>
|
|
* @name czm_metersPerPixel
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
|
|
* @param {float} pixelRatio The scaling factor from pixel space to coordinate space
|
|
*
|
|
* @returns {float} The meters per pixel at positionEC.
|
|
*/
|
|
float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
|
|
{
|
|
float width = czm_viewport.z;
|
|
float height = czm_viewport.w;
|
|
float pixelWidth;
|
|
float pixelHeight;
|
|
|
|
float top = czm_frustumPlanes.x;
|
|
float bottom = czm_frustumPlanes.y;
|
|
float left = czm_frustumPlanes.z;
|
|
float right = czm_frustumPlanes.w;
|
|
|
|
if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
|
|
{
|
|
float frustumWidth = right - left;
|
|
float frustumHeight = top - bottom;
|
|
pixelWidth = frustumWidth / width;
|
|
pixelHeight = frustumHeight / height;
|
|
}
|
|
else
|
|
{
|
|
float distanceToPixel = -positionEC.z;
|
|
float inverseNear = 1.0 / czm_currentFrustum.x;
|
|
float tanTheta = top * inverseNear;
|
|
pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
|
|
tanTheta = right * inverseNear;
|
|
pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
|
|
}
|
|
|
|
return max(pixelWidth, pixelHeight) * pixelRatio;
|
|
}
|
|
|
|
/**
|
|
* Computes the size of a pixel in meters at a distance from the eye.
|
|
* <p>
|
|
* Use this version when scaling by pixel ratio.
|
|
* </p>
|
|
* @name czm_metersPerPixel
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} positionEC The position to get the meters per pixel in eye coordinates.
|
|
*
|
|
* @returns {float} The meters per pixel at positionEC.
|
|
*/
|
|
float czm_metersPerPixel(vec4 positionEC)
|
|
{
|
|
return czm_metersPerPixel(positionEC, czm_pixelRatio);
|
|
}
|
|
`;var uO=`/**
|
|
* Transforms a position from model to window coordinates. The transformation
|
|
* from model to clip coordinates is done using {@link czm_modelViewProjection}.
|
|
* The transform from normalized device coordinates to window coordinates is
|
|
* done using {@link czm_viewportTransformation}, which assumes a depth range
|
|
* of <code>near = 0</code> and <code>far = 1</code>.
|
|
* <br /><br />
|
|
* This transform is useful when there is a need to manipulate window coordinates
|
|
* in a vertex shader as done by {@link BillboardCollection}.
|
|
* <br /><br />
|
|
* This function should not be confused with {@link czm_viewportOrthographic},
|
|
* which is an orthographic projection matrix that transforms from window
|
|
* coordinates to clip coordinates.
|
|
*
|
|
* @name czm_modelToWindowCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} position The position in model coordinates to transform.
|
|
*
|
|
* @returns {vec4} The transformed position in window coordinates.
|
|
*
|
|
* @see czm_eyeToWindowCoordinates
|
|
* @see czm_modelViewProjection
|
|
* @see czm_viewportTransformation
|
|
* @see czm_viewportOrthographic
|
|
* @see BillboardCollection
|
|
*
|
|
* @example
|
|
* vec4 positionWC = czm_modelToWindowCoordinates(positionMC);
|
|
*/
|
|
vec4 czm_modelToWindowCoordinates(vec4 position)
|
|
{
|
|
vec4 positionEC = czm_modelView * position;
|
|
vec4 q = czm_projection * positionEC;
|
|
q.xyz /= q.w; // normalized device coordinates
|
|
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates
|
|
return q;
|
|
}
|
|
`;var fO=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_multiplyWithColorBalance
|
|
* @glslFunction
|
|
*/
|
|
vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
|
|
{
|
|
// Algorithm from Chapter 10 of Graphics Shaders.
|
|
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
|
|
vec3 target = left * right;
|
|
float leftLuminance = dot(left, W);
|
|
float rightLuminance = dot(right, W);
|
|
float targetLuminance = dot(target, W);
|
|
|
|
return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
|
|
}
|
|
`;var dO=`/**
|
|
* Computes a value that scales with distance. The scaling is clamped at the near and
|
|
* far distances, and does not extrapolate. This function works with the
|
|
* {@link NearFarScalar} JavaScript class.
|
|
*
|
|
* @name czm_nearFarScalar
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w).
|
|
* @param {float} cameraDistSq The square of the current distance from the camera.
|
|
*
|
|
* @returns {float} The value at this distance.
|
|
*/
|
|
float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
|
|
{
|
|
float valueAtMin = nearFarScalar.y;
|
|
float valueAtMax = nearFarScalar.w;
|
|
float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
|
|
float farDistanceSq = nearFarScalar.z * nearFarScalar.z;
|
|
|
|
float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);
|
|
|
|
t = pow(clamp(t, 0.0, 1.0), 0.2);
|
|
|
|
return mix(valueAtMin, valueAtMax, t);
|
|
}
|
|
`;var hO=` /**
|
|
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {vec2} encoded The oct-encoded, unit-length vector
|
|
* @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits.
|
|
* @returns {vec3} The decoded and normalized vector
|
|
*/
|
|
vec3 czm_octDecode(vec2 encoded, float range)
|
|
{
|
|
if (encoded.x == 0.0 && encoded.y == 0.0) {
|
|
return vec3(0.0, 0.0, 0.0);
|
|
}
|
|
|
|
encoded = encoded / range * 2.0 - 1.0;
|
|
vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
|
|
if (v.z < 0.0)
|
|
{
|
|
v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
|
|
}
|
|
|
|
return normalize(v);
|
|
}
|
|
|
|
/**
|
|
* Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {vec2} encoded The oct-encoded, unit-length vector
|
|
* @returns {vec3} The decoded and normalized vector
|
|
*/
|
|
vec3 czm_octDecode(vec2 encoded)
|
|
{
|
|
return czm_octDecode(encoded, 255.0);
|
|
}
|
|
|
|
/**
|
|
* Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {float} encoded The oct-encoded, unit-length vector
|
|
* @returns {vec3} The decoded and normalized vector
|
|
*/
|
|
vec3 czm_octDecode(float encoded)
|
|
{
|
|
float temp = encoded / 256.0;
|
|
float x = floor(temp);
|
|
float y = (temp - x) * 256.0;
|
|
return czm_octDecode(vec2(x, y));
|
|
}
|
|
|
|
/**
|
|
* Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors.
|
|
* The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors",
|
|
* Cigolle et al 2014: http://jcgt.org/published/0003/02/01/
|
|
*
|
|
* @name czm_octDecode
|
|
* @param {vec2} encoded The packed oct-encoded, unit-length vectors.
|
|
* @param {vec3} vector1 One decoded and normalized vector.
|
|
* @param {vec3} vector2 One decoded and normalized vector.
|
|
* @param {vec3} vector3 One decoded and normalized vector.
|
|
*/
|
|
void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
|
|
{
|
|
float temp = encoded.x / 65536.0;
|
|
float x = floor(temp);
|
|
float encodedFloat1 = (temp - x) * 65536.0;
|
|
|
|
temp = encoded.y / 65536.0;
|
|
float y = floor(temp);
|
|
float encodedFloat2 = (temp - y) * 65536.0;
|
|
|
|
vector1 = czm_octDecode(encodedFloat1);
|
|
vector2 = czm_octDecode(encodedFloat2);
|
|
vector3 = czm_octDecode(vec2(x, y));
|
|
}
|
|
|
|
`;var mO=`/**
|
|
* Packs a depth value into a vec4 that can be represented by unsigned bytes.
|
|
*
|
|
* @name czm_packDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {float} depth The floating-point depth.
|
|
* @returns {vec4} The packed depth.
|
|
*/
|
|
vec4 czm_packDepth(float depth)
|
|
{
|
|
// See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
|
|
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
|
|
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
|
|
enc = fract(enc);
|
|
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
|
|
return enc;
|
|
}
|
|
`;var pO=`vec3 lambertianDiffuse(vec3 diffuseColor)
|
|
{
|
|
return diffuseColor / czm_pi;
|
|
}
|
|
|
|
vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
|
|
{
|
|
float versine = 1.0 - VdotH;
|
|
// pow(versine, 5.0) is slow. See https://stackoverflow.com/a/68793086/10082269
|
|
float versineSquared = versine * versine;
|
|
return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
|
|
}
|
|
|
|
#ifdef USE_ANISOTROPY
|
|
/**
|
|
* @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
|
|
* @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
|
|
* @param {vec3} lightDirection The direction from the fragment to the light source, transformed to tangent-bitangent-normal coordinates
|
|
* @param {vec3} viewDirection The direction from the fragment to the camera, transformed to tangent-bitangent-normal coordinates
|
|
*/
|
|
float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
|
|
{
|
|
vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
|
|
float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
|
|
float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
|
|
float v = 0.5 / (GGXV + GGXL);
|
|
return clamp(v, 0.0, 1.0);
|
|
}
|
|
|
|
/**
|
|
* @param {float} bitangentRoughness Material roughness (along the anisotropy bitangent)
|
|
* @param {float} tangentialRoughness Anisotropic roughness (along the anisotropy tangent)
|
|
* @param {vec3} halfwayDirection The unit vector halfway between light and view directions, transformed to tangent-bitangent-normal coordinates
|
|
*/
|
|
float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
|
|
{
|
|
float roughnessSquared = bitangentRoughness * tangentialRoughness;
|
|
vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
|
|
float w2 = roughnessSquared / dot(f, f);
|
|
return roughnessSquared * w2 * w2 / czm_pi;
|
|
}
|
|
#endif
|
|
|
|
/**
|
|
* Estimate the geometric self-shadowing of the microfacets in a surface,
|
|
* using the Smith Joint GGX visibility function.
|
|
* Note: Vis = G / (4 * NdotL * NdotV)
|
|
* see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
|
|
* see Real-Time Rendering. Page 331 to 336.
|
|
* see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
|
|
*
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
|
|
* @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
|
|
*/
|
|
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
|
|
{
|
|
float alphaRoughnessSq = alphaRoughness * alphaRoughness;
|
|
|
|
float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
|
|
float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
|
|
|
|
float GGX = GGXV + GGXL;
|
|
if (GGX > 0.0)
|
|
{
|
|
return 0.5 / GGX;
|
|
}
|
|
return 0.0;
|
|
}
|
|
|
|
/**
|
|
* Estimate the fraction of the microfacets in a surface that are aligned with
|
|
* the halfway vector, which is aligned halfway between the directions from
|
|
* the fragment to the camera and from the fragment to the light source.
|
|
*
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @param {float} NdotH The cosine of the angle between the surface normal and the halfway vector.
|
|
* @return {float} The fraction of microfacets aligned to the halfway vector.
|
|
*/
|
|
float GGX(float alphaRoughness, float NdotH)
|
|
{
|
|
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
|
|
float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
|
|
return alphaRoughnessSquared / (czm_pi * f * f);
|
|
}
|
|
|
|
/**
|
|
* Compute the strength of the specular reflection due to direct lighting.
|
|
*
|
|
* @param {vec3} normal The surface normal.
|
|
* @param {vec3} lightDirection The unit vector pointing from the fragment to the light source.
|
|
* @param {vec3} viewDirection The unit vector pointing from the fragment to the camera.
|
|
* @param {vec3} halfwayDirection The unit vector pointing from the fragment to halfway between the light source and the camera.
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @return {float} The strength of the specular reflection.
|
|
*/
|
|
float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
|
|
{
|
|
float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
|
|
float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
|
|
float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
|
|
float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
|
|
float D = GGX(alphaRoughness, NdotH);
|
|
return G * D;
|
|
}
|
|
|
|
/**
|
|
* Compute the diffuse and specular contributions using physically based
|
|
* rendering. This function only handles direct lighting.
|
|
* <p>
|
|
* This function only handles the lighting calculations. Metallic/roughness
|
|
* and specular/glossy must be handled separately. See {@MaterialStageFS}
|
|
* </p>
|
|
*
|
|
* @name czm_pbrLighting
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position
|
|
* @param {vec3} normalEC The surface normal in eye coordinates
|
|
* @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates.
|
|
* @param {czm_modelMaterial} The material properties.
|
|
* @return {vec3} The computed HDR color
|
|
*/
|
|
vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
|
|
{
|
|
vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
|
|
float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
|
|
float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);
|
|
|
|
vec3 f0 = material.specular;
|
|
float reflectance = czm_maximumComponent(f0);
|
|
// Typical dielectrics will have reflectance 0.04, so f90 will be 1.0.
|
|
// In this case, at grazing angle, all incident energy is reflected.
|
|
vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
|
|
vec3 F = fresnelSchlick2(f0, f90, VdotH);
|
|
|
|
#if defined(USE_SPECULAR)
|
|
F *= material.specularWeight;
|
|
#endif
|
|
|
|
float alphaRoughness = material.roughness * material.roughness;
|
|
#ifdef USE_ANISOTROPY
|
|
mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
|
|
vec3 lightDirection = lightDirectionEC * tbn;
|
|
vec3 viewDirection = viewDirectionEC * tbn;
|
|
vec3 halfwayDirection = halfwayDirectionEC * tbn;
|
|
float anisotropyStrength = material.anisotropyStrength;
|
|
float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
|
|
float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
|
|
float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
|
|
float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
|
|
vec3 specularContribution = F * G * D;
|
|
#else
|
|
float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
|
|
vec3 specularContribution = F * specularStrength;
|
|
#endif
|
|
|
|
vec3 diffuseColor = material.diffuse;
|
|
// F here represents the specular contribution
|
|
vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
|
|
|
|
// Lo = (diffuse + specular) * Li * NdotL
|
|
return (diffuseContribution + specularContribution) * NdotL;
|
|
}
|
|
`;var AO=`// KhronosGroup https://github.com/KhronosGroup/ToneMapping/tree/main/PBR_Neutral
|
|
|
|
// Input color is non-negative and resides in the Linear Rec. 709 color space.
|
|
// Output color is also Linear Rec. 709, but in the [0, 1] range.
|
|
|
|
vec3 czm_pbrNeutralTonemapping(vec3 color) {
|
|
const float startCompression = 0.8 - 0.04;
|
|
const float desaturation = 0.15;
|
|
|
|
float x = min(color.r, min(color.g, color.b));
|
|
float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
|
|
color -= offset;
|
|
|
|
float peak = max(color.r, max(color.g, color.b));
|
|
if (peak < startCompression) return color;
|
|
|
|
const float d = 1.0 - startCompression;
|
|
float newPeak = 1.0 - d * d / (peak + d - startCompression);
|
|
color *= newPeak / peak;
|
|
|
|
float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
|
|
return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
|
|
}
|
|
`;var gO=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
|
|
{
|
|
return czm_getLambertDiffuse(lightDirectionEC, material.normal);
|
|
}
|
|
|
|
float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
|
|
{
|
|
return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
|
|
}
|
|
|
|
/**
|
|
* Computes a color using the Phong lighting model.
|
|
*
|
|
* @name czm_phong
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates.
|
|
* @param {czm_material} material The fragment's material.
|
|
*
|
|
* @returns {vec4} The computed color.
|
|
*
|
|
* @example
|
|
* vec3 positionToEyeEC = // ...
|
|
* czm_material material = // ...
|
|
* vec3 lightDirectionEC = // ...
|
|
* out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC);
|
|
*
|
|
* @see czm_getMaterial
|
|
*/
|
|
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
|
|
{
|
|
// Diffuse from directional light sources at eye (for top-down)
|
|
float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
|
|
if (czm_sceneMode == czm_sceneMode3D) {
|
|
// (and horizon views in 3D)
|
|
diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
|
|
}
|
|
|
|
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
|
|
|
|
// Temporary workaround for adding ambient.
|
|
vec3 materialDiffuse = material.diffuse * 0.5;
|
|
|
|
vec3 ambient = materialDiffuse;
|
|
vec3 color = ambient + material.emission;
|
|
color += materialDiffuse * diffuse * czm_lightColor;
|
|
color += material.specular * specular * czm_lightColor;
|
|
|
|
return vec4(color, material.alpha);
|
|
}
|
|
|
|
vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
|
|
{
|
|
float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
|
|
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
|
|
|
|
vec3 ambient = vec3(0.0);
|
|
vec3 color = ambient + material.emission;
|
|
color += material.diffuse * diffuse * czm_lightColor;
|
|
color += material.specular * specular * czm_lightColor;
|
|
|
|
return vec4(color, material.alpha);
|
|
}
|
|
`;var _O=`/**
|
|
* Computes distance from a point to a plane.
|
|
*
|
|
* @name czm_planeDistance
|
|
* @glslFunction
|
|
*
|
|
* param {vec4} plane A Plane in Hessian Normal Form. See Plane.js
|
|
* param {vec3} point A point in the same space as the plane.
|
|
* returns {float} The distance from the point to the plane.
|
|
*/
|
|
float czm_planeDistance(vec4 plane, vec3 point) {
|
|
return (dot(plane.xyz, point) + plane.w);
|
|
}
|
|
|
|
/**
|
|
* Computes distance from a point to a plane.
|
|
*
|
|
* @name czm_planeDistance
|
|
* @glslFunction
|
|
*
|
|
* param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js
|
|
* param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js
|
|
* param {vec3} point A point in the same space as the plane.
|
|
* returns {float} The distance from the point to the plane.
|
|
*/
|
|
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
|
|
return (dot(planeNormal, point) + planeDistance);
|
|
}
|
|
`;var yO=`/**
|
|
* Computes the point along a ray at the given time. <code>time</code> can be positive, negative, or zero.
|
|
*
|
|
* @name czm_pointAlongRay
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} ray The ray to compute the point along.
|
|
* @param {float} time The time along the ray.
|
|
*
|
|
* @returns {vec3} The point along the ray at the given time.
|
|
*
|
|
* @example
|
|
* czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction
|
|
* vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0)
|
|
*/
|
|
vec3 czm_pointAlongRay(czm_ray ray, float time)
|
|
{
|
|
return ray.origin + (time * ray.direction);
|
|
}
|
|
`;var CO=`/**
|
|
* DOC_TBA
|
|
*
|
|
* @name czm_rayEllipsoidIntersectionInterval
|
|
* @glslFunction
|
|
*/
|
|
czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
|
|
{
|
|
// ray and ellipsoid center in eye coordinates. radii in model coordinates.
|
|
vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
|
|
vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;
|
|
|
|
q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;
|
|
|
|
float q2 = dot(q, q);
|
|
float qw = dot(q, w);
|
|
|
|
if (q2 > 1.0) // Outside ellipsoid.
|
|
{
|
|
if (qw >= 0.0) // Looking outward or tangent (0 intersections).
|
|
{
|
|
return czm_emptyRaySegment;
|
|
}
|
|
else // qw < 0.0.
|
|
{
|
|
float qw2 = qw * qw;
|
|
float difference = q2 - 1.0; // Positively valued.
|
|
float w2 = dot(w, w);
|
|
float product = w2 * difference;
|
|
|
|
if (qw2 < product) // Imaginary roots (0 intersections).
|
|
{
|
|
return czm_emptyRaySegment;
|
|
}
|
|
else if (qw2 > product) // Distinct roots (2 intersections).
|
|
{
|
|
float discriminant = qw * qw - product;
|
|
float temp = -qw + sqrt(discriminant); // Avoid cancellation.
|
|
float root0 = temp / w2;
|
|
float root1 = difference / temp;
|
|
if (root0 < root1)
|
|
{
|
|
czm_raySegment i = czm_raySegment(root0, root1);
|
|
return i;
|
|
}
|
|
else
|
|
{
|
|
czm_raySegment i = czm_raySegment(root1, root0);
|
|
return i;
|
|
}
|
|
}
|
|
else // qw2 == product. Repeated roots (2 intersections).
|
|
{
|
|
float root = sqrt(difference / w2);
|
|
czm_raySegment i = czm_raySegment(root, root);
|
|
return i;
|
|
}
|
|
}
|
|
}
|
|
else if (q2 < 1.0) // Inside ellipsoid (2 intersections).
|
|
{
|
|
float difference = q2 - 1.0; // Negatively valued.
|
|
float w2 = dot(w, w);
|
|
float product = w2 * difference; // Negatively valued.
|
|
float discriminant = qw * qw - product;
|
|
float temp = -qw + sqrt(discriminant); // Positively valued.
|
|
czm_raySegment i = czm_raySegment(0.0, temp / w2);
|
|
return i;
|
|
}
|
|
else // q2 == 1.0. On ellipsoid.
|
|
{
|
|
if (qw < 0.0) // Looking inward.
|
|
{
|
|
float w2 = dot(w, w);
|
|
czm_raySegment i = czm_raySegment(0.0, -qw / w2);
|
|
return i;
|
|
}
|
|
else // qw >= 0.0. Looking outward or tangent.
|
|
{
|
|
return czm_emptyRaySegment;
|
|
}
|
|
}
|
|
}
|
|
`;var EO=`/**
|
|
* Compute the intersection interval of a ray with a sphere.
|
|
*
|
|
* @name czm_raySphereIntersectionInterval
|
|
* @glslFunction
|
|
*
|
|
* @param {czm_ray} ray The ray.
|
|
* @param {vec3} center The center of the sphere.
|
|
* @param {float} radius The radius of the sphere.
|
|
* @return {czm_raySegment} The intersection interval of the ray with the sphere.
|
|
*/
|
|
czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
|
|
{
|
|
vec3 o = ray.origin;
|
|
vec3 d = ray.direction;
|
|
|
|
vec3 oc = o - center;
|
|
|
|
float a = dot(d, d);
|
|
float b = 2.0 * dot(d, oc);
|
|
float c = dot(oc, oc) - (radius * radius);
|
|
|
|
float det = (b * b) - (4.0 * a * c);
|
|
|
|
if (det < 0.0) {
|
|
return czm_emptyRaySegment;
|
|
}
|
|
|
|
float sqrtDet = sqrt(det);
|
|
|
|
float t0 = (-b - sqrtDet) / (2.0 * a);
|
|
float t1 = (-b + sqrtDet) / (2.0 * a);
|
|
|
|
czm_raySegment result = czm_raySegment(t0, t1);
|
|
return result;
|
|
}
|
|
`;var IO=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
|
|
{
|
|
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
|
|
}
|
|
`;var bO=`/**
|
|
* Reads a value previously transformed with {@link czm_writeNonPerspective}
|
|
* by dividing it by \`w\`, the value used in the perspective divide.
|
|
* This function is intended to be called in a fragment shader to access a
|
|
* \`varying\` that should not be subject to perspective interpolation.
|
|
* For example, screen-space texture coordinates. The value should have been
|
|
* previously written in the vertex shader with a call to
|
|
* {@link czm_writeNonPerspective}.
|
|
*
|
|
* @name czm_readNonPerspective
|
|
* @glslFunction
|
|
*
|
|
* @param {float|vec2|vec3|vec4} value The non-perspective value to be read.
|
|
* @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`.
|
|
* @returns {float|vec2|vec3|vec4} The usable value.
|
|
*/
|
|
float czm_readNonPerspective(float value, float oneOverW) {
|
|
return value * oneOverW;
|
|
}
|
|
|
|
vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
|
|
return value * oneOverW;
|
|
}
|
|
|
|
vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
|
|
return value * oneOverW;
|
|
}
|
|
|
|
vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
|
|
return value * oneOverW;
|
|
}
|
|
`;var xO=`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 TO=`/**
|
|
* Converts an RGB color to HSB (hue, saturation, brightness)
|
|
* HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl}
|
|
*
|
|
* @name czm_RGBToHSB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in RGB.
|
|
*
|
|
* @returns {vec3} The color in HSB.
|
|
*
|
|
* @example
|
|
* vec3 hsb = czm_RGBToHSB(rgb);
|
|
* hsb.z *= 0.1;
|
|
* rgb = czm_HSBToRGB(hsb);
|
|
*/
|
|
|
|
const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
|
|
|
vec3 czm_RGBToHSB(vec3 rgb)
|
|
{
|
|
vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
|
|
vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));
|
|
|
|
float d = q.x - min(q.w, q.y);
|
|
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
|
|
}
|
|
`;var SO=`/**
|
|
* Converts an RGB color to HSL (hue, saturation, lightness)
|
|
* HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html}
|
|
*
|
|
* @name czm_RGBToHSL
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in RGB.
|
|
*
|
|
* @returns {vec3} The color in HSL.
|
|
*
|
|
* @example
|
|
* vec3 hsl = czm_RGBToHSL(rgb);
|
|
* hsl.z *= 0.1;
|
|
* rgb = czm_HSLToRGB(hsl);
|
|
*/
|
|
|
|
vec3 RGBtoHCV(vec3 rgb)
|
|
{
|
|
// Based on work by Sam Hocevar and Emil Persson
|
|
vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
|
|
vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
|
|
float c = q.x - min(q.w, q.y);
|
|
float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
|
|
return vec3(h, c, q.x);
|
|
}
|
|
|
|
vec3 czm_RGBToHSL(vec3 rgb)
|
|
{
|
|
vec3 hcv = RGBtoHCV(rgb);
|
|
float l = hcv.z - hcv.y * 0.5;
|
|
float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
|
|
return vec3(hcv.x, s, l);
|
|
}
|
|
`;var wO=`/**
|
|
* Converts an RGB color to CIE Yxy.
|
|
* <p>The conversion is described in
|
|
* {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
|
|
* </p>
|
|
*
|
|
* @name czm_RGBToXYZ
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color in RGB.
|
|
*
|
|
* @returns {vec3} The color in CIE Yxy.
|
|
*
|
|
* @example
|
|
* vec3 xyz = czm_RGBToXYZ(rgb);
|
|
* xyz.x = max(xyz.x - luminanceThreshold, 0.0);
|
|
* rgb = czm_XYZToRGB(xyz);
|
|
*/
|
|
vec3 czm_RGBToXYZ(vec3 rgb)
|
|
{
|
|
const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
|
|
0.3576, 0.7152, 0.1192,
|
|
0.1805, 0.0722, 0.9505);
|
|
vec3 xyz = RGB2XYZ * rgb;
|
|
vec3 Yxy;
|
|
Yxy.r = xyz.g;
|
|
float temp = dot(vec3(1.0), xyz);
|
|
Yxy.gb = xyz.rg / temp;
|
|
return Yxy;
|
|
}
|
|
`;var BO=`/**
|
|
* Round a floating point value. This function exists because round() doesn't
|
|
* exist in GLSL 1.00.
|
|
*
|
|
* @param {float|vec2|vec3|vec4} value The value to round
|
|
* @param {float|vec2|vec3|vec3} The rounded value. The type matches the input.
|
|
*/
|
|
float czm_round(float value) {
|
|
return floor(value + 0.5);
|
|
}
|
|
|
|
vec2 czm_round(vec2 value) {
|
|
return floor(value + 0.5);
|
|
}
|
|
|
|
vec3 czm_round(vec3 value) {
|
|
return floor(value + 0.5);
|
|
}
|
|
|
|
vec4 czm_round(vec4 value) {
|
|
return floor(value + 0.5);
|
|
}
|
|
`;var DO=`/**
|
|
* Adjusts the saturation of a color.
|
|
*
|
|
* @name czm_saturation
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} rgb The color.
|
|
* @param {float} adjustment The amount to adjust the saturation of the color.
|
|
*
|
|
* @returns {float} The color with the saturation adjusted.
|
|
*
|
|
* @example
|
|
* vec3 greyScale = czm_saturation(color, 0.0);
|
|
* vec3 doubleSaturation = czm_saturation(color, 2.0);
|
|
*/
|
|
vec3 czm_saturation(vec3 rgb, float adjustment)
|
|
{
|
|
// Algorithm from Chapter 16 of OpenGL Shading Language
|
|
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
|
|
vec3 intensity = vec3(dot(rgb, W));
|
|
return mix(intensity, rgb, adjustment);
|
|
}
|
|
`;var vO=`
|
|
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 PO=`
|
|
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 RO=`/**
|
|
* Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL
|
|
* built-in function <code>sign</code> except that returns 1.0 instead of 0.0 when the input value is 0.0.
|
|
*
|
|
* @name czm_signNotZero
|
|
* @glslFunction
|
|
*
|
|
* @param {} value The value for which to determine the sign.
|
|
* @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative.
|
|
*/
|
|
float czm_signNotZero(float value)
|
|
{
|
|
return value >= 0.0 ? 1.0 : -1.0;
|
|
}
|
|
|
|
vec2 czm_signNotZero(vec2 value)
|
|
{
|
|
return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
|
|
}
|
|
|
|
vec3 czm_signNotZero(vec3 value)
|
|
{
|
|
return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
|
|
}
|
|
|
|
vec4 czm_signNotZero(vec4 value)
|
|
{
|
|
return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
|
|
}
|
|
`;var MO=`/**
|
|
* Computes a color from the third order spherical harmonic coefficients and a normalized direction vector.
|
|
* <p>
|
|
* The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22].
|
|
* </p>
|
|
*
|
|
* @name czm_sphericalHarmonics
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} normal The normalized direction.
|
|
* @param {vec3[9]} coefficients The third order spherical harmonic coefficients.
|
|
* @returns {vec3} The color at the direction.
|
|
*
|
|
* @see https://graphics.stanford.edu/papers/envmap/envmap.pdf
|
|
*/
|
|
vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
|
|
{
|
|
vec3 L00 = coefficients[0];
|
|
vec3 L1_1 = coefficients[1];
|
|
vec3 L10 = coefficients[2];
|
|
vec3 L11 = coefficients[3];
|
|
vec3 L2_2 = coefficients[4];
|
|
vec3 L2_1 = coefficients[5];
|
|
vec3 L20 = coefficients[6];
|
|
vec3 L21 = coefficients[7];
|
|
vec3 L22 = coefficients[8];
|
|
|
|
float x = normal.x;
|
|
float y = normal.y;
|
|
float z = normal.z;
|
|
|
|
vec3 L =
|
|
L00
|
|
+ L1_1 * y
|
|
+ L10 * z
|
|
+ L11 * x
|
|
+ L2_2 * (y * x)
|
|
+ L2_1 * (y * z)
|
|
+ L20 * (3.0 * z * z - 1.0)
|
|
+ L21 * (z * x)
|
|
+ L22 * (x * x - y * y);
|
|
|
|
return max(L, vec3(0.0));
|
|
}
|
|
`;var NO=`/**
|
|
* Converts an sRGB color to a linear RGB color.
|
|
*
|
|
* @param {vec3|vec4} srgbIn The color in sRGB space
|
|
* @returns {vec3|vec4} The color in linear color space. The vector type matches the input.
|
|
*/
|
|
vec3 czm_srgbToLinear(vec3 srgbIn)
|
|
{
|
|
return pow(srgbIn, vec3(2.2));
|
|
}
|
|
|
|
vec4 czm_srgbToLinear(vec4 srgbIn)
|
|
{
|
|
vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
|
|
return vec4(linearOut, srgbIn.a);
|
|
}
|
|
`;var LO=`/**
|
|
* Creates a matrix that transforms vectors from tangent space to eye space.
|
|
*
|
|
* @name czm_tangentToEyeSpaceMatrix
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} normalEC The normal vector in eye coordinates.
|
|
* @param {vec3} tangentEC The tangent vector in eye coordinates.
|
|
* @param {vec3} bitangentEC The bitangent vector in eye coordinates.
|
|
*
|
|
* @returns {mat3} The matrix that transforms from tangent space to eye space.
|
|
*
|
|
* @example
|
|
* mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC);
|
|
* vec3 normal = tangentToEye * texture(normalMap, st).xyz;
|
|
*/
|
|
mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
|
|
{
|
|
vec3 normal = normalize(normalEC);
|
|
vec3 tangent = normalize(tangentEC);
|
|
vec3 bitangent = normalize(bitangentEC);
|
|
return mat3(tangent.x , tangent.y , tangent.z,
|
|
bitangent.x, bitangent.y, bitangent.z,
|
|
normal.x , normal.y , normal.z);
|
|
}
|
|
`;var OO=`/**
|
|
* A wrapper around the texture (WebGL2) / textureCube (WebGL1)
|
|
* function to allow for WebGL 1 support.
|
|
*
|
|
* @name czm_textureCube
|
|
* @glslFunction
|
|
*
|
|
* @param {samplerCube} sampler The sampler.
|
|
* @param {vec3} p The coordinate at which to sample the texture.
|
|
*/
|
|
vec4 czm_textureCube(samplerCube sampler, vec3 p) {
|
|
#if __VERSION__ == 300
|
|
return texture(sampler, p);
|
|
#else
|
|
return textureCube(sampler, p);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* A wrapper around the textureLod (WebGL2) / textureCube (WebGL1)
|
|
* function to allow for WebGL 1 support in fragment shaders.
|
|
*
|
|
* @name czm_textureCubeLod
|
|
* @glslFunction
|
|
*
|
|
* @param {samplerCube} sampler The sampler.
|
|
* @param {vec3} p The coordinate at which to sample the texture.
|
|
* @param {float} lod The mipmap level from which to sample.
|
|
*/
|
|
vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
|
|
#if __VERSION__ == 300
|
|
return textureLod(sampler, p, lod);
|
|
#elif defined(GL_EXT_shader_texture_lod)
|
|
return textureCubeLodEXT(sampler, p, lod);
|
|
#endif
|
|
}`;var FO=`/**
|
|
* Transforms a plane.
|
|
*
|
|
* @name czm_transformPlane
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} plane The plane in Hessian Normal Form.
|
|
* @param {mat4} transform The inverse-transpose of a transformation matrix.
|
|
*/
|
|
vec4 czm_transformPlane(vec4 plane, mat4 transform) {
|
|
vec4 transformedPlane = transform * plane;
|
|
// Convert the transformed plane to Hessian Normal Form
|
|
float normalMagnitude = length(transformedPlane.xyz);
|
|
return transformedPlane / normalMagnitude;
|
|
}
|
|
`;var QO=`/**
|
|
* Translates a position (or any <code>vec3</code>) that was encoded with {@link EncodedCartesian3},
|
|
* and then provided to the shader as separate <code>high</code> and <code>low</code> bits to
|
|
* be relative to the eye. As shown in the example, the position can then be transformed in eye
|
|
* or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye},
|
|
* respectively.
|
|
* <p>
|
|
* This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as
|
|
* described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}.
|
|
* </p>
|
|
*
|
|
* @name czm_translateRelativeToEye
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} high The position's high bits.
|
|
* @param {vec3} low The position's low bits.
|
|
* @returns {vec3} The position translated to be relative to the camera's position.
|
|
*
|
|
* @example
|
|
* in vec3 positionHigh;
|
|
* in vec3 positionLow;
|
|
*
|
|
* void main()
|
|
* {
|
|
* vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
* gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
* }
|
|
*
|
|
* @see czm_modelViewRelativeToEye
|
|
* @see czm_modelViewProjectionRelativeToEye
|
|
* @see czm_computePosition
|
|
* @see EncodedCartesian3
|
|
*/
|
|
vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
|
|
{
|
|
vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
|
|
// This check handles the case when NaN values have gotten into \`highDifference\`.
|
|
// Such a thing could happen on devices running iOS.
|
|
if (length(highDifference) == 0.0) {
|
|
highDifference = vec3(0);
|
|
}
|
|
vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
|
|
|
|
return vec4(highDifference + lowDifference, 1.0);
|
|
}
|
|
`;var kO=`/**
|
|
* @private
|
|
*/
|
|
vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
|
|
{
|
|
// Diffuse from directional light sources at eye (for top-down and horizon views)
|
|
float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
|
|
|
|
if (czm_sceneMode == czm_sceneMode3D) {
|
|
// (and horizon views in 3D)
|
|
diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
|
|
}
|
|
|
|
diffuse = clamp(diffuse, 0.0, 1.0);
|
|
|
|
float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);
|
|
|
|
// Temporary workaround for adding ambient.
|
|
vec3 materialDiffuse = material.diffuse * 0.5;
|
|
|
|
vec3 ambient = materialDiffuse;
|
|
vec3 color = ambient + material.emission;
|
|
color += materialDiffuse * diffuse * czm_lightColor;
|
|
color += material.specular * specular * czm_lightColor;
|
|
|
|
return vec4(color, material.alpha);
|
|
}
|
|
`;var UO=`/**
|
|
* Returns the transpose of the matrix. The input <code>matrix</code> can be
|
|
* a <code>mat2</code>, <code>mat3</code>, or <code>mat4</code>.
|
|
*
|
|
* @name czm_transpose
|
|
* @glslFunction
|
|
*
|
|
* @param {} matrix The matrix to transpose.
|
|
*
|
|
* @returns {} The transposed matrix.
|
|
*
|
|
* @example
|
|
* // GLSL declarations
|
|
* mat2 czm_transpose(mat2 matrix);
|
|
* mat3 czm_transpose(mat3 matrix);
|
|
* mat4 czm_transpose(mat4 matrix);
|
|
*
|
|
* // Transpose a 3x3 rotation matrix to find its inverse.
|
|
* mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates(
|
|
* positionMC, normalEC);
|
|
* mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye);
|
|
*/
|
|
mat2 czm_transpose(mat2 matrix)
|
|
{
|
|
return mat2(
|
|
matrix[0][0], matrix[1][0],
|
|
matrix[0][1], matrix[1][1]);
|
|
}
|
|
|
|
mat3 czm_transpose(mat3 matrix)
|
|
{
|
|
return mat3(
|
|
matrix[0][0], matrix[1][0], matrix[2][0],
|
|
matrix[0][1], matrix[1][1], matrix[2][1],
|
|
matrix[0][2], matrix[1][2], matrix[2][2]);
|
|
}
|
|
|
|
mat4 czm_transpose(mat4 matrix)
|
|
{
|
|
return mat4(
|
|
matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
|
|
matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
|
|
matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
|
|
matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
|
|
}
|
|
`;var zO=`vec2 getLookupUv(vec2 dimensions, int i) {
|
|
int pixY = i / int(dimensions.x);
|
|
int pixX = i - (pixY * int(dimensions.x));
|
|
float pixelWidth = 1.0 / dimensions.x;
|
|
float pixelHeight = 1.0 / dimensions.y;
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
return vec2(u, v);
|
|
}
|
|
|
|
vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
|
|
vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
|
|
return texture(extentsTexture, getLookupUv(textureDimensions, index));
|
|
}`;var GO=`/**
|
|
* Unpacks a vec4 depth value to a float in [0, 1) range.
|
|
*
|
|
* @name czm_unpackDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} packedDepth The packed depth.
|
|
*
|
|
* @returns {float} The floating-point depth in [0, 1) range.
|
|
*/
|
|
float czm_unpackDepth(vec4 packedDepth)
|
|
{
|
|
// See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA
|
|
// http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/
|
|
return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
|
|
}
|
|
`;var VO=`/**
|
|
* Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4.
|
|
*
|
|
* @name czm_unpackFloat
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} packedFloat The packed float.
|
|
*
|
|
* @returns {float} The floating-point depth in arbitrary range.
|
|
*/
|
|
float czm_unpackFloat(vec4 packedFloat)
|
|
{
|
|
// Convert to [0.0, 255.0] and round to integer
|
|
packedFloat = floor(packedFloat * 255.0 + 0.5);
|
|
float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
|
|
float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;
|
|
if (exponent == -127.0)
|
|
{
|
|
return 0.0;
|
|
}
|
|
float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
|
|
float result = sign * exp2(exponent - 23.0) * mantissa;
|
|
return result;
|
|
}
|
|
`;var HO=`/**
|
|
* Useful for reinterpreting texture data as higher-precision values.
|
|
* Only works correctly in WebGL 2, which supports the uint type and bitwise operations.
|
|
*
|
|
* @param {float|vec2|vec3|vec4} 1-4 values from a texture lookup (RGBA channels), normalized to [0.0, 1.0].
|
|
* @return {uint} Raw bits as an unsigned integer.
|
|
*/
|
|
uint czm_unpackTexture(float packedValue) {
|
|
float rounded = czm_round(packedValue * 255.0);
|
|
return uint(rounded);
|
|
}
|
|
|
|
uint czm_unpackTexture(vec2 packedValue) {
|
|
vec2 rounded = czm_round(packedValue * 255.0);
|
|
uint byte0 = uint(rounded.x);
|
|
uint byte1 = uint(rounded.y);
|
|
return byte0 | (byte1 << 8);
|
|
}
|
|
|
|
uint czm_unpackTexture(vec3 packedValue) {
|
|
vec3 rounded = czm_round(packedValue * 255.0);
|
|
uint byte0 = uint(rounded.x);
|
|
uint byte1 = uint(rounded.y);
|
|
uint byte2 = uint(rounded.z);
|
|
return byte0 | (byte1 << 8) | (byte2 << 16);
|
|
}
|
|
|
|
uint czm_unpackTexture(vec4 packedValue) {
|
|
vec4 rounded = czm_round(packedValue * 255.0);
|
|
uint byte0 = uint(rounded.x);
|
|
uint byte1 = uint(rounded.y);
|
|
uint byte2 = uint(rounded.z);
|
|
uint byte3 = uint(rounded.w);
|
|
return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24);
|
|
}
|
|
`;var WO=`/**
|
|
* Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type,
|
|
* so the return value is an int.
|
|
* <p>
|
|
* There are also precision limitations in WebGL 1. highp int is still limited
|
|
* to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur.
|
|
* </p>
|
|
*
|
|
* @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order.
|
|
*
|
|
* @return {int} The unpacked value.
|
|
*/
|
|
int czm_unpackUint(float packedValue) {
|
|
float rounded = czm_round(packedValue * 255.0);
|
|
return int(rounded);
|
|
}
|
|
|
|
int czm_unpackUint(vec2 packedValue) {
|
|
vec2 rounded = czm_round(packedValue * 255.0);
|
|
return int(dot(rounded, vec2(1.0, 256.0)));
|
|
}
|
|
|
|
int czm_unpackUint(vec3 packedValue) {
|
|
vec3 rounded = czm_round(packedValue * 255.0);
|
|
return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
|
|
}
|
|
|
|
int czm_unpackUint(vec4 packedValue) {
|
|
vec4 rounded = czm_round(packedValue * 255.0);
|
|
return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
|
|
}
|
|
`;var jO=`/**
|
|
* Transform metadata values following the EXT_structural_metadata spec
|
|
* by multiplying by scale and adding the offset. Operations are always
|
|
* performed component-wise, even for matrices.
|
|
*
|
|
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add
|
|
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply
|
|
* @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value.
|
|
*
|
|
* @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input.
|
|
*/
|
|
float czm_valueTransform(float offset, float scale, float value) {
|
|
return scale * value + offset;
|
|
}
|
|
|
|
vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
|
|
return scale * value + offset;
|
|
}
|
|
|
|
vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
|
|
return scale * value + offset;
|
|
}
|
|
|
|
vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
|
|
return scale * value + offset;
|
|
}
|
|
|
|
mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
|
|
return matrixCompMult(scale, value) + offset;
|
|
}
|
|
|
|
mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
|
|
return matrixCompMult(scale, value) + offset;
|
|
}
|
|
|
|
mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
|
|
return matrixCompMult(scale, value) + offset;
|
|
}
|
|
`;var YO=`#ifdef LOG_DEPTH
|
|
// 1.0 at the near plane, increasing linearly from there.
|
|
out float v_depthFromNearPlusOne;
|
|
#ifdef SHADOW_MAP
|
|
out vec3 v_logPositionEC;
|
|
#endif
|
|
#endif
|
|
|
|
vec4 czm_updatePositionDepth(vec4 coords) {
|
|
#if defined(LOG_DEPTH)
|
|
|
|
#ifdef SHADOW_MAP
|
|
vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
|
|
v_logPositionEC = logPositionEC;
|
|
#endif
|
|
|
|
// With the very high far/near ratios used with the logarithmic depth
|
|
// buffer, floating point rounding errors can cause linear depth values
|
|
// to end up on the wrong side of the far plane, even for vertices that
|
|
// are really nowhere near it. Since we always write a correct logarithmic
|
|
// depth value in the fragment shader anyway, we just need to make sure
|
|
// such errors don't cause the primitive to be clipped entirely before
|
|
// we even get to the fragment shader.
|
|
coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
|
|
#endif
|
|
|
|
return coords;
|
|
}
|
|
|
|
/**
|
|
* Writes the logarithmic depth to gl_Position using the already computed gl_Position.
|
|
*
|
|
* @name czm_vertexLogDepth
|
|
* @glslFunction
|
|
*/
|
|
void czm_vertexLogDepth()
|
|
{
|
|
#ifdef LOG_DEPTH
|
|
v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
|
|
gl_Position = czm_updatePositionDepth(gl_Position);
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* Writes the logarithmic depth to gl_Position using the provided clip coordinates.
|
|
* <p>
|
|
* An example use case for this function would be moving the vertex in window coordinates
|
|
* before converting back to clip coordinates. Use the original vertex clip coordinates.
|
|
* </p>
|
|
* @name czm_vertexLogDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} clipCoords The vertex in clip coordinates.
|
|
*
|
|
* @example
|
|
* czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0));
|
|
*/
|
|
void czm_vertexLogDepth(vec4 clipCoords)
|
|
{
|
|
#ifdef LOG_DEPTH
|
|
v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
|
|
czm_updatePositionDepth(clipCoords);
|
|
#endif
|
|
}
|
|
`;var qO=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
|
|
{
|
|
// Reconstruct NDC coordinates
|
|
float x = 2.0 * screenCoordinate.x - 1.0;
|
|
float y = 2.0 * screenCoordinate.y - 1.0;
|
|
float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
|
|
vec4 q = vec4(x, y, z, 1.0);
|
|
|
|
// Reverse the perspective division to obtain clip coordinates.
|
|
q /= screenCoordinate.w;
|
|
|
|
// Reverse the projection transformation to obtain eye coordinates.
|
|
if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s
|
|
{
|
|
q = czm_inverseProjection * q;
|
|
}
|
|
else
|
|
{
|
|
float top = czm_frustumPlanes.x;
|
|
float bottom = czm_frustumPlanes.y;
|
|
float left = czm_frustumPlanes.z;
|
|
float right = czm_frustumPlanes.w;
|
|
|
|
float near = czm_currentFrustum.x;
|
|
float far = czm_currentFrustum.y;
|
|
|
|
q.x = (q.x * (right - left) + left + right) * 0.5;
|
|
q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
|
|
q.z = (q.z * (near - far) - near - far) * 0.5;
|
|
q.w = 1.0;
|
|
}
|
|
|
|
return q;
|
|
}
|
|
|
|
/**
|
|
* Transforms a position from window to eye coordinates.
|
|
* The transform from window to normalized device coordinates is done using components
|
|
* of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating
|
|
* the inverse of <code>czm_viewportTransformation</code>. The transformation from
|
|
* normalized device coordinates to clip coordinates is done using <code>fragmentCoordinate.w</code>,
|
|
* which is expected to be the scalar used in the perspective divide. The transformation
|
|
* from clip to eye coordinates is done using {@link czm_inverseProjection}.
|
|
*
|
|
* @name czm_windowToEyeCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec4} fragmentCoordinate The position in window coordinates to transform.
|
|
*
|
|
* @returns {vec4} The transformed position in eye coordinates.
|
|
*
|
|
* @see czm_modelToWindowCoordinates
|
|
* @see czm_eyeToWindowCoordinates
|
|
* @see czm_inverseProjection
|
|
* @see czm_viewport
|
|
* @see czm_viewportTransformation
|
|
*
|
|
* @example
|
|
* vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
*/
|
|
vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
|
|
{
|
|
vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
|
|
return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
|
|
}
|
|
|
|
vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
|
|
{
|
|
// See reverseLogDepth.glsl. This is separate to re-use the pow.
|
|
#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
|
|
float near = czm_currentFrustum.x;
|
|
float far = czm_currentFrustum.y;
|
|
float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
|
|
float depthFromNear = exp2(log2Depth) - 1.0;
|
|
float depthFromCamera = depthFromNear + near;
|
|
vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
|
|
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
|
|
eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision
|
|
#else
|
|
vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
|
|
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
|
|
#endif
|
|
return eyeCoordinate;
|
|
}
|
|
|
|
/**
|
|
* Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates.
|
|
* This function produces more accurate results for window positions with log depth than
|
|
* conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version
|
|
* of czm_windowToEyeCoordinates.
|
|
*
|
|
* @name czm_windowToEyeCoordinates
|
|
* @glslFunction
|
|
*
|
|
* @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform.
|
|
* @param {float} depthOrLogDepth A depth or log depth for the fragment.
|
|
*
|
|
* @see czm_modelToWindowCoordinates
|
|
* @see czm_eyeToWindowCoordinates
|
|
* @see czm_inverseProjection
|
|
* @see czm_viewport
|
|
* @see czm_viewportTransformation
|
|
*
|
|
* @returns {vec4} The transformed position in eye coordinates.
|
|
*/
|
|
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
|
|
{
|
|
vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
|
|
return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
|
|
}
|
|
`;var KO=`// emulated noperspective
|
|
#if !defined(LOG_DEPTH)
|
|
in float v_WindowZ;
|
|
#endif
|
|
|
|
/**
|
|
* Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane
|
|
* by writing the fragment's depth. See czm_depthClamp for more details.
|
|
*
|
|
* @name czm_writeDepthClamp
|
|
* @glslFunction
|
|
*
|
|
* @example
|
|
* out_FragColor = color;
|
|
* czm_writeDepthClamp();
|
|
*
|
|
* @see czm_depthClamp
|
|
*/
|
|
void czm_writeDepthClamp()
|
|
{
|
|
#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
|
|
gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
|
|
#endif
|
|
}
|
|
`;var XO=`#ifdef LOG_DEPTH
|
|
in float v_depthFromNearPlusOne;
|
|
|
|
#ifdef POLYGON_OFFSET
|
|
uniform vec2 u_polygonOffset;
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/**
|
|
* Writes the fragment depth to the logarithmic depth buffer.
|
|
* <p>
|
|
* Use this when the vertex shader does not call {@link czm_vertexLogDepth}, for example, when
|
|
* ray-casting geometry using a full screen quad.
|
|
* </p>
|
|
* @name czm_writeLogDepth
|
|
* @glslFunction
|
|
*
|
|
* @param {float} depth The depth coordinate, where 1.0 is on the near plane and
|
|
* depth increases in eye-space units from there
|
|
*
|
|
* @example
|
|
* czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0);
|
|
*/
|
|
void czm_writeLogDepth(float depth)
|
|
{
|
|
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
|
|
// Discard the vertex if it's not between the near and far planes.
|
|
// We allow a bit of epsilon on the near plane comparison because a 1.0
|
|
// from the vertex shader (indicating the vertex should be _on_ the near
|
|
// plane) will not necessarily come here as exactly 1.0.
|
|
if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
|
|
discard;
|
|
}
|
|
|
|
#ifdef POLYGON_OFFSET
|
|
// Polygon offset: m * factor + r * units
|
|
float factor = u_polygonOffset[0];
|
|
float units = u_polygonOffset[1];
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
// This factor doesn't work in IE 10
|
|
if (factor != 0.0) {
|
|
// m = sqrt(dZdX^2 + dZdY^2);
|
|
float x = dFdx(depth);
|
|
float y = dFdy(depth);
|
|
float m = sqrt(x * x + y * y);
|
|
|
|
// Apply the factor before computing the log depth.
|
|
depth += m * factor;
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
|
|
|
|
#ifdef POLYGON_OFFSET
|
|
// Apply the units after the log depth.
|
|
gl_FragDepth += czm_epsilon7 * units;
|
|
#endif
|
|
|
|
#endif
|
|
}
|
|
|
|
/**
|
|
* Writes the fragment depth to the logarithmic depth buffer.
|
|
* <p>
|
|
* Use this when the vertex shader calls {@link czm_vertexLogDepth}.
|
|
* </p>
|
|
*
|
|
* @name czm_writeLogDepth
|
|
* @glslFunction
|
|
*/
|
|
void czm_writeLogDepth() {
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth(v_depthFromNearPlusOne);
|
|
#endif
|
|
}
|
|
`;var JO=`/**
|
|
* Transforms a value for non-perspective interpolation by multiplying
|
|
* it by w, the value used in the perspective divide. This function is
|
|
* intended to be called in a vertex shader to compute the value of a
|
|
* \`varying\` that should not be subject to perspective interpolation.
|
|
* For example, screen-space texture coordinates. The fragment shader
|
|
* must call {@link czm_readNonPerspective} to retrieve the final
|
|
* non-perspective value.
|
|
*
|
|
* @name czm_writeNonPerspective
|
|
* @glslFunction
|
|
*
|
|
* @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective.
|
|
* @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`.
|
|
* @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the
|
|
* fragment shader with {@link czm_readNonPerspective}.
|
|
*/
|
|
float czm_writeNonPerspective(float value, float w) {
|
|
return value * w;
|
|
}
|
|
|
|
vec2 czm_writeNonPerspective(vec2 value, float w) {
|
|
return value * w;
|
|
}
|
|
|
|
vec3 czm_writeNonPerspective(vec3 value, float w) {
|
|
return value * w;
|
|
}
|
|
|
|
vec4 czm_writeNonPerspective(vec4 value, float w) {
|
|
return value * w;
|
|
}
|
|
`;var ZO=`/**
|
|
* Converts a CIE Yxy color to RGB.
|
|
* <p>The conversion is described in
|
|
* {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform}
|
|
* </p>
|
|
*
|
|
* @name czm_XYZToRGB
|
|
* @glslFunction
|
|
*
|
|
* @param {vec3} Yxy The color in CIE Yxy.
|
|
*
|
|
* @returns {vec3} The color in RGB.
|
|
*
|
|
* @example
|
|
* vec3 xyz = czm_RGBToXYZ(rgb);
|
|
* xyz.x = max(xyz.x - luminanceThreshold, 0.0);
|
|
* rgb = czm_XYZToRGB(xyz);
|
|
*/
|
|
vec3 czm_XYZToRGB(vec3 Yxy)
|
|
{
|
|
const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,
|
|
-1.5371, 1.8760, -0.2040,
|
|
-0.4985, 0.0416, 1.0572);
|
|
vec3 xyz;
|
|
xyz.r = Yxy.r * Yxy.g / Yxy.b;
|
|
xyz.g = Yxy.r;
|
|
xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
|
|
|
|
return XYZ2RGB * xyz;
|
|
}
|
|
`;var HI={czm_degreesPerRadian:CN,czm_depthRange:EN,czm_epsilon1:IN,czm_epsilon2:bN,czm_epsilon3:xN,czm_epsilon4:TN,czm_epsilon5:SN,czm_epsilon6:wN,czm_epsilon7:BN,czm_infinity:DN,czm_oneOverPi:vN,czm_oneOverTwoPi:PN,czm_passCesium3DTile:RN,czm_passCesium3DTileClassification:MN,czm_passCesium3DTileClassificationIgnoreShow:NN,czm_passCesium3DTileEdges:LN,czm_passClassification:ON,czm_passCompute:FN,czm_passEnvironment:QN,czm_passGaussianSplats:kN,czm_passGlobe:UN,czm_passOpaque:zN,czm_passOverlay:GN,czm_passTerrainClassification:VN,czm_passTranslucent:HN,czm_passVoxels:WN,czm_pi:jN,czm_piOverFour:YN,czm_piOverSix:qN,czm_piOverThree:KN,czm_piOverTwo:XN,czm_radiansPerDegree:JN,czm_sceneMode2D:ZN,czm_sceneMode3D:$N,czm_sceneModeColumbusView:eL,czm_sceneModeMorphing:tL,czm_solarRadius:nL,czm_threePiOver2:iL,czm_twoPi:oL,czm_webMercatorMaxLatitude:rL,czm_depthRangeStruct:aL,czm_material:sL,czm_materialInput:cL,czm_modelMaterial:lL,czm_modelVertexOutput:uL,czm_ray:fL,czm_raySegment:dL,czm_shadowParameters:hL,czm_acesTonemapping:mL,czm_alphaWeight:pL,czm_antialias:AL,czm_applyHSBShift:gL,czm_approximateSphericalCoordinates:_L,czm_approximateTanh:yL,czm_backFacing:CL,czm_branchFreeTernary:EL,czm_cascadeColor:IL,czm_cascadeDistance:bL,czm_cascadeMatrix:xL,czm_cascadeWeights:TL,czm_clipPolygons:SL,czm_columbusViewMorph:wL,czm_computeAtmosphereColor:BL,czm_computeGroundAtmosphereScattering:DL,czm_computePosition:vL,czm_computeScattering:PL,czm_computeTextureTransform:RL,czm_cosineAndSine:ML,czm_decodeRGB8:NL,czm_decompressTextureCoordinates:LL,czm_depthClamp:OL,czm_eastNorthUpToEyeCoordinates:FL,czm_ellipsoidContainsPoint:QL,czm_ellipsoidTextureCoordinates:kL,czm_equalsEpsilon:UL,czm_eyeOffset:zL,czm_eyeToWindowCoordinates:GL,czm_fastApproximateAtan:VL,czm_fog:HL,czm_gammaCorrect:WL,czm_geodeticSurfaceNormal:jL,czm_getDefaultMaterial:YL,czm_getDynamicAtmosphereLightDirection:qL,czm_getLambertDiffuse:KL,czm_getSpecular:XL,czm_getWaterNoise:JL,czm_HSBToRGB:ZL,czm_HSLToRGB:$L,czm_hue:eO,czm_inverseGamma:tO,czm_isEmpty:nO,czm_isFull:iO,czm_latitudeToWebMercatorFraction:oO,czm_linearToSrgb:rO,czm_lineDistance:aO,czm_luminance:sO,czm_maximumComponent:cO,czm_metersPerPixel:lO,czm_modelToWindowCoordinates:uO,czm_multiplyWithColorBalance:fO,czm_nearFarScalar:dO,czm_octDecode:hO,czm_packDepth:mO,czm_pbrLighting:pO,czm_pbrNeutralTonemapping:AO,czm_phong:gO,czm_planeDistance:_O,czm_pointAlongRay:yO,czm_rayEllipsoidIntersectionInterval:CO,czm_raySphereIntersectionInterval:EO,czm_readDepth:IO,czm_readNonPerspective:bO,czm_reverseLogDepth:xO,czm_RGBToHSB:TO,czm_RGBToHSL:SO,czm_RGBToXYZ:wO,czm_round:BO,czm_saturation:DO,czm_shadowDepthCompare:vO,czm_shadowVisibility:PO,czm_signNotZero:RO,czm_sphericalHarmonics:MO,czm_srgbToLinear:NO,czm_tangentToEyeSpaceMatrix:LO,czm_textureCube:OO,czm_transformPlane:FO,czm_translateRelativeToEye:QO,czm_translucentPhong:kO,czm_transpose:UO,czm_unpackClippingExtents:zO,czm_unpackDepth:GO,czm_unpackFloat:VO,czm_unpackTexture:HO,czm_unpackUint:WO,czm_valueTransform:jO,czm_vertexLogDepth:YO,czm_windowToEyeCoordinates:qO,czm_writeDepthClamp:KO,czm_writeLogDepth:XO,czm_writeNonPerspective:JO,czm_XYZToRGB:ZO};function MLe(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 $O=MLe;function koe(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 Uoe(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return l(i)||(t=koe(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function zoe(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Cs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=Uoe(i,Cs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),zoe(o,t)}}))}function NLe(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 a=o.dependsOn[r],s=a.requiredBy.indexOf(o);a.requiredBy.splice(s,1),a.requiredBy.length===0&&t.push(a)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o])}function LLe(e){let t=[],n=Uoe("main",e,t);zoe(n,t),NLe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
|
|
`;return i.replace(n.glslSource,"")}function Goe(e,t,n){let i="",o=e.sources;if(l(o))for(let A=0;A<o.length;++A)i+=`
|
|
#line 0
|
|
${o[A]}`;i=koe(i);let r;i=i.replace(/#version\s+(.*?)\n/gm,function(A,m){return r=m,`
|
|
`});let a=[];i=i.replace(/#extension.*\n/gm,function(A){return a.push(A),`
|
|
`}),i=i.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let s=e.pickColorQualifier;l(s)&&(i=Cs.createPickFragmentShaderSource(i,s));let c="",u=a.length;for(let A=0;A<u;A++)c+=a[A];t&&(c+=`
|
|
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
|
precision highp float;
|
|
precision highp int;
|
|
#else
|
|
precision mediump float;
|
|
precision mediump int;
|
|
#define highp mediump
|
|
#endif
|
|
`),n.webgl2&&(c+=`precision highp sampler3D;
|
|
|
|
`);let f=e.defines;if(l(f))for(let A=0,m=f.length;A<m;++A){let _=f[A];_.length!==0&&(c+=`#define ${_}
|
|
`)}n.textureFloatLinear&&(c+=`#define OES_texture_float_linear
|
|
|
|
`),n.floatingPointTexture&&(c+=`#define OES_texture_float
|
|
|
|
`);let h="";e.includeBuiltIns&&(h=LLe(i)),c+=`
|
|
#line 0
|
|
`;let p=h+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor;
|
|
|
|
`),c+=h,c+=i,n.webgl2?c=`#version 300 es
|
|
${c}`:c=$O(c,t),c}function Cs(e){e=e??V.EMPTY_OBJECT;let t=e.pickColorQualifier;this.defines=l(e.defines)?e.defines.slice(0):[],this.sources=l(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}Cs.prototype.clone=function(){return new Cs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Cs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Cs.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}`};Cs.prototype.createCombinedVertexShader=function(e){return Goe(this,!1,e)};Cs.prototype.createCombinedFragmentShader=function(e){return Goe(this,!0,e)};Cs._czmBuiltinsAndUniforms={};for(let e in HI)HI.hasOwnProperty(e)&&(Cs._czmBuiltinsAndUniforms[e]=HI[e]);for(let e in Og)if(Og.hasOwnProperty(e)){let t=Og[e];typeof t.getDeclaration=="function"&&(Cs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Cs.createPickVertexShaderSource=function(e){return`${Cs.replaceMain(e,"czm_old_main")}
|
|
in vec4 pickColor;
|
|
out vec4 czm_pickColor;
|
|
void main()
|
|
{
|
|
czm_old_main();
|
|
czm_pickColor = pickColor;
|
|
}`};Cs.createPickFragmentShaderSource=function(e,t){let n=Cs.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 OLe(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 Voe(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function Hoe(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(Voe(e,o))return o}}var FLe=["v_normalEC","v_normal"];Cs.findNormalVarying=function(e){return Voe(e,"#ifdef HAS_NORMALS")?OLe(e,"HAS_NORMALS")?"v_normalEC":void 0:Hoe(e,FLe)};var QLe=["v_positionEC"];Cs.findPositionVarying=function(e){return Hoe(e,QLe)};var We=Cs;function rh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(rh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});rh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function kLe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}rh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new We({sources:[t]})),typeof n=="string"&&(n=new We({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),a=l(i)?kLe(i):"",s=`${o}:${r}:${a}`,c;if(l(this._shaders[s]))c=this._shaders[s],delete this._shadersToRelease[s];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new $t({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:s,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[s]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};rh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(l(r)){vj(this,r);let a=i.derivedKeywords.indexOf(t);a>-1&&i.derivedKeywords.splice(a,1)}return this.createDerivedShaderProgram(e,t,n)};rh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};rh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,a=n.fragmentShaderSource,s=n.attributeLocations;typeof r=="string"&&(r=new We({sources:[r]})),typeof a=="string"&&(a=new We({sources:[a]}));let c=this._context,u=r.createCombinedVertexShader(c),f=a.createCombinedFragmentShader(c),h=new $t({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:a,fragmentShaderText:f,attributeLocations:s}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function vj(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,a=e._shaders[r];vj(e,a)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}rh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];vj(this,n),--this._numberOfShaders}this._shadersToRelease={}};rh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};rh.prototype.isDestroyed=function(){return!1};rh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return fe(this)};var e1=rh;function ah(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,h=Ke.toInternalFormat(i,o,t),p=Ke.isCompressedFormat(h),A=t._gl,m=p?Ke.compressedTextureSizeInBytes(i,c,u):Ke.textureSizeInBytes(i,o,c,u);this._id=e.id??Jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=A.TEXTURE_2D,this._texture=A.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._dimensions=new Q(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=s,qoe(this,s),A.activeTexture(A.TEXTURE0),A.bindTexture(this._textureTarget,this._texture),l(n)?(a?A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.NONE):A.pixelStorei(A.UNPACK_COLORSPACE_CONVERSION_WEBGL,A.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?Ke.isCompressedFormat(h)?ULe(this,n):Woe(this,n):l(n.framebuffer)?GLe(this,n):joe(this,n),this._initialized=!0):Yoe(this),A.bindTexture(this._textureTarget,null)}function ULe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s}=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,a,s,0,t.arrayBufferView),l(t.mipLevels)){let c=a,u=s;for(let f=0;f<t.mipLevels.length;++f)c=t1(c),u=t1(u),i.compressedTexImage2D(o,f+1,r,c,u,0,t.mipLevels[f])}}function Woe(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s,pixelFormat:c,pixelDatatype:u,flipY:f}=e,h=Ke.alignmentInBytes(c,u,a);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=Ke.flipY(p,c,u,a,s)),i.texImage2D(o,0,r,a,s,0,c,He.toWebGLConstant(u,n),p),l(t.mipLevels)){let A=a,m=s;for(let _=0;_<t.mipLevels.length;++_)A=t1(A),m=t1(m),i.texImage2D(o,_+1,r,A,m,0,c,He.toWebGLConstant(u,n),t.mipLevels[_])}}function zLe(e,t,n,i,o,r){let a=e._context,s=a._gl,{pixelFormat:c,pixelDatatype:u}=e,f=Ke.alignmentInBytes(c,u,o);s.pixelStorei(s.UNPACK_ALIGNMENT,f),s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=Ke.flipY(t,c,u,o,r)),s.texSubImage2D(e._textureTarget,0,n,i,o,r,c,He.toWebGLConstant(u,a),t)}function GLe(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 joe(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,He.toWebGLConstant(e.pixelDatatype,n),t)}function VLe(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,He.toWebGLConstant(e.pixelDatatype,o),t)}function t1(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Yoe(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}ah.create=function(e){return new ah(e)};ah.fromFramebuffer=function(e){e=e??V.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=Ke.RGB,framebufferXOffset:i=0,framebufferYOffset:o=0,width:r=t.drawingBufferWidth,height:a=t.drawingBufferHeight,framebuffer:s}=e;return new ah({context:t,width:r,height:a,pixelFormat:n,source:{framebuffer:l(s)?s:t.defaultFramebuffer,xOffset:i,yOffset:o,width:r,height:a}})};Object.defineProperties(ah.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){qoe(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 qoe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===He.FLOAT&&!r.textureFloatLinear||s===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=si.NEAREST),r.webgl2&&Ke.isDepthFormat(a)&&(n=Wt.NEAREST,i=si.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}ah.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Woe(this,i):joe(this,i),f=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),Yoe(this)),this._initialized=!0),f||(l(i.arrayBufferView)?zLe(this,i.arrayBufferView,t,n,c,u):VLe(this,i,t,n)),a.bindTexture(s,null)};ah.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height;let a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture),a.copyTexSubImage2D(s,0,e,t,n,i,o,r),a.bindTexture(s,null),this._initialized=!0};ah.prototype.generateMipmap=function(e){e=e??ih.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var vt=ah;function zC(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(zC.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});zC.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};zC.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};zC.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={}};zC.prototype.isDestroyed=function(){return!1};zC.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return fe(this)};var n1=zC;function Uf(e){this.planes=e??[]}var Mw=[new d,new d,new d];d.clone(d.UNIT_X,Mw[0]);d.clone(d.UNIT_Y,Mw[1]);d.clone(d.UNIT_Z,Mw[2]);var Yg=new d,HLe=new d,Koe=new cn(new d(1,0,0),0);Uf.fromBoundingSphere=function(e,t){l(t)||(t=new Uf);let n=Mw.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,a=0;for(let s=0;s<n;++s){let c=Mw[s],u=i[a],f=i[a+1];l(u)||(u=i[a]=new ie),l(f)||(f=i[a+1]=new ie),d.multiplyByScalar(c,-r,Yg),d.add(o,Yg,Yg),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-d.dot(c,Yg),d.multiplyByScalar(c,r,Yg),d.add(o,Yg,Yg),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-d.dot(d.negate(c,HLe),Yg),a+=2}return t};Uf.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(cn.fromCartesian4(t[i],Koe));if(r===Xt.OUTSIDE)return Xt.OUTSIDE;r===Xt.INTERSECTING&&(n=!0)}return n?Xt.INTERSECTING:Xt.INSIDE};Uf.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Uf.MASK_OUTSIDE||t===Uf.MASK_INSIDE)return t;let n=Uf.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let a=o<31?1<<o:0;if(o<31&&(t&a)===0)continue;let s=e.intersectPlane(cn.fromCartesian4(i[o],Koe));if(s===Xt.OUTSIDE)return Uf.MASK_OUTSIDE;s===Xt.INTERSECTING&&(n|=a)}return n};Uf.MASK_OUTSIDE=4294967295;Uf.MASK_INSIDE=0;Uf.MASK_INDETERMINATE=2147483647;var ns=Uf;function xm(e){e=e??V.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ns,this._orthographicMatrix=new P}function Xoe(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=P.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(xm.prototype,{projectionMatrix:{get:function(){return Xoe(this),this._orthographicMatrix}}});var WLe=new d,jLe=new d,YLe=new d,Pj=new d;xm.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=d.cross(t,n,WLe);d.normalize(f,f);let h=jLe;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=YLe;d.multiplyByScalar(f,s,p),d.add(h,p,p);let A=i[0];return l(A)||(A=i[0]=new ie),A.x=f.x,A.y=f.y,A.z=f.z,A.w=-d.dot(f,p),d.multiplyByScalar(f,a,p),d.add(h,p,p),A=i[1],l(A)||(A=i[1]=new ie),A.x=-f.x,A.y=-f.y,A.z=-f.z,A.w=-d.dot(d.negate(f,Pj),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),A=i[2],l(A)||(A=i[2]=new ie),A.x=n.x,A.y=n.y,A.z=n.z,A.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),A=i[3],l(A)||(A=i[3]=new ie),A.x=-n.x,A.y=-n.y,A.z=-n.z,A.w=-d.dot(d.negate(n,Pj),p),A=i[4],l(A)||(A=i[4]=new ie),A.x=t.x,A.y=t.y,A.z=t.z,A.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),A=i[5],l(A)||(A=i[5]=new ie),A.x=-t.x,A.y=-t.y,A.z=-t.z,A.w=-d.dot(d.negate(t,Pj),p),this._cullingVolume};xm.prototype.getPixelDimensions=function(e,t,n,i,o){Xoe(this);let r=this.right-this.left,a=this.top-this.bottom,s=i*r/e,c=i*a/t;return o.x=s,o.y=c,o};xm.prototype.clone=function(e){return l(e)||(e=new xm),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};xm.prototype.equals=function(e){return l(e)&&e instanceof xm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};xm.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof xm&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var Aa=xm;function jl(e){e=e??V.EMPTY_OBJECT,this._offCenterFrustum=new Aa,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}jl.packedLength=4;jl.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};jl.unpack=function(e,t,n){return t=t??0,l(n)||(n=new jl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function qg(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(jl.prototype,{projectionMatrix:{get:function(){return qg(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return qg(this),this._offCenterFrustum}}});jl.prototype.computeCullingVolume=function(e,t,n){return qg(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};jl.prototype.getPixelDimensions=function(e,t,n,i,o){return qg(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};jl.prototype.clone=function(e){return l(e)||(e=new jl),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};jl.prototype.equals=function(e){return!l(e)||!(e instanceof jl)?!1:(qg(this),qg(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};jl.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof jl)?!1:(qg(this),qg(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var An=jl;var Rj={};function qLe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var KLe=32.184,XLe=2451545;function pre(e,t){t=X.addSeconds(e,KLe,t);let n=X.totalDays(t)-XLe;return t=X.addSeconds(t,qLe(n),t),t}var i1=new X(2451545,0,ai.TAI),JLe=1e3,zf=D.RADIANS_PER_DEGREE,zu=D.RADIANS_PER_ARCSECOND,dc=14959787e4,Joe=new J;function Are(e,t,n,i,o,r,a){n<0&&(n=-n,o+=D.PI);let s=e*(1-t),c=i-o,u=o,f=$Le(r-i,t),h=ZLe(t,0);oOe(c,n,u,Joe);let p=s*(1+t),A=Math.cos(f),m=Math.sin(f),_=1+t*A,y=p/_;return l(a)?(a.x=y*A,a.y=y*m,a.z=0):a=new d(y*A,y*m,0),J.multiplyByVector(Joe,a,a)}function ZLe(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function $Le(e,t){let n=nOe(e,t);return iOe(n,t)}var eOe=50,tOe=D.EPSILON8;function nOe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<eOe&&Math.abs(o-i)>tOe;++r){o=i;let a=o-t*Math.sin(o)-e,s=1-t*Math.cos(o);i=o-a/s}return o=i+n*D.TWO_PI,o}function iOe(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=D.zeroToTwoPi(r),e<0&&(r-=D.TWO_PI),r+=n*D.TWO_PI,r}function oOe(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),a=Math.cos(t),s=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*o-u*r*a,i[1]=u*o+c*r*a,i[2]=r*s,i[3]=-c*r-u*o*a,i[4]=-u*r+c*o*a,i[5]=o*s,i[6]=u*s,i[7]=-c*s,i[8]=a):i=new J(c*o-u*r*a,-c*r-u*o*a,u*s,u*o+c*r*a,-u*r+c*o*a,-c*s,r*s,o*s,a),i}var rOe=1.0000010178*dc,aOe=100.46645683*zf,sOe=129597742283429e-5*zu,Zoe=16002,$oe=21863,ere=32004,tre=10931,nre=14529,ire=16368,ore=15318,rre=32794,cOe=64*1e-7*dc,lOe=-152*1e-7*dc,uOe=62*1e-7*dc,fOe=-8*1e-7*dc,dOe=32*1e-7*dc,hOe=-41*1e-7*dc,mOe=19*1e-7*dc,pOe=-11*1e-7*dc,AOe=-150*1e-7*dc,gOe=-46*1e-7*dc,_Oe=68*1e-7*dc,yOe=54*1e-7*dc,COe=14*1e-7*dc,EOe=24*1e-7*dc,IOe=-28*1e-7*dc,bOe=22*1e-7*dc,are=10,sre=16002,cre=21863,lre=10931,ure=1473,fre=32004,dre=4387,hre=73,xOe=-325*1e-7,TOe=-322*1e-7,SOe=-79*1e-7,wOe=232*1e-7,BOe=-52*1e-7,DOe=97*1e-7,vOe=55*1e-7,POe=-41*1e-7,ROe=-105*1e-7,MOe=-137*1e-7,NOe=258*1e-7,LOe=35*1e-7,OOe=-116*1e-7,FOe=-88*1e-7,QOe=-112*1e-7,kOe=-80*1e-7,WI=new X(0,0,ai.TAI);function UOe(e,t){pre(e,WI);let i=(WI.dayNumber-i1.dayNumber+(WI.secondsOfDay-i1.secondsOfDay)/ci.SECONDS_PER_DAY)/(ci.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=rOe+cOe*Math.cos(Zoe*o)+AOe*Math.sin(Zoe*o)+lOe*Math.cos($oe*o)+gOe*Math.sin($oe*o)+uOe*Math.cos(ere*o)+_Oe*Math.sin(ere*o)+fOe*Math.cos(tre*o)+yOe*Math.sin(tre*o)+dOe*Math.cos(nre*o)+COe*Math.sin(nre*o)+hOe*Math.cos(ire*o)+EOe*Math.sin(ire*o)+mOe*Math.cos(ore*o)+IOe*Math.sin(ore*o)+pOe*Math.cos(rre*o)+bOe*Math.sin(rre*o),a=aOe+sOe*i+xOe*Math.cos(are*o)+ROe*Math.sin(are*o)+TOe*Math.cos(sre*o)+MOe*Math.sin(sre*o)+SOe*Math.cos(cre*o)+NOe*Math.sin(cre*o)+wOe*Math.cos(lre*o)+LOe*Math.sin(lre*o)+BOe*Math.cos(ure*o)+OOe*Math.sin(ure*o)+DOe*Math.cos(fre*o)+FOe*Math.sin(fre*o)+vOe*Math.cos(dre*o)+QOe*Math.sin(dre*o)+POe*Math.cos(hre*o)+kOe*Math.sin(hre*o),s=.0167086342-.0004203654*i,c=102.93734808*zf+11612.3529*zu*i,u=469.97289*zu*i,f=174.87317577*zf-8679.27034*zu*i;return Are(r,s,u,c,f,a,t)}function gre(e,t){pre(e,WI);let i=(WI.dayNumber-i1.dayNumber+(WI.secondsOfDay-i1.secondsOfDay)/ci.SECONDS_PER_DAY)/ci.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,a=r*i,s=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*zf,f=-8e-5*i+.02966*o-42e-6*r-13e-8*a,h=83.35324312*zf,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*a,A=125.04455501*zf,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*a,_=218.31664563*zf,y=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*a,C=297.85019547*zf+zu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*a),E=93.27209062*zf+zu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*a),I=134.96340251*zf+zu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*a),x=357.52910918*zf+zu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*a),S=310.17137918*zf-zu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*a),w=2*C,v=4*C,R=6*C,N=2*I,L=3*I,g=4*I,b=2*E;s+=3400.4*Math.cos(w)-635.6*Math.cos(w-I)-235.6*Math.cos(I)+218.1*Math.cos(w-x)+181*Math.cos(w+I),c+=.014216*Math.cos(w-I)+.008551*Math.cos(w-N)-.001383*Math.cos(I)+.001356*Math.cos(w+I)-.001147*Math.cos(v-L)-914e-6*Math.cos(v-N)+869e-6*Math.cos(w-x-I)-627e-6*Math.cos(w)-394e-6*Math.cos(v-g)+282e-6*Math.cos(w-x-N)-279e-6*Math.cos(C-I)-236e-6*Math.cos(N)+231e-6*Math.cos(v)+229e-6*Math.cos(R-g)-201e-6*Math.cos(N-b),f+=486.26*Math.cos(w-b)-40.13*Math.cos(w)+37.51*Math.cos(b)+25.73*Math.cos(N-b)+19.97*Math.cos(w-x-b),p+=-55609*Math.sin(w-I)-34711*Math.sin(w-N)-9792*Math.sin(I)+9385*Math.sin(v-L)+7505*Math.sin(v-N)+5318*Math.sin(w+I)+3484*Math.sin(v-g)-3417*Math.sin(w-x-I)-2530*Math.sin(R-g)-2376*Math.sin(w)-2075*Math.sin(w-L)-1883*Math.sin(N)-1736*Math.sin(R-5*I)+1626*Math.sin(x)-1370*Math.sin(R-L),m+=-5392*Math.sin(w-b)-540*Math.sin(x)-441*Math.sin(w)+423*Math.sin(b)-288*Math.sin(N-b),y+=-3332.9*Math.sin(w)+1197.4*Math.sin(w-I)-662.5*Math.sin(x)+396.3*Math.sin(I)-218*Math.sin(w-x);let T=2*S,B=3*S;f+=46.997*Math.cos(S)*i-.614*Math.cos(w-b+S)*i+.614*Math.cos(w-b-S)*i-.0297*Math.cos(T)*o-.0335*Math.cos(S)*o+.0012*Math.cos(w-b+T)*o-16e-5*Math.cos(S)*r+4e-5*Math.cos(B)*r+4e-5*Math.cos(T)*r;let M=2.116*Math.sin(S)*i-.111*Math.sin(w-b-S)*i-.0015*Math.sin(S)*o;p+=M,y+=M,m+=-520.77*Math.sin(S)*i+13.66*Math.sin(w-b+S)*i+1.12*Math.sin(w-S)*i-1.06*Math.sin(b-S)*i+.66*Math.sin(T)*o+.371*Math.sin(S)*o-.035*Math.sin(w-b+T)*o-.015*Math.sin(w-b+S)*o+.0014*Math.sin(S)*r-.0011*Math.sin(B)*r-9e-4*Math.sin(T)*r,s*=JLe;let O=u+f*zu,G=h+p*zu,k=_+y*zu,z=A+m*zu;return Are(s,c,O,G,z,k,t)}var mre=.012300034,zOe=mre/(mre+1)*-1;function GOe(e,t){return t=gre(e,t),d.multiplyByScalar(t,zOe,t)}var _re=new J(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),Nw=new d;Rj.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=X.now()),l(t)||(t=new d),Nw=UOe(e,Nw),t=d.negate(Nw,t),GOe(e,Nw),d.subtract(t,Nw,t),J.multiplyByVector(_re,t,t),t};Rj.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=X.now()),t=gre(e,t),J.multiplyByVector(_re,t,t),t};var GC=Rj;var o1={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};o1.getMorphTime=function(e){return e===o1.SCENE3D?1:e===o1.MORPHING?void 0:0};var oe=Object.freeze(o1);function VOe(e){e=e??V.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var Kg=VOe;function jI(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new ie,this._viewportDirty=!1,this._viewportOrthographicMatrix=P.clone(P.IDENTITY),this._viewportTransformation=P.clone(P.IDENTITY),this._model=P.clone(P.IDENTITY),this._view=P.clone(P.IDENTITY),this._inverseView=P.clone(P.IDENTITY),this._projection=P.clone(P.IDENTITY),this._infiniteProjection=P.clone(P.IDENTITY),this._entireFrustum=new Q,this._currentFrustum=new Q,this._frustumPlanes=new ie,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=J.clone(P.IDENTITY),this._view3DDirty=!0,this._view3D=new P,this._inverseView3DDirty=!0,this._inverseView3D=new P,this._inverseModelDirty=!0,this._inverseModel=new P,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new J,this._viewRotation=new J,this._inverseViewRotation=new J,this._viewRotation3D=new J,this._inverseViewRotation3D=new J,this._inverseProjectionDirty=!0,this._inverseProjection=new P,this._modelViewDirty=!0,this._modelView=new P,this._modelView3DDirty=!0,this._modelView3D=new P,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new P,this._inverseModelViewDirty=!0,this._inverseModelView=new P,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new P,this._viewProjectionDirty=!0,this._viewProjection=new P,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new P,this._modelViewProjectionDirty=!0,this._modelViewProjection=new P,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new P,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new P,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new P,this._normalDirty=!0,this._normal=new J,this._normal3DDirty=!0,this._normal3D=new J,this._inverseNormalDirty=!0,this._inverseNormal=new J,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new J,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new xn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new Q,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new Q,this._modelToEnu=new P,this._enuToModel=new P,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new U,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(jI.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.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 Cre(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Cre(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){P.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,P.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,P.getMatrix3(this.inverseModel,e),J.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return Nj(this),this._view3D}},viewRotation:{get:function(){return Nj(this),this._viewRotation}},viewRotation3D:{get:function(){return Nj(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return bre(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return bre(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return e1e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return t1e(this),this._modelView}},modelView3D:{get:function(){return n1e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return c1e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return i1e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return o1e(this),this._inverseModelView3D}},viewProjection:{get:function(){return r1e(this),this._viewProjection}},inverseViewProjection:{get:function(){return a1e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return s1e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return l1e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return u1e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return f1e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return d1e(this),this._normal}},normal3D:{get:function(){return h1e(this),this._normal3D}},inverseNormal:{get:function(){return m1e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return p1e(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 Ire(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Ire(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??te.default}}});function HOe(e,t){P.clone(t,e._view),P.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 WOe(e,t){P.clone(t,e._inverseView),P.getMatrix3(t,e._inverseViewRotation)}function jOe(e,t){P.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function YOe(e,t){P.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var yre=new d,qOe=new P;function KOe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,yre)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,yre)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=J.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=At.eastNorthUpToFixedFrame(i,n,qOe);e._enuToModel=P.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=P.inverseTransformation(e._enuToModel,e._modelToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var Mj=new J,XOe=new me;function JOe(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,Mj);let n=GC.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);J.multiplyByVector(Mj,n,n),d.normalize(n,e._sunDirectionWC),n=J.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=GC.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),J.multiplyByVector(Mj,n,n),J.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,XOe);i.project(r,e._sunPositionColumbusView)}jI.prototype.updateCamera=function(e){HOe(this,e.viewMatrix),WOe(this,e.inverseViewMatrix),KOe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof An};jI.prototype.updateFrustum=function(e){jOe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&YOe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};jI.prototype.updatePass=function(e){this._pass=e};var ZOe=[],$Oe=new Kg;jI.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===oe.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),JOe(this,e);let n=e.light??$Oe;n instanceof Kg?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=J.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let a=e.brdfLutGenerator,s=l(a)?a.colorTexture:void 0;this._brdfLut=s,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??ZOe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=d.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;l(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,U.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Cre(e){if(e._viewportDirty){let t=e._viewport;P.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),P.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function e1e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?P.inverse(e._projection,e._inverseProjection):P.clone(P.ZERO,e._inverseProjection))}function t1e(e){e._modelViewDirty&&(e._modelViewDirty=!1,P.multiplyTransformation(e._view,e._model,e._modelView))}function n1e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,P.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function i1e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,P.inverse(e.modelView,e._inverseModelView))}function o1e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,P.inverse(e.modelView3D,e._inverseModelView3D))}function r1e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,P.multiply(e._projection,e._view,e._viewProjection))}function a1e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,P.inverse(e.viewProjection,e._inverseViewProjection))}function s1e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,P.multiply(e._projection,e.modelView,e._modelViewProjection))}function c1e(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 l1e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,P.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function u1e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,P.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function f1e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,P.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function d1e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;P.getMatrix3(e.inverseModelView,t),J.transpose(t,t)}}function h1e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;P.getMatrix3(e.inverseModelView3D,t),J.transpose(t,t)}}function m1e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;P.getMatrix3(e.modelView,t),J.transpose(t,t)}}function p1e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;P.getMatrix3(e.modelView3D,t),J.transpose(t,t)}}var Ere=new d;function Ire(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,P.multiplyByPoint(e.inverseModel,e._cameraPosition,Ere),xn.fromCartesian(Ere,e._encodedCameraPositionMC))}var A1e=new d,g1e=new d,_1e=new d,y1e=new d,C1e=new me,E1e=new d,I1e=new P;function b1e(e,t,n,i,o,r,a,s){let c=A1e;c.x=e.y,c.y=e.z,c.z=e.x;let u=g1e;u.x=n.y,u.y=n.z,u.z=n.x;let f=_1e;f.x=i.y,f.y=i.z,f.z=i.x;let h=y1e;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(c.z=o*.5);let p=a.unproject(c,C1e);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let A=a.ellipsoid,m=A.cartographicToCartesian(p,E1e),_=At.eastNorthUpToFixedFrame(m,A,I1e);return P.multiplyByPointAsVector(_,u,u),P.multiplyByPointAsVector(_,f,f),P.multiplyByPointAsVector(_,h,h),l(s)||(s=new P),s[0]=u.x,s[1]=f.x,s[2]=-h.x,s[3]=0,s[4]=u.y,s[5]=f.y,s[6]=-h.y,s[7]=0,s[8]=u.z,s[9]=f.z,s[10]=-h.z,s[11]=0,s[12]=-d.dot(u,m),s[13]=-d.dot(f,m),s[14]=d.dot(h,m),s[15]=1,s}function Nj(e){e._view3DDirty&&(e._mode===oe.SCENE3D?P.clone(e._view,e._view3D):b1e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),P.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function bre(e){e._inverseView3DDirty&&(P.inverseTransformation(e.view3D,e._inverseView3D),P.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var r1=jI;function Yl(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let a=l(n)?n(e,o):x1e(e,o,i),c=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=c,this._id=Jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new e1(this),this._textureCache=new n1;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),Nt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Nt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),Nt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),Nt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),Nt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),Nt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),Nt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),Nt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),Nt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),Nt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Nt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),Nt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);Nt._minimumAliasedLineWidth=f[0],Nt._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);Nt._minimumAliasedPointSize=h[0],Nt._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);Nt._maximumViewportWidth=p[0],Nt._maximumViewportHeight=p[1];let A=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);Nt._highpFloatSupported=A.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);Nt._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!Fr(u,["OES_standard_derivatives"]),this._blendMinmax=!!Fr(u,["EXT_blend_minmax"]),this._elementIndexUint=!!Fr(u,["OES_element_index_uint"]),this._depthTexture=!!Fr(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Fr(u,["EXT_frag_depth"]),this._debugShaders=Fr(u,["WEBGL_debug_shaders"]),this._textureFloat=!!Fr(u,["OES_texture_float"]),this._textureHalfFloat=!!Fr(u,["OES_texture_half_float"]),this._textureFloatLinear=!!Fr(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Fr(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Fr(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Fr(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Fr(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Fr(u,["EXT_color_buffer_half_float"]),this._s3tc=!!Fr(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Fr(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Fr(u,["WEBGL_compressed_texture_astc"]),this._etc=!!Fr(u,["WEBG_compressed_texture_etc"]),this._etc1=!!Fr(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Fr(u,["EXT_texture_compression_bptc"]),ku.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?Fr(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,Nt._maximumTextureFilterAnisotropy=l(_)?u.getParameter(_.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let y,C,E,I,x,S,w,v,R,N;if(c){let T=this;y=function(){return T._gl.createVertexArray()},C=function(B){T._gl.bindVertexArray(B)},E=function(B){T._gl.deleteVertexArray(B)},I=function(B,M,O,G,k){u.drawElementsInstanced(B,M,O,G,k)},x=function(B,M,O,G){u.drawArraysInstanced(B,M,O,G)},S=function(B,M){u.vertexAttribDivisor(B,M)},w=function(B){u.drawBuffers(B)}}else v=Fr(u,["OES_vertex_array_object"]),l(v)&&(y=function(){return v.createVertexArrayOES()},C=function(T){v.bindVertexArrayOES(T)},E=function(T){v.deleteVertexArrayOES(T)}),R=Fr(u,["ANGLE_instanced_arrays"]),l(R)&&(I=function(T,B,M,O,G){R.drawElementsInstancedANGLE(T,B,M,O,G)},x=function(T,B,M,O){R.drawArraysInstancedANGLE(T,B,M,O)},S=function(T,B){R.vertexAttribDivisorANGLE(T,B)}),N=Fr(u,["WEBGL_draw_buffers"]),l(N)&&(w=function(T){N.drawBuffersWEBGL(T)});this.glCreateVertexArray=y,this.glBindVertexArray=C,this.glDeleteVertexArray=E,this.glDrawElementsInstanced=I,this.glDrawArraysInstanced=x,this.glVertexAttribDivisor=S,this.glDrawBuffers=w,this._vertexArrayObject=!!v,this._instancedArrays=!!R,this._drawBuffers=!!N,Nt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ee.MAX_DRAW_BUFFERS):1,Nt._maximumColorAttachments=this.drawBuffers?u.getParameter(ee.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new U(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let L=new r1,g=new ll(this),b=Ve.fromCache();this._defaultPassState=g,this._defaultRenderState=b,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=L,this._currentRenderState=b,this._currentPassState=g,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let T=0;T<Nt._maximumVertexAttributes;T++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},Ve.apply(u,b,g)}function x1e(e,t,n){if(typeof WebGLRenderingContext>"u")throw new ue("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ue("The browser supports WebGL, but initialization failed.");return r}function T1e(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 S1e(e,t,n,i){let o=`${T1e(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function w1e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ue(S1e(e,t,n,i))}function B1e(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 D1e(e,t){if(!l(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,B1e(e,o,t))}return i}function Fr(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var v1e={};Object.defineProperties(Yl.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=D1e(this._originalGLContext,e?w1e:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new vt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new vt({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 vt({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 ta({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 v1e}}});function xre(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ve.partialApply(e._gl,o,t,r,n,i)}var Lj;typeof WebGLRenderingContext<"u"&&(Lj=[ee.BACK]);function a1(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=Lj;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var P1e=new ui;Yl.prototype.clear=function(e,t){e=e??P1e,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,a=e.stencil;l(o)&&(U.equals(this._clearColor,o)||(U.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(a)&&(a!==this._clearStencil&&(this._clearStencil=a,n.clearStencil(a)),i|=n.STENCIL_BUFFER_BIT);let s=e.renderState??this._defaultRenderState;xre(this,s,t,!0);let c=e.framebuffer??t.framebuffer;a1(this,c),n.clear(i)};function R1e(e,t,n,i,o){a1(e,t),xre(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function M1e(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,a=t._offset,s=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??P.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;l(u)?(a=a*u.bytesPerIndex,l(s)?s=Math.min(s,u.numberOfIndices):s=u.numberOfIndices,c===0?e._gl.drawElements(o,s,u.indexDatatype,a):e.glDrawElementsInstanced(o,s,u.indexDatatype,a,c)):(l(s)?s=Math.min(s,r.numberOfVertices):s=r.numberOfVertices,c===0?e._gl.drawArrays(o,a,s):e.glDrawArraysInstanced(o,a,s,c)),r._unBind()}Yl.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,R1e(this,o,t,n,r),M1e(this,e,n,i)};Yl.prototype.beginFrame=function(){};Yl.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=Lj;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)};Yl.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??V.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,a=e.framebuffer;if(!this._webgl2)throw new de("A WebGL 2 context is required to read pixels using a PBO.");let s=He.UNSIGNED_BYTE,c=Ke.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:Ke.textureSizeInBytes(c,s,o,r),usage:Re.DYNAMIC_READ});return a1(this,a),u._bind(),t.readPixels(n,i,o,r,c,He.toWebGLConstant(s,this),0),u._unBind(),u};Yl.prototype.readPixels=function(e){let t=this._gl;e=e??V.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,a=e.framebuffer,s=He.UNSIGNED_BYTE,c=Ke.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=Ke.createTypedArray(c,s,o,r);return a1(this,a),t.readPixels(n,i,o,r,Ke.RGBA,He.toWebGLConstant(s,this),u),u};var Tre={position:0,textureCoordinates:1};Yl.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new yt({attributes:{position:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Pe.TRIANGLES});e=Vn.fromGeometry({context:this,geometry:t,attributeLocations:Tre,bufferUsage:Re.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Yl.prototype.createViewportQuadCommand=function(e,t){return t=t??V.EMPTY_OBJECT,new it({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Pe.TRIANGLES,renderState:t.renderState,shaderProgram:$t.fromCache({context:this,vertexShaderSource:OI,fragmentShaderSource:e,attributeLocations:Tre}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Yl.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Yl.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ue("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new yN(this._pickObjects,t,U.fromRgba(t))};Yl.prototype.isDestroyed=function(){return!1};Yl.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),fe(this)};var YI=Yl;function qI(e){e=e??V.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:a,depthStencilTexture:s,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new de("Both color renderbuffer and texture attachments must be provided.");if(l(a)!==l(s))throw new de("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new pa({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:a,destroyAttachments:c}),this._colorFramebuffer=new pa({context:t,colorTextures:r,depthStencilTexture:s,destroyAttachments:c})}qI.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};qI.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};qI.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};qI.prototype.isDestroyed=function(){return!1};qI.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),fe(this)};var s1=qI;var ql={RGBA4:ee.RGBA4,RGBA8:ee.RGBA8,RGBA16F:ee.RGBA16F,RGBA32F:ee.RGBA32F,RGB5_A1:ee.RGB5_A1,RGB565:ee.RGB565,DEPTH_COMPONENT16:ee.DEPTH_COMPONENT16,STENCIL_INDEX8:ee.STENCIL_INDEX8,DEPTH_STENCIL:ee.DEPTH_STENCIL,DEPTH24_STENCIL8:ee.DEPTH24_STENCIL8,validate:function(e){return e===ql.RGBA4||e===ql.RGBA8||e===ql.RGBA16F||e===ql.RGBA32F||e===ql.RGB5_A1||e===ql.RGB565||e===ql.DEPTH_COMPONENT16||e===ql.STENCIL_INDEX8||e===ql.DEPTH_STENCIL||e===ql.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ee.FLOAT?ql.RGBA32F:e===ee.HALF_FLOAT_OES?ql.RGBA16F:ql.RGBA8}},Kl=Object.freeze(ql);function Lw(e){e=e??V.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Nt.maximumRenderbufferSize,o=e.format??Kl.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,a=l(e.height)?e.height:t.drawingBufferHeight,s=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=a,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),s>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,s,o,r,a):n.renderbufferStorage(n.RENDERBUFFER,o,r,a),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(Lw.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Lw.prototype._getRenderbuffer=function(){return this._renderbuffer};Lw.prototype.isDestroyed=function(){return!1};Lw.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),fe(this)};var Gf=Lw;function is(e){e=e??V.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(is.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}}});is.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,a=this._numSamples!==n,s=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||a||s||!c||this._color&&!l(this._colorTextures[0])};is.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??He.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 a=0;a<this._colorAttachmentsLength;++a)if(this._colorTextures[a]=new vt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:jt.NEAREST}),this._numSamples>1){let s=Kl.getColorFormat(o);this._colorRenderbuffers[a]=new Gf({context:e,width:t,height:n,format:s,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new vt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Gf({context:e,width:t,height:n,format:Kl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Gf({context:e,width:t,height:n,format:Kl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new vt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_COMPONENT,pixelDatatype:He.UNSIGNED_INT,sampler:jt.NEAREST}):this._depthRenderbuffer=new Gf({context:e,width:t,height:n,format:Kl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new s1({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 pa({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};is.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};is.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};is.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};is.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};is.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};is.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};is.prototype.getDepthTexture=function(){return this._depthTexture};is.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};is.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};is.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};is.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};is.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};is.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};is.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};is.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};is.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&l(o)&&!o.isDestroyed()&&o.destroy(),l(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var bi=is;function N1e(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new ta({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var c1=N1e;var VC={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};VC.includesVertexShader=function(e){return(e&VC.VERTEX)!==0};VC.includesFragmentShader=function(e){return(e&VC.FRAGMENT)!==0};VC.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};VC.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};var he=Object.freeze(VC);function Oj(e){this.name=e,this.fields=[]}Oj.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};Oj.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var l1=Oj;function Fj(e){this.signature=e,this.body=[]}Fj.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};Fj.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var u1=Fj;function L1e(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let o=0;o<n;o++)e[i+o]=t[o]}var oi=L1e;function ul(){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(ul.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});ul.prototype.addDefine=function(e,t,n){n=n??he.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),he.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};ul.prototype.addStruct=function(e,t,n){this._structs[e]=new l1(t),he.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};ul.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};ul.prototype.addFunction=function(e,t,n){this._functions[e]=new u1(t),he.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),he.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};ul.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};ul.prototype.addUniform=function(e,t,n){n=n??he.BOTH;let i=`uniform ${e} ${t};`;he.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),he.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};ul.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};ul.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=F1e(e),i};ul.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};ul.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?oi(t,e):t.push(e)};ul.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?oi(t,e):t.push(e)};ul.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=O1e(this),i=Q1e(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
|
|
`),r=new We({defines:this._vertexShaderParts.defineLines,sources:[o]}),a=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
|
|
`),s=new We({defines:this._fragmentShaderParts.defineLines,sources:[a]});return $t.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:this._attributeLocations})};ul.prototype.clone=function(){return Ye(this,!0)};function O1e(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,a,s;for(i=0;i<o.length;i++)r=o[i],a=e._structs[r],s=a.generateGlslLines(),oi(t,s);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],a=e._structs[r],s=a.generateGlslLines(),oi(n,s);return{vertexLines:t,fragmentLines:n}}function F1e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Q1e(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,a,s;for(i=0;i<o.length;i++)r=o[i],a=e._functions[r],s=a.generateGlslLines(),oi(t,s);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],a=e._functions[r],s=a.generateGlslLines(),oi(n,s);return{vertexLines:t,fragmentLines:n}}var Xg=ul;function f1(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new YI(this._canvas,Ye(e?.contextOptions)),this._canvases=[]}f1.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,o=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},r=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},a=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return o;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return r;case"endFrame":return a;default:return Reflect.get(c,u,f)}}})};f1.prototype.destroy=function(){this._context.destroy(),fe(this)};f1.prototype.isDestroyed=function(){return!1};var d1=f1;function HC(e){e=e??V.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new de("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(ee.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}HC.create=function(e){return new HC(e)};HC.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,ee.SYNC_STATUS)};HC.prototype.isDestroyed=function(){return!1};HC.prototype.destroy=function(){return this._gl.deleteSync(this._sync),fe(this)};HC.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(o,r,a){return()=>{n.getStatus()===ee.SIGNALED?o():a<=0?r(new ue("Wait for signal timeout")):e(i(o,r,a-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var h1=HC;function Jg(e){e=e??V.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:o=He.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:a=!1,sampler:s=new jt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new de("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let h=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,p=Ke.toInternalFormat(i,o,t),A=Ke.isCompressedFormat(p),m=t._gl,_=Ke.texture3DSizeInBytes(i,o,c,u,f);if(this._id=e.id??Jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=u,this._depth=f,this._dimensions=new d(c,u,f),this._hasMipmap=!1,this._sizeInBytes=_,this._preMultiplyAlpha=h,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=s,Bre(this,s),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(a?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new de("For Texture3D, options.source.arrayBufferView must be defined");Sre(this,n),this._initialized=!0}else wre(this);m.bindTexture(this._textureTarget,null)}function Sre(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:a,height:s,depth:c,pixelFormat:u,pixelDatatype:f,flipY:h}=e,p=Ke.alignmentInBytes(u,f,a);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:A}=t;h&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(o,m,r,a,s,c),i.texSubImage3D(o,0,0,0,0,a,s,c,u,He.toWebGLConstant(f,n),A),m>1){let _=a,y=s,C=c;for(let E=0;E<t.mipLevels.length;++E)_=Qj(_),y=Qj(y),C=Qj(C),i.texSubImage3D(o,E+1,0,0,0,_,y,C,u,He.toWebGLConstant(f,n),t.mipLevels[E])}}Jg.prototype.copyFrom=function(e){e=e??V.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:o=0}=e,a=this._context._gl,s=this._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(s,this._texture);let{width:c,height:u,depth:f}=t,h=!1;this._initialized||(n===0&&i===0&&o===0&&c===this._width&&u===this._height&&f===this._depth?(Sre(this,t),h=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),wre(this)),this._initialized=!0),h||k1e(this,t.arrayBufferView,n,i,o,c,u,f),a.bindTexture(s,null)};function k1e(e,t,n,i,o,r,a,s){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:h}=e,p=Ke.alignmentInBytes(f,h,r);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,o,r,a,s,f,He.toWebGLConstant(h,c),t)}function Qj(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function wre(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,He.toWebGLConstant(e._pixelDatatype,t),null)}Jg.create=function(e){return new Jg(e)};Object.defineProperties(Jg.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Bre(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Bre(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,a=e._pixelFormat,s=e._pixelDatatype;(s===He.FLOAT&&!r.textureFloatLinear||s===He.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=si.NEAREST),Ke.isDepthFormat(a)&&(n=Wt.NEAREST,i=si.NEAREST);let c=r._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Jg.prototype.generateMipmap=function(e){e=e??ih.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Jg.prototype.isDestroyed=function(){return!1};Jg.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),fe(this)};var m1=Jg;function Ow({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function kj({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new Ow({x:n,y:n,width:e-2*n,height:t-2*n})}kj.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};kj.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,a=o-t,s=r-n;if(a<0||s<0)return;if(a===0&&s===0)return e;let c=this._borderPadding;if(a>s){e.childNode1=new Ow({x:i.x,y:i.y,width:t,height:r});let f=a-c;return f>0&&(e.childNode2=new Ow({x:i.x+t+c,y:i.y,width:f,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new Ow({x:i.x,y:i.y,width:o,height:n});let u=s-c;return u>0&&(e.childNode2=new Ow({x:i.x,y:i.y+n+c,width:o,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var Fw=kj;var Dre=16;function fl(e){e=e??V.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new Q(Dre,Dre);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=Jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(fl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});fl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,a=i.width,s=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let h=this._rectangles[f];c+=h.x,u+=h.y}return t.x=c/o,t.y=u/r,t.width=a/o,t.height=s/r,t};fl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,a=new vt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),s=e._gl,c=a._textureTarget,u=this._texture,f=new pa({context:e,colorTextures:[u],destroyAttachments:!1});s.activeTexture(s.TEXTURE0),s.bindTexture(c,a._texture),f._bind();let h=this.rectangles,p=this._subRegions;for(let A=0;A<h.length;++A){let m=i[A],_=h[A];if(!l(m)||!l(_)||l(p.get(A)))continue;let{x:y,y:C,width:E,height:I}=m;s.copyTexSubImage2D(c,0,y,C,_.x,_.y,E,I)}return s.bindTexture(c,null),a._initialized=!0,f._unBind(),f.destroy(),a};fl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,a=r.width,s=r.height,c=this._subRegions,u=i.map((y,C)=>new vre({index:C,image:y})).filter((y,C)=>l(y.image)&&!l(c.get(C))),f=0,h=0,p=0;for(let y=t;y<o.length;++y){let{width:C,height:E}=o[y].image;f=Math.max(f,C),h=Math.max(h,E),p+=C*E,u.push(o[y])}for(a=D.nextPowerOfTwo(Math.max(f,a)),s=D.nextPowerOfTwo(Math.max(h,s));p>=a*s;)a>s?s*=2:a*=2;u.sort(({image:y},{image:C})=>C.height*C.width-y.height*y.width);let A=new Array(this._nextIndex);for(let y of this._subRegions.keys())l(c.get(y))&&(A[y]=i[y]);let m,_=!1;for(;!_;){m=new Fw({height:s,width:a,borderPadding:n});let y;for(y=0;y<u.length;++y){let{index:C,image:E}=u[y];if(!l(E))continue;let I=m.pack(C,E);if(!l(I)){a>s?s*=2:a*=2;break}A[C]=I.rectangle}_=y===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,a,s,A),r.destroy(),this._rectangles=A,this._guid=Jn()};fl.prototype.getImageIndex=function(e){return this._indexById.get(e)};fl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(a){if(l(i)){i(a);return}}};function vre({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}fl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new vre({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};fl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:a}=o,s=this._texturePacker.pack(a,r);if(!l(s)){try{this._resize(e,n)}catch(c){i=c,l(o.reject)&&o.reject(i)}break}this._rectangles[a]=s.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];l(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};fl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new vt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new Fw({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function U1e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}fl.prototype.addImage=function(e,t,n,i){let o=this._indexPromiseById.get(e),r=this._indexById.get(e);return l(o)?o:l(r)?r:(r=this._nextIndex++,this._indexById.set(e,r),o=(async()=>{let s=await U1e(t,e);if(this.isDestroyed()||!l(s))return this._indexPromiseById.delete(e),-1;l(n)&&(s.width=n),l(i)&&(s.height=i);let c=await this._addImage(r,s);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};fl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(s=>s===-1?-1:o):o};fl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ue(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let a=this._rectangles[r];return i}))};fl.prototype.isDestroyed=function(){return!1};fl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),fe(this)};var KI=fl;function Es(e,t,n,i){let o=Es._verifyAttributes(t);n=n??0;let r=[],a={},s,c,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}c=p.usage,s=a[c],l(s)||(s=a[c]=[]),s.push(p)}function f(h,p){return j.getSizeInBytes(p.componentDatatype)-j.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(c in a)if(a.hasOwnProperty(c)){s=a[c],s.sort(f);let h=Es._vertexSizeInBytes(s),p=s[0].usage,A={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Es._createArrayViews(s,h)};this._allBuffers.push(A)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Es._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??j.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Re.STATIC_DRAW};t.push(r)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;n[r]=!0}return t};Es._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let a=0;a<n;++a){let s=e[a];t+=s.componentsPerAttribute*j.getSizeInBytes(s.componentDatatype)}let i=n>0?j.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Es._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r],s=a.componentDatatype;n.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:s,normalize:a.normalize,offsetInBytes:i,vertexSizeInComponentType:t/j.getSizeInBytes(s),view:void 0}),i+=a.componentsPerAttribute*j.getSizeInBytes(s)}return n};Es.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];Es._resize(o,this._size),Es._appendWriters(this.writers,o)}Uj(this)};Es._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),a=new Uint8Array(e.arrayBuffer),s=a.length;for(let c=0;c<s;++c)r[c]=a[c]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let a=i[r];a.view=j.createArrayBufferView(a.componentDatatype,n,a.offsetInBytes)}e.arrayBuffer=n}};var z1e=[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 a=i*n;t[a]=o,t[a+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,a){let s=i*n;t[s]=o,t[s+1]=r,t[s+2]=a,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,a,s){let c=i*n;t[c]=o,t[c+1]=r,t[c+2]=a,t[c+3]=s,e.needsCommit=!0}}];Es._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]=z1e[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Es.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=G1e(this,i)||t;if(t||!l(this.va)){Uj(this);let a=this.va=[],s=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/s):1;for(let u=0;u<c;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*s);Es._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),a.push({va:new Vn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?s:this._size%s)})}}};function G1e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Es._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let a=0;a<r;++a){let s=o[a];e.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:s.componentDatatype,normalize:s.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+s.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Es.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)V1e(n[i],e,t)};function V1e(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)}}Es.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function Uj(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Es.prototype.isDestroyed=function(){return!1};Es.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 Uj(this),fe(this)};var Zg=Es;function $g(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new _e,this.setValue(e)}Object.defineProperties($g.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});$g.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};$g.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};$g.prototype.equals=function(e){return this===e||e instanceof $g&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};$g.prototype.valueOf=function(){return this._value};$g.prototype.toString=function(){return String(this._value)};var hi=$g;function H1e(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let a=this[t],s=this[n];l(s)&&(s(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),a!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,a)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function W1e(e){return new hi(e)}function j1e(e,t,n){return H1e(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??W1e)}var Ae=j1e;function Qw(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(Qw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),image:Ae("image"),scale:Ae("scale"),pixelOffset:Ae("pixelOffset"),eyeOffset:Ae("eyeOffset"),horizontalOrigin:Ae("horizontalOrigin"),verticalOrigin:Ae("verticalOrigin"),heightReference:Ae("heightReference"),color:Ae("color"),rotation:Ae("rotation"),alignedAxis:Ae("alignedAxis"),sizeInMeters:Ae("sizeInMeters"),width:Ae("width"),height:Ae("height"),scaleByDistance:Ae("scaleByDistance"),translucencyByDistance:Ae("translucencyByDistance"),pixelOffsetScaleByDistance:Ae("pixelOffsetScaleByDistance"),imageSubRegion:Ae("imageSubRegion"),distanceDisplayCondition:Ae("distanceDisplayCondition"),disableDepthTestDistance:Ae("disableDepthTestDistance"),splitDirection:Ae("splitDirection")});Qw.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new Qw(this)};Qw.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var dl=Qw;function WC(){this._array=[],this._hash={}}Object.defineProperties(WC.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});WC.prototype.contains=function(e){return l(this._hash[e])};WC.prototype.set=function(e,t){let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};WC.prototype.get=function(e){return this._hash[e]};WC.prototype.remove=function(e){let t=this._hash[e],n=l(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};WC.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Ft=WC;function Gu(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Gu.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}}});Gu.packedLength=2;Gu.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Gu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Gu),n.near=e[t++],n.far=e[t],n};Gu.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Gu.clone=function(e,t){if(l(e))return l(t)||(t=new Gu),t.near=e.near,t.far=e.far,t};Gu.prototype.clone=function(e){return Gu.clone(this,e)};Gu.prototype.equals=function(e){return Gu.equals(this,e)};var Gt=Gu;function Vf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Vf.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Vf(e.near,e.nearValue,e.far,e.farValue)};Vf.packedLength=4;Vf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Vf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Vf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Vf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Vf.prototype.clone=function(e){return Vf.clone(this,e)};Vf.prototype.equals=function(e){return Vf.equals(this,e)};var Ht=Vf;var jC={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},ot=Object.freeze(jC);function Hf(e){return e===jC.CLAMP_TO_GROUND||e===jC.CLAMP_TO_3D_TILE||e===jC.CLAMP_TO_TERRAIN}function XI(e){return e===jC.RELATIVE_TO_GROUND||e===jC.RELATIVE_TO_3D_TILE||e===jC.RELATIVE_TO_TERRAIN}var Y1e={CENTER:0,LEFT:1,RIGHT:-1},Ni=Object.freeze(Y1e);var q1e={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Yn=Object.freeze(q1e);var K1e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Ct=K1e;function sh(){de.throwInstantiationError()}Object.defineProperties(sh.prototype,{isConstant:{get:de.throwInstantiationError},definitionChanged:{get:de.throwInstantiationError}});sh.prototype.getValue=de.throwInstantiationError;sh.prototype.equals=de.throwInstantiationError;sh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};sh.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!sh.equals(e[i],t[i]))return!1;return!0};sh.isConstant=function(e){return!l(e)||e.isConstant};sh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};sh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};sh.getValueOrClonedDefault=function(e,t,n,i){let o;return l(e)&&(o=e.getValue(t,i)),l(o)||(o=n.clone(o)),o};var q=sh;var X1e={LEFT:-1,NONE:0,RIGHT:1},Qr=Object.freeze(X1e);var J1e=U.WHITE,Z1e=d.ZERO,$1e=ot.NONE,eFe=Q.ZERO,tFe=1,nFe=0,iFe=d.ZERO,oFe=Ni.CENTER,rFe=Yn.CENTER,aFe=!1,sFe=Qr.NONE,cFe=new d,lFe=new U,uFe=new d,fFe=new Q,dFe=new Ht,hFe=new Ht,mFe=new Ht,pFe=new et,AFe=new Gt;function Pre(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function e_(e,t){t.collectionChanged.addEventListener(e_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}e_.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],a=r.entity,s=a._billboard,c,u=r.billboard,f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(a._position,e,cFe),c=q.getValueOrUndefined(s._image,e),f=l(h)&&l(c)),!f){zj(r,a,n);continue}q.isConstant(a._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(a),u.id=a,r.billboard=u,r.textureValue=void 0),u.show=f,u.position=h,u.color=q.getValueOrDefault(s._color,e,J1e,lFe),u.eyeOffset=q.getValueOrDefault(s._eyeOffset,e,Z1e,uFe),u.heightReference=q.getValueOrDefault(s._heightReference,e,$1e),u.pixelOffset=q.getValueOrDefault(s._pixelOffset,e,eFe,fFe),u.scale=q.getValueOrDefault(s._scale,e,tFe),u.rotation=q.getValueOrDefault(s._rotation,e,nFe),u.alignedAxis=q.getValueOrDefault(s._alignedAxis,e,iFe),u.horizontalOrigin=q.getValueOrDefault(s._horizontalOrigin,e,oFe),u.verticalOrigin=q.getValueOrDefault(s._verticalOrigin,e,rFe),u.width=q.getValueOrUndefined(s._width,e),u.height=q.getValueOrUndefined(s._height,e),u.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,dFe),u.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,hFe),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,mFe),u.sizeInMeters=q.getValueOrDefault(s._sizeInMeters,e,aFe),u.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,AFe),u.disableDepthTestDistance=q.getValueOrUndefined(s._disableDepthTestDistance,e),u.splitDirection=q.getValueOrDefault(s._splitDirection,e,sFe),r.textureValue!==c&&(u.image=c,r.textureValue=c);let p=q.getValueOrUndefined(s._imageSubRegion,e,pFe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};e_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Ct.FAILED;let i=n.billboard;if(i.heightReference===ot.NONE)t.center=d.clone(i.position,t.center);else{if(!l(i._clampedPosition))return Ct.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,Ct.DONE};e_.prototype.isDestroyed=function(){return!1};e_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(e_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return fe(this)};e_.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&a.set(r.id,new Pre(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?a.contains(r.id)||a.set(r.id,new Pre(r)):(zj(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],zj(a.get(r.id),r,s),a.remove(r.id)};function zj(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var p1=e_;var gFe=new d;function Tm(e){e=e??V.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Tm.fromDimensions=function(e){e=e??V.EMPTY_OBJECT;let t=e.dimensions,n=d.multiplyByScalar(t,.5,new d);return new Tm({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};Tm.fromAxisAlignedBoundingBox=function(e){return new Tm({minimum:e.minimum,maximum:e.maximum})};Tm.packedLength=2*d.packedLength+1;Tm.pack=function(e,t,n){return n=n??0,d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=e._offsetAttribute??-1,t};var Mre=new d,Nre=new d,Rre={minimum:Mre,maximum:Nre,offsetAttribute:void 0};Tm.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Mre),o=d.unpack(e,t+d.packedLength,Nre),r=e[t+d.packedLength*2];return l(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Rre.offsetAttribute=r===-1?void 0:r,new Tm(Rre))};Tm.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new En,o=new Uint16Array(24),r=new Float64Array(24);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let a=d.subtract(n,t,gFe),s=d.magnitude(a)*.5;if(l(e._offsetAttribute)){let c=r.length,u=e._offsetAttribute===mn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new yt({attributes:i,indices:o,primitiveType:Pe.LINES,boundingSphere:new le(d.ZERO,s),offsetAttribute:e._offsetAttribute})};var Sm=Tm;function JI(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([U.floatToByte(e),U.floatToByte(t),U.floatToByte(n),U.floatToByte(i)])}Object.defineProperties(JI.prototype,{componentDatatype:{get:function(){return j.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});JI.fromColor=function(e){return new JI(e.red,e.green,e.blue,e.alpha)};JI.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};JI.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Jt=JI;function kw(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(kw.prototype,{componentDatatype:{get:function(){return j.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});kw.fromDistanceDisplayCondition=function(e){return new kw(e.near,e.far)};kw.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var $n=kw;function _Fe(e){e=e??V.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Lt=_Fe;function _r(e){e=e??V.EMPTY_OBJECT,this.start=l(e.start)?X.clone(e.start):new X,this.stop=l(e.stop)?X.clone(e.stop):new X,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(_r.prototype,{isEmpty:{get:function(){let e=X.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var ZI={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};_r.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new de("options.iso8601 is an invalid ISO 8601 interval.");let i=X.fromIso8601(n[0]),o=X.fromIso8601(n[1]),r=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=a,t.data=s,t):(ZI.start=i,ZI.stop=o,ZI.isStartIncluded=r,ZI.isStopIncluded=a,ZI.data=s,new _r(ZI))};_r.toIso8601=function(e,t){return`${X.toIso8601(e.start,t)}/${X.toIso8601(e.stop,t)}`};_r.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new _r(e)};_r.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&X.equals(e.start,t.start)&&X.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};_r.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&X.equalsEpsilon(e.start,t.start,n)&&X.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};_r.intersect=function(e,t,n,i){if(!l(t))return _r.clone(_r.EMPTY,n);let o=e.start,r=e.stop,a=t.start,s=t.stop,c=X.greaterThanOrEquals(a,o)&&X.greaterThanOrEquals(r,a),u=!c&&X.lessThanOrEquals(a,o)&&X.lessThanOrEquals(o,s);if(!c&&!u)return _r.clone(_r.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,A=t.isStopIncluded,m=X.lessThan(r,s);return l(n)||(n=new _r),n.start=c?a:o,n.isStartIncluded=f&&p||!X.equals(a,o)&&(c&&p||u&&f),n.stop=m?r:s,n.isStopIncluded=m?h:h&&A||!X.equals(s,r)&&A,n.data=l(i)?i(e.data,t.data):e.data,n};_r.contains=function(e,t){if(e.isEmpty)return!1;let n=X.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=X.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};_r.prototype.clone=function(e){return _r.clone(this,e)};_r.prototype.equals=function(e,t){return _r.equals(this,e,t)};_r.prototype.equalsEpsilon=function(e,t,n){return _r.equalsEpsilon(this,e,t,n)};_r.prototype.toString=function(){return _r.toIso8601(this)};_r.EMPTY=Object.freeze(new _r({start:new X,stop:new X,isStartIncluded:!1,isStopIncluded:!1}));var Rn=_r;var Lre=Object.freeze(X.fromIso8601("0000-01-01T00:00:00Z")),Ore=Object.freeze(X.fromIso8601("9999-12-31T24:00:00Z")),yFe=Object.freeze(new Rn({start:Lre,stop:Ore})),CFe={MINIMUM_VALUE:Lre,MAXIMUM_VALUE:Ore,MAXIMUM_INTERVAL:yFe},Ze=CFe;function Uw(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(Uw.prototype,{componentDatatype:{get:function(){return j.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});Uw.fromCartesian3=function(e){return new Uw(e.x,e.y,e.z)};Uw.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var go=Uw;function A1(e){e=e??!0,this.value=A1.toValue(e)}Object.defineProperties(A1.prototype,{componentDatatype:{get:function(){return j.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});A1.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var wn=A1;var g1=`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 _1=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in vec3 normal;
|
|
in vec3 tangent;
|
|
in vec3 bitangent;
|
|
in vec2 st;
|
|
in float batchId;
|
|
|
|
out vec3 v_positionEC;
|
|
out vec3 v_normalEC;
|
|
out vec3 v_tangentEC;
|
|
out vec3 v_bitangentEC;
|
|
out vec2 v_st;
|
|
|
|
void main()
|
|
{
|
|
vec4 p = czm_computePosition();
|
|
|
|
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
v_tangentEC = czm_normal * tangent; // tangent in eye coordinates
|
|
v_bitangentEC = czm_normal * bitangent; // bitangent in eye coordinates
|
|
v_st = st;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var y1=`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 C1=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in vec3 normal;
|
|
in float batchId;
|
|
|
|
out vec3 v_positionEC;
|
|
out vec3 v_normalEC;
|
|
|
|
void main()
|
|
{
|
|
vec4 p = czm_computePosition();
|
|
|
|
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var E1=`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 I1=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in vec3 normal;
|
|
in vec2 st;
|
|
in float batchId;
|
|
|
|
out vec3 v_positionEC;
|
|
out vec3 v_normalEC;
|
|
out vec2 v_st;
|
|
|
|
void main()
|
|
{
|
|
vec4 p = czm_computePosition();
|
|
|
|
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
v_st = st;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var EFe={ADD:ee.FUNC_ADD,SUBTRACT:ee.FUNC_SUBTRACT,REVERSE_SUBTRACT:ee.FUNC_REVERSE_SUBTRACT,MIN:ee.MIN,MAX:ee.MAX},Lc=Object.freeze(EFe);var IFe={ZERO:ee.ZERO,ONE:ee.ONE,SOURCE_COLOR:ee.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ee.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ee.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ee.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ee.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ee.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ee.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ee.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ee.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ee.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ee.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ee.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ee.SRC_ALPHA_SATURATE},Zo=Object.freeze(IFe);var bFe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Lc.ADD,equationAlpha:Lc.ADD,functionSourceRgb:Zo.SOURCE_ALPHA,functionSourceAlpha:Zo.ONE,functionDestinationRgb:Zo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Lc.ADD,equationAlpha:Lc.ADD,functionSourceRgb:Zo.ONE,functionSourceAlpha:Zo.ONE,functionDestinationRgb:Zo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Lc.ADD,equationAlpha:Lc.ADD,functionSourceRgb:Zo.SOURCE_ALPHA,functionSourceAlpha:Zo.ONE,functionDestinationRgb:Zo.ONE,functionDestinationAlpha:Zo.ONE})},sn=Object.freeze(bFe);var xFe={FRONT:ee.FRONT,BACK:ee.BACK,FRONT_AND_BACK:ee.FRONT_AND_BACK},Li=Object.freeze(xFe);function $I(e){e=e??V.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties($I.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}}});$I.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
|
|
`)};$I.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};$I.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ye(this.renderState,!1);return e?(t.depthMask=!1,t.blending=sn.ALPHA_BLEND):t.depthMask=!0,t};$I.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=sn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Li.BACK}),l(n)&&(i=Pt(n,i,!0)),i};var xo=$I;var b1=`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 x1=`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 T1=`uniform vec4 lightColor;
|
|
uniform vec4 darkColor;
|
|
uniform vec2 repeat;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
vec2 st = materialInput.st;
|
|
|
|
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
|
|
float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0); // 0.0 or 1.0
|
|
|
|
// Find the distance from the closest separator (region between two colors)
|
|
float scaledWidth = fract(repeat.s * st.s);
|
|
scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
|
|
float scaledHeight = fract(repeat.t * st.t);
|
|
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
|
|
float value = min(scaledWidth, scaledHeight);
|
|
|
|
vec4 currentColor = mix(lightColor, darkColor, b);
|
|
vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);
|
|
|
|
color = czm_gammaCorrect(color);
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
|
|
return material;
|
|
}
|
|
`;var S1=`uniform vec4 lightColor;
|
|
uniform vec4 darkColor;
|
|
uniform vec2 repeat;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
// From Stefan Gustavson's Procedural Textures in GLSL in OpenGL Insights
|
|
float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5)); // 0.0 or 1.0
|
|
|
|
vec4 color = mix(lightColor, darkColor, b);
|
|
color = czm_gammaCorrect(color);
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
|
|
return material;
|
|
}
|
|
`;var w1=`uniform sampler2D heights;
|
|
uniform sampler2D colors;
|
|
|
|
// This material expects heights to be sorted from lowest to highest.
|
|
|
|
float getHeight(int idx, float invTexSize)
|
|
{
|
|
vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
|
|
#ifdef OES_texture_float
|
|
return texture(heights, uv).x;
|
|
#else
|
|
return czm_unpackFloat(texture(heights, uv));
|
|
#endif
|
|
}
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
float height = materialInput.height;
|
|
float invTexSize = 1.0 / float(heightsDimensions.x);
|
|
|
|
float minHeight = getHeight(0, invTexSize);
|
|
float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);
|
|
|
|
// early-out when outside the height range
|
|
if (height < minHeight || height > maxHeight) {
|
|
material.diffuse = vec3(0.0);
|
|
material.alpha = 0.0;
|
|
return material;
|
|
}
|
|
|
|
// Binary search to find heights above and below.
|
|
int idxBelow = 0;
|
|
int idxAbove = heightsDimensions.x;
|
|
float heightBelow = minHeight;
|
|
float heightAbove = maxHeight;
|
|
|
|
// while loop not allowed, so use for loop with max iterations.
|
|
// maxIterations of 16 supports a texture size up to 65536 (2^16).
|
|
const int maxIterations = 16;
|
|
for (int i = 0; i < maxIterations; i++) {
|
|
if (idxBelow >= idxAbove - 1) {
|
|
break;
|
|
}
|
|
|
|
int idxMid = (idxBelow + idxAbove) / 2;
|
|
float heightTex = getHeight(idxMid, invTexSize);
|
|
|
|
if (height > heightTex) {
|
|
idxBelow = idxMid;
|
|
heightBelow = heightTex;
|
|
} else {
|
|
idxAbove = idxMid;
|
|
heightAbove = heightTex;
|
|
}
|
|
}
|
|
|
|
float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
|
|
vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
|
|
vec4 color = texture(colors, colorUv);
|
|
|
|
// undo preumultiplied alpha
|
|
if (color.a > 0.0)
|
|
{
|
|
color.rgb /= color.a;
|
|
}
|
|
|
|
color.rgb = czm_gammaCorrect(color.rgb);
|
|
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
return material;
|
|
}
|
|
`;var B1=`uniform vec4 color;
|
|
uniform float spacing;
|
|
uniform float width;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
float distanceToContour = mod(materialInput.height, spacing);
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
float dxc = abs(dFdx(materialInput.height));
|
|
float dyc = abs(dFdy(materialInput.height));
|
|
float dF = max(dxc, dyc) * czm_pixelRatio * width;
|
|
float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
|
|
#else
|
|
// If no derivatives available (IE 10?), use pixel ratio
|
|
float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
|
|
#endif
|
|
|
|
vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
|
|
material.diffuse = outColor.rgb;
|
|
material.alpha = outColor.a;
|
|
|
|
return material;
|
|
}
|
|
`;var D1=`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 v1=`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 P1=`uniform vec4 color;
|
|
uniform float cellAlpha;
|
|
uniform vec2 lineCount;
|
|
uniform vec2 lineThickness;
|
|
uniform vec2 lineOffset;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
vec2 st = materialInput.st;
|
|
|
|
float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
|
|
scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
|
|
float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
|
|
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
|
|
|
|
float value;
|
|
|
|
// Fuzz Factor - Controls blurriness of lines
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
const float fuzz = 1.2;
|
|
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
|
|
|
|
// From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13.
|
|
vec2 dx = abs(dFdx(st));
|
|
vec2 dy = abs(dFdy(st));
|
|
vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
|
|
value = min(
|
|
smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
|
|
smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
|
|
#else
|
|
// If no derivatives available (IE 10?), revert to view-dependent fuzz
|
|
const float fuzz = 0.05;
|
|
|
|
vec2 range = 0.5 - (lineThickness * 0.05);
|
|
value = min(
|
|
1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
|
|
1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
|
|
#endif
|
|
|
|
// Edges taken from RimLightingMaterial.glsl
|
|
// See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
|
|
float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
|
|
float sRim = smoothstep(0.8, 1.0, dRim);
|
|
value *= (1.0 - sRim);
|
|
|
|
vec4 halfColor;
|
|
halfColor.rgb = color.rgb * 0.5;
|
|
halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
|
|
halfColor = czm_gammaCorrect(halfColor);
|
|
material.diffuse = halfColor.rgb;
|
|
material.emission = halfColor.rgb;
|
|
material.alpha = halfColor.a;
|
|
|
|
return material;
|
|
}
|
|
`;var R1=`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 M1=`uniform vec4 color;
|
|
|
|
float getPointOnLine(vec2 p0, vec2 p1, float x)
|
|
{
|
|
float slope = (p0.y - p1.y) / (p0.x - p1.x);
|
|
return slope * (x - p0.x) + p0.y;
|
|
}
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
vec2 st = materialInput.st;
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
|
|
#else
|
|
// If no derivatives available (IE 10?), 2.5% of the line will be the arrow head
|
|
float base = 0.975;
|
|
#endif
|
|
|
|
vec2 center = vec2(1.0, 0.5);
|
|
float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
|
|
float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);
|
|
|
|
float halfWidth = 0.15;
|
|
float s = step(0.5 - halfWidth, st.t);
|
|
s *= 1.0 - step(0.5 + halfWidth, st.t);
|
|
s *= 1.0 - step(base, st.s);
|
|
|
|
float t = step(base, materialInput.st.s);
|
|
t *= 1.0 - step(ptOnUpperLine, st.t);
|
|
t *= step(ptOnLowerLine, st.t);
|
|
|
|
// Find the distance from the closest separator (region between two colors)
|
|
float dist;
|
|
if (st.s < base)
|
|
{
|
|
float d1 = abs(st.t - (0.5 - halfWidth));
|
|
float d2 = abs(st.t - (0.5 + halfWidth));
|
|
dist = min(d1, d2);
|
|
}
|
|
else
|
|
{
|
|
float d1 = czm_infinity;
|
|
if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
|
|
{
|
|
d1 = abs(st.s - base);
|
|
}
|
|
float d2 = abs(st.t - ptOnUpperLine);
|
|
float d3 = abs(st.t - ptOnLowerLine);
|
|
dist = min(min(d1, d2), d3);
|
|
}
|
|
|
|
vec4 outsideColor = vec4(0.0);
|
|
vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
|
|
vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);
|
|
|
|
outColor = czm_gammaCorrect(outColor);
|
|
material.diffuse = outColor.rgb;
|
|
material.alpha = outColor.a;
|
|
return material;
|
|
}
|
|
`;var N1=`uniform vec4 color;
|
|
uniform vec4 gapColor;
|
|
uniform float dashLength;
|
|
uniform float dashPattern;
|
|
in float v_polylineAngle;
|
|
|
|
const float maskLength = 16.0;
|
|
|
|
mat2 rotate(float rad) {
|
|
float c = cos(rad);
|
|
float s = sin(rad);
|
|
return mat2(
|
|
c, s,
|
|
-s, c
|
|
);
|
|
}
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;
|
|
|
|
// Get the relative position within the dash from 0 to 1
|
|
float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
|
|
// Figure out the mask index.
|
|
float maskIndex = floor(dashPosition * maskLength);
|
|
// Test the bit mask.
|
|
float maskTest = floor(dashPattern / pow(2.0, maskIndex));
|
|
vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
|
|
if (fragColor.a < 0.005) { // matches 0/255 and 1/255
|
|
discard;
|
|
}
|
|
|
|
fragColor = czm_gammaCorrect(fragColor);
|
|
material.emission = fragColor.rgb;
|
|
material.alpha = fragColor.a;
|
|
return material;
|
|
}
|
|
`;var L1=`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 O1=`uniform vec4 color;
|
|
uniform vec4 outlineColor;
|
|
uniform float outlineWidth;
|
|
|
|
in float v_width;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
vec2 st = materialInput.st;
|
|
float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
|
|
float b = step(0.5 - halfInteriorWidth, st.t);
|
|
b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
|
|
|
|
// Find the distance from the closest separator (region between two colors)
|
|
float d1 = abs(st.t - (0.5 - halfInteriorWidth));
|
|
float d2 = abs(st.t - (0.5 + halfInteriorWidth));
|
|
float dist = min(d1, d2);
|
|
|
|
vec4 currentColor = mix(outlineColor, color, b);
|
|
vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
|
|
outColor = czm_gammaCorrect(outColor);
|
|
|
|
material.diffuse = outColor.rgb;
|
|
material.alpha = outColor.a;
|
|
|
|
return material;
|
|
}
|
|
`;var F1=`uniform vec4 color;
|
|
uniform vec4 rimColor;
|
|
uniform float width;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
// See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html
|
|
float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
|
|
float s = smoothstep(1.0 - width, 1.0, d);
|
|
|
|
vec4 outColor = czm_gammaCorrect(color);
|
|
vec4 outRimColor = czm_gammaCorrect(rimColor);
|
|
|
|
material.diffuse = outColor.rgb;
|
|
material.emission = outRimColor.rgb * s;
|
|
material.alpha = mix(outColor.a, outRimColor.a, s);
|
|
|
|
return material;
|
|
}
|
|
`;var Q1=`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 k1=`uniform vec4 evenColor;
|
|
uniform vec4 oddColor;
|
|
uniform float offset;
|
|
uniform float repeat;
|
|
uniform bool horizontal;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
// Based on the Stripes Fragment Shader in the Orange Book (11.1.2)
|
|
float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
|
|
float value = fract((coord - offset) * (repeat * 0.5));
|
|
float dist = min(value, min(abs(value - 0.5), 1.0 - value));
|
|
|
|
vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
|
|
vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
|
|
color = czm_gammaCorrect(color);
|
|
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
|
|
return material;
|
|
}
|
|
`;var U1=`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 z1=`// Thanks for the contribution Jonas
|
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
|
|
uniform sampler2D specularMap;
|
|
uniform sampler2D normalMap;
|
|
uniform vec4 baseWaterColor;
|
|
uniform vec4 blendColor;
|
|
uniform float frequency;
|
|
uniform float animationSpeed;
|
|
uniform float amplitude;
|
|
uniform float specularIntensity;
|
|
uniform float fadeFactor;
|
|
|
|
czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
|
|
float time = czm_frameNumber * animationSpeed;
|
|
|
|
// fade is a function of the distance from the fragment and the frequency of the waves
|
|
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
|
|
|
|
float specularMapValue = texture(specularMap, materialInput.st).r;
|
|
|
|
// note: not using directional motion at this time, just set the angle to 0.0;
|
|
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
|
|
vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
|
|
|
|
// fade out the normal perturbation as we move further from the water surface
|
|
normalTangentSpace.xy /= fade;
|
|
|
|
// attempt to fade out the normal perturbation as we approach non water areas (low specular map value)
|
|
normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
|
|
|
|
normalTangentSpace = normalize(normalTangentSpace);
|
|
|
|
// get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane
|
|
float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
|
|
|
|
// fade out water effect as specular map value decreases
|
|
material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
|
|
|
|
// base color is a blend of the water and non-water color based on the value from the specular map
|
|
// may need a uniform blend factor to better control this
|
|
material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
|
|
|
|
// diffuse highlights are based on how perturbed the normal is
|
|
material.diffuse += (0.1 * tsPerturbationRatio);
|
|
|
|
material.diffuse = material.diffuse;
|
|
|
|
material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);
|
|
|
|
material.specular = specularIntensity;
|
|
material.shininess = 10.0;
|
|
|
|
return material;
|
|
}
|
|
`;function $e(e){this.type=void 0,this.autoDestroyOldTexture=e.autoDestroyOldTexture??!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??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??si.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._initializationPromises=[],this._initializationError=void 0,TFe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l($e._uniformList[this.type])||($e._uniformList[this.type]=Object.keys(this._uniforms))}$e._uniformList={};$e.fromType=function(e,t){let n=new $e({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};$e.fromTypeAsync=async function(e,t){let n=[],i=new $e({fabric:{type:e,uniforms:t}});if(kre(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function kre(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];kre(o,t)}}$e.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};$e.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(_){return _.bufferView}),u=u[0]);let h=new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new vt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new vt({context:e,source:u,sampler:h});let A=this._textures[n];l(A)&&A!==this._defaultTexture&&A.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let _=this.uniforms[m];_.x=p._width,_.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let c=r[t];n=c.id;let u=c.images,f=new ta({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let a=this._updateFunctions;for(o=a.length,t=0;t<o;++t)a[t](this,e);let s=this.materials;for(let c in s)s.hasOwnProperty(c)&&s[c].update(e)};$e.prototype.isDestroyed=function(){return!1};$e.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return fe(this)};function TFe(e,t){e=e??V.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Ye(e.fabric??V.EMPTY_OBJECT),t.fabric=Ye(e.fabric??V.EMPTY_OBJECT),t._template.uniforms=Ye(t._template.uniforms??V.EMPTY_OBJECT),t._template.materials=Ye(t._template.materials??V.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=$e._materialCache.getMaterial(t.type);if(l(i)){let r=Ye(i.fabric,!0);t._template=Pt(t._template,r,!0),n=i.translucent}DFe(t),PFe(t),LFe(t),FFe(t),l(i)||$e._materialCache.addMaterial(t.type,t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,l(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function Gj(e,t,n,i){if(l(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function Fre(e,t){}function SFe(e,t){}var wFe=["type","materials","uniforms","components","source"],BFe=["diffuse","specular","shininess","normal","emission","alpha"];function DFe(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;Gj(t,wFe,Fre,!0),Gj(o,BFe,Fre,!0);let r=[];for(let a in i)i.hasOwnProperty(a)&&r.push(a);Gj(n,r,SFe,!1)}function vFe(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 PFe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n}
|
|
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
|
|
{
|
|
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
|
|
`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let a=i&&vFe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${a};
|
|
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
|
|
`:e.shaderSource+=`material.${o} = ${t[o]};
|
|
`}e.shaderSource+=`return material;
|
|
}
|
|
`}}var Qre={mat2:Ki,mat3:J,mat4:P},RFe=/\.ktx2$/i;function MFe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],a=t!==r,s=!l(r)||r===$e.DefaultImageId;t=r;let c=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(a&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let h=new jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new vt({context:i,source:r,sampler:h}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof vt&&r!==c){n._texturePaths[e]=void 0;let h=n._textures[e];l(h)&&h!==n._defaultTexture&&!h.isDestroyed()&&n.autoDestroyOldTexture&&h.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(a&&l(c)&&s&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=c._width,f.y=c._height)),!s){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}Ure(n,e)}}}function Ure(e,t){let i=e.uniforms[t];if(i===$e.DefaultImageId)return Promise.resolve();let o=De.createIfNeeded(i);if(!(o instanceof De))return Promise.resolve();let r=De.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let s;return RFe.test(o.url)?s=ku(o.url):s=o.fetchImage(),Promise.resolve(s).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,s}function NFe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ta){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),zre(t,e)}}function zre(e,t){let i=e.uniforms[t];if(i===$e.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],a=Promise.all(r);return a.then(function(s){e._loadedCubeMaps.push({id:t,images:s})}).catch(function(s){e._initializationError=s}),e._texturePaths[t]=o,a}function LFe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Gre(e,n)}function Gre(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=OFe(o),a;if(r==="channels")a=zw(e,t,o,!1);else{if(r==="sampler2D"){let u=`${t}Dimensions`;QFe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Gre(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(a=zw(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(MFe(t)),e._initializationPromises.push(Ure(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(NFe(t)),e._initializationPromises.push(zre(e,t));else if(r.indexOf("mat")!==-1){let u=new Qre[r];e._uniforms[c]=function(){return Qre[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function OFe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas||e instanceof vt)/^([rgba]){1,4}$/i.test(e)?t="channels":e===$e.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 FFe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new $e({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=Pt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",a=`${r}_${e._count++}`;zw(o,r,a),e.shaderSource=o.shaderSource+e.shaderSource;let s=`${a}(materialInput)`,c=zw(e,i,s)}}function zw(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",a=`([\\w${i?".":""}])?`,s=new RegExp(a+t+r,"g");return e.shaderSource=e.shaderSource.replace(s,function(c,u,f){return u||f?c:(o+=1,n)}),o}function QFe(e,t,n){return zw(e,t,t,n)}$e._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};$e.DefaultImageId="czm_defaultImage";$e.DefaultCubeMapId="czm_defaultCubeMap";$e.ColorType="Color";$e._materialCache.addMaterial($e.ColorType,{fabric:{type:$e.ColorType,uniforms:{color:new U(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});$e.ImageType="Image";$e._materialCache.addMaterial($e.ImageType,{fabric:{type:$e.ImageType,uniforms:{image:$e.DefaultImageId,repeat:new Q(1,1),color:new U(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}});$e.DiffuseMapType="DiffuseMap";$e._materialCache.addMaterial($e.DiffuseMapType,{fabric:{type:$e.DiffuseMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",repeat:new Q(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});$e.AlphaMapType="AlphaMap";$e._materialCache.addMaterial($e.AlphaMapType,{fabric:{type:$e.AlphaMapType,uniforms:{image:$e.DefaultImageId,channel:"a",repeat:new Q(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});$e.SpecularMapType="SpecularMap";$e._materialCache.addMaterial($e.SpecularMapType,{fabric:{type:$e.SpecularMapType,uniforms:{image:$e.DefaultImageId,channel:"r",repeat:new Q(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});$e.EmissionMapType="EmissionMap";$e._materialCache.addMaterial($e.EmissionMapType,{fabric:{type:$e.EmissionMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",repeat:new Q(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});$e.BumpMapType="BumpMap";$e._materialCache.addMaterial($e.BumpMapType,{fabric:{type:$e.BumpMapType,uniforms:{image:$e.DefaultImageId,channel:"r",strength:.8,repeat:new Q(1,1)},source:x1},translucent:!1});$e.NormalMapType="NormalMap";$e._materialCache.addMaterial($e.NormalMapType,{fabric:{type:$e.NormalMapType,uniforms:{image:$e.DefaultImageId,channels:"rgb",strength:.8,repeat:new Q(1,1)},source:R1},translucent:!1});$e.GridType="Grid";$e._materialCache.addMaterial($e.GridType,{fabric:{type:$e.GridType,uniforms:{color:new U(0,1,0,1),cellAlpha:.1,lineCount:new Q(8,8),lineThickness:new Q(1,1),lineOffset:new Q(0,0)},source:P1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});$e.StripeType="Stripe";$e._materialCache.addMaterial($e.StripeType,{fabric:{type:$e.StripeType,uniforms:{horizontal:!0,evenColor:new U(1,1,1,.5),oddColor:new U(0,0,1,.5),offset:0,repeat:5},source:k1},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});$e.CheckerboardType="Checkerboard";$e._materialCache.addMaterial($e.CheckerboardType,{fabric:{type:$e.CheckerboardType,uniforms:{lightColor:new U(1,1,1,.5),darkColor:new U(0,0,0,.5),repeat:new Q(5,5)},source:T1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});$e.DotType="Dot";$e._materialCache.addMaterial($e.DotType,{fabric:{type:$e.DotType,uniforms:{lightColor:new U(1,1,0,.75),darkColor:new U(0,1,1,.75),repeat:new Q(5,5)},source:S1},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});$e.WaterType="Water";$e._materialCache.addMaterial($e.WaterType,{fabric:{type:$e.WaterType,uniforms:{baseWaterColor:new U(.2,.3,.6,1),blendColor:new U(0,1,.699,1),specularMap:$e.DefaultImageId,normalMap:$e.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:z1},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});$e.RimLightingType="RimLighting";$e._materialCache.addMaterial($e.RimLightingType,{fabric:{type:$e.RimLightingType,uniforms:{color:new U(1,0,0,.7),rimColor:new U(1,1,1,.4),width:.3},source:F1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});$e.FadeType="Fade";$e._materialCache.addMaterial($e.FadeType,{fabric:{type:$e.FadeType,uniforms:{fadeInColor:new U(1,0,0,1),fadeOutColor:new U(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new Q(.5,.5)},source:v1},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});$e.PolylineArrowType="PolylineArrow";$e._materialCache.addMaterial($e.PolylineArrowType,{fabric:{type:$e.PolylineArrowType,uniforms:{color:new U(1,1,1,1)},source:M1},translucent:!0});$e.PolylineDashType="PolylineDash";$e._materialCache.addMaterial($e.PolylineDashType,{fabric:{type:$e.PolylineDashType,uniforms:{color:new U(1,0,1,1),gapColor:new U(0,0,0,0),dashLength:16,dashPattern:255},source:N1},translucent:!0});$e.PolylineGlowType="PolylineGlow";$e._materialCache.addMaterial($e.PolylineGlowType,{fabric:{type:$e.PolylineGlowType,uniforms:{color:new U(0,.5,1,1),glowPower:.25,taperPower:1},source:L1},translucent:!0});$e.PolylineOutlineType="PolylineOutline";$e._materialCache.addMaterial($e.PolylineOutlineType,{fabric:{type:$e.PolylineOutlineType,uniforms:{color:new U(1,1,1,1),outlineColor:new U(1,0,0,1),outlineWidth:1},source:O1},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});$e.ElevationContourType="ElevationContour";$e._materialCache.addMaterial($e.ElevationContourType,{fabric:{type:$e.ElevationContourType,uniforms:{spacing:100,color:new U(1,0,0,1),width:1},source:B1},translucent:!1});$e.ElevationRampType="ElevationRamp";$e._materialCache.addMaterial($e.ElevationRampType,{fabric:{type:$e.ElevationRampType,uniforms:{image:$e.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:D1},translucent:!1});$e.SlopeRampMaterialType="SlopeRamp";$e._materialCache.addMaterial($e.SlopeRampMaterialType,{fabric:{type:$e.SlopeRampMaterialType,uniforms:{image:$e.DefaultImageId},source:Q1},translucent:!1});$e.AspectRampMaterialType="AspectRamp";$e._materialCache.addMaterial($e.AspectRampMaterialType,{fabric:{type:$e.AspectRampMaterialType,uniforms:{image:$e.DefaultImageId},source:b1},translucent:!1});$e.ElevationBandType="ElevationBand";$e._materialCache.addMaterial($e.ElevationBandType,{fabric:{type:$e.ElevationBandType,uniforms:{heights:$e.DefaultImageId,colors:$e.DefaultImageId},source:w1},translucent:!0});$e.WaterMaskType="WaterMask";$e._materialCache.addMaterial($e.WaterMaskType,{fabric:{type:$e.WaterMaskType,source:U1,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var Xi=$e;function YC(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??YC.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=xo.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(YC.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}}});YC.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;YC.prototype.isTranslucent=xo.prototype.isTranslucent;YC.prototype.getRenderState=xo.prototype.getRenderState;YC.MaterialSupport={BASIC:Object.freeze({vertexFormat:ke.POSITION_AND_NORMAL,vertexShaderSource:C1,fragmentShaderSource:y1}),TEXTURED:Object.freeze({vertexFormat:ke.POSITION_NORMAL_AND_ST,vertexShaderSource:I1,fragmentShaderSource:E1}),ALL:Object.freeze({vertexFormat:ke.ALL,vertexShaderSource:_1,fragmentShaderSource:g1})};var _o=YC;var G1=`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 V1=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in vec3 normal;
|
|
in vec4 color;
|
|
in float batchId;
|
|
|
|
out vec3 v_positionEC;
|
|
out vec3 v_normalEC;
|
|
out vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
vec4 p = czm_computePosition();
|
|
|
|
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
v_normalEC = czm_normal * normal; // normal in eye coordinates
|
|
v_color = color;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;var eb=`in vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
}
|
|
`;var H1=`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 lA(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?H1:V1,r=i?eb:G1,a=i?lA.FLAT_VERTEX_FORMAT:lA.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=a,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(lA.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}}});lA.VERTEX_FORMAT=ke.POSITION_AND_NORMAL;lA.FLAT_VERTEX_FORMAT=ke.POSITION_ONLY;lA.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;lA.prototype.isTranslucent=xo.prototype.isTranslucent;lA.prototype.getRenderState=xo.prototype.getRenderState;var gn=lA;function tb(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(tb.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color")});tb.prototype.getType=function(e){return"Color"};var kFe=new X;tb.prototype.getValue=function(e,t){return l(e)||(e=X.now(kFe)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};tb.prototype.equals=function(e){return this===e||e instanceof tb&&q.equals(this._color,e._color)};var Kt=tb;function t_(e){e=e??V.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new qi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(t_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});t_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};t_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};t_.prototype.rectangleToNativeRectangle=function(e,t){let n=D.toDegrees(e.west),i=D.toDegrees(e.south),o=D.toDegrees(e.east),r=D.toDegrees(e.north);return l(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};t_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o};t_.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),a=this.getNumberOfYTilesAtLevel(n),s=o.width/r,c=e*s+o.west,u=(e+1)*s+o.west,f=o.height/a,h=o.north-t*f,p=o.north-(t+1)*f;return l(i)||(i=new ce(c,p,u,h)),i.west=c,i.south=p,i.east=u,i.north=h,i};t_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=i.width/o,s=i.height/r,c=e.longitude;i.east<i.west&&(c+=D.TWO_PI);let u=(c-i.west)/a|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/s|0;return f>=r&&(f=r-1),l(n)?(n.x=u,n.y=f,n):new Q(u,f)};var Ji=t_;var Vre=new d,Hre=new d,Wre=new me,Vj=new d,UFe=new d,jre=new le,zFe=new Ji,Gw=[new me,new me,new me,new me],Vw=new Q,ga={};ga.initialize=function(){let e=ga._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){ga._terrainHeights=t}),ga._initPromise=e),e};ga.getMinimumMaximumHeights=function(e,t){t=t??te.default;let n=Yre(e),i=ga._defaultMinTerrainHeight,o=ga._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,a=ga._terrainHeights[r];l(a)&&(i=a[0],o=a[1]),t.cartographicToCartesian(ce.northeast(e,Wre),Vre),t.cartographicToCartesian(ce.southwest(e,Wre),Hre),d.midpoint(Hre,Vre,Vj);let s=t.scaleToGeodeticSurface(Vj,UFe);if(l(s)){let c=d.distance(Vj,s);i=Math.min(i,-c)}else i=ga._defaultMinTerrainHeight}return i=Math.max(ga._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};ga.getBoundingSphere=function(e,t){t=t??te.default;let n=Yre(e),i=ga._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,a=ga._terrainHeights[r];l(a)&&(i=a[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,jre),le.union(o,jre,o)};function Yre(e){me.fromRadians(e.east,e.north,0,Gw[0]),me.fromRadians(e.west,e.north,0,Gw[1]),me.fromRadians(e.east,e.south,0,Gw[2]),me.fromRadians(e.west,e.south,0,Gw[3]);let t=0,n=0,i=0,o=0,r=ga._terrainHeightsMaxLevel,a;for(a=0;a<=r;++a){let s=!1;for(let c=0;c<4;++c){let u=Gw[c];if(zFe.positionToTileXY(u,a,Vw),c===0)i=Vw.x,o=Vw.y;else if(i!==Vw.x||o!==Vw.y){s=!0;break}}if(s)break;t=i,n=o}if(a!==0)return{x:t,y:n,level:a>r?r:a-1}}ga._terrainHeightsMaxLevel=6;ga._defaultMaxTerrainHeight=9e3;ga._defaultMinTerrainHeight=-1e5;ga._terrainHeights=void 0;ga._initPromise=void 0;Object.defineProperties(ga,{initialized:{get:function(){return l(ga._terrainHeights)}}});var vi=ga;function zs(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),l(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}zs.fromCorners=function(e,t,n){return l(n)||(n=new zs),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};zs.fromPoints=function(e,t){if(l(t)||(t=new zs),!l(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,a=e[0].y,s=e[0].z,c=e.length;for(let h=1;h<c;h++){let p=e[h],A=p.x,m=p.y,_=p.z;n=Math.min(A,n),r=Math.max(A,r),i=Math.min(m,i),a=Math.max(m,a),o=Math.min(_,o),s=Math.max(_,s)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=a,f.z=s,t.center=d.midpoint(u,f,t.center),t};zs.clone=function(e,t){if(l(e))return l(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new zs(e.minimum,e.maximum,e.center)};zs.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var W1=new d;zs.intersectPlane=function(e,t){W1=d.subtract(e.maximum,e.minimum,W1);let n=d.multiplyByScalar(W1,.5,W1),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?Xt.INSIDE:r+o<0?Xt.OUTSIDE:Xt.INTERSECTING};zs.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};zs.prototype.clone=function(e){return zs.clone(this,e)};zs.prototype.intersectPlane=function(e){return zs.intersectPlane(this,e)};zs.prototype.intersectAxisAlignedBoundingBox=function(e){return zs.intersectAxisAlignedBoundingBox(this,e)};zs.prototype.equals=function(e){return zs.equals(this,e)};var Wf=zs;var Hj=new ie;function wm(e,t){t=t??te.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(P.getColumn(n,0,Hj)),this._yAxis=d.fromCartesian4(P.getColumn(n,1,Hj));let i=d.fromCartesian4(P.getColumn(n,2,Hj));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(wm.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 GFe=new Wf;wm.fromPoints=function(e,t){let n=Wf.fromPoints(e,GFe);return new wm(n.center,t)};var qre=new In,j1=new d;wm.prototype.projectPointOntoPlane=function(e,t){let n=qre;n.origin=e,d.normalize(e,n.direction);let i=di.rayPlane(n,this._plane,j1);if(l(i)||(d.negate(n.direction,n.direction),i=di.rayPlane(n,this._plane,j1)),l(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),a=d.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=a,t):new Q(r,a)}};wm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);l(r)&&(t[n]=r,n++)}return t.length=n,t};wm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new Q);let n=qre;n.origin=e,d.clone(this._plane.normal,n.direction);let i=di.rayPlane(n,this._plane,j1);l(i)||(d.negate(n.direction,n.direction),i=di.rayPlane(n,this._plane,j1));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),a=d.dot(this._yAxis,o);return t.x=r,t.y=a,t};wm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var VFe=new d;wm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,a=VFe;return d.multiplyByScalar(o,e.x,a),t=d.add(i,a,t),d.multiplyByScalar(r,e.y,a),d.add(t,a,t),n.scaleToGeocentricSurface(t,t),t};wm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Fa=wm;function Zi(e,t){this.center=d.clone(e??d.ZERO),this.halfAxes=J.clone(t??J.ZERO)}Zi.packedLength=d.packedLength+J.packedLength;Zi.pack=function(e,t,n){return n=n??0,d.pack(e.center,t,n),J.pack(e.halfAxes,t,n+d.packedLength),t};Zi.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Zi),d.unpack(e,t,n.center),J.unpack(e,t+d.packedLength,n.halfAxes),n};var HFe=new d,WFe=new d,jFe=new d,YFe=new d,qFe=new d,KFe=new d,XFe=new J,JFe={unitary:new J,diagonal:new J};Zi.fromPoints=function(e,t){if(l(t)||(t=new Zi),!l(e)||e.length===0)return t.halfAxes=J.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],HFe);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let a=0,s=0,c=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,WFe),a+=p.x*p.x,s+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;a*=r,s*=r,c*=r,u*=r,f*=r,h*=r;let A=XFe;A[0]=a,A[1]=s,A[2]=c,A[3]=s,A[4]=u,A[5]=f,A[6]=c,A[7]=f,A[8]=h;let m=J.computeEigenDecomposition(A,JFe),_=J.clone(m.unitary,t.halfAxes),y=J.getColumn(_,0,YFe),C=J.getColumn(_,1,qFe),E=J.getColumn(_,2,KFe),I=-Number.MAX_VALUE,x=-Number.MAX_VALUE,S=-Number.MAX_VALUE,w=Number.MAX_VALUE,v=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],I=Math.max(d.dot(y,p),I),x=Math.max(d.dot(C,p),x),S=Math.max(d.dot(E,p),S),w=Math.min(d.dot(y,p),w),v=Math.min(d.dot(C,p),v),R=Math.min(d.dot(E,p),R);y=d.multiplyByScalar(y,.5*(w+I),y),C=d.multiplyByScalar(C,.5*(v+x),C),E=d.multiplyByScalar(E,.5*(R+S),E);let N=d.add(y,C,t.center);d.add(N,E,N);let L=jFe;return L.x=I-w,L.y=x-v,L.z=S-R,d.multiplyByScalar(L,.5,L),J.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var eae=new d,ZFe=new d;function Kre(e,t,n,i,o,r,a,s,c,u,f){l(f)||(f=new Zi);let h=f.halfAxes;J.setColumn(h,0,t,h),J.setColumn(h,1,n,h),J.setColumn(h,2,i,h);let p=eae;p.x=(o+r)/2,p.y=(a+s)/2,p.z=(c+u)/2;let A=ZFe;A.x=(r-o)/2,A.y=(s-a)/2,A.z=(u-c)/2;let m=f.center;return p=J.multiplyByVector(h,p,p),d.add(e,p,m),J.multiplyByScale(h,A,h),f}var Xre=new me,$Fe=new d,eQe=new me,tQe=new me,nQe=new me,iQe=new me,oQe=new me,rQe=new d,Jre=new d,aQe=new d,Zre=new d,sQe=new d,cQe=new Q,lQe=new Q,uQe=new Q,fQe=new Q,dQe=new Q,hQe=new d,mQe=new d,pQe=new d,AQe=new d,gQe=new Q,_Qe=new d,yQe=new d,CQe=new d,EQe=new cn(d.UNIT_X,0);Zi.fromRectangle=function(e,t,n,i,o){t=t??0,n=n??0,i=i??te.default;let r,a,s,c,u,f,h;if(e.width<=D.PI){let v=ce.center(e,Xre),R=i.cartographicToCartesian(v,$Fe),N=new Fa(R,i);h=N.plane;let L=v.longitude,g=e.south<0&&e.north>0?0:v.latitude,b=me.fromRadians(L,e.north,n,eQe),T=me.fromRadians(e.west,e.north,n,tQe),B=me.fromRadians(e.west,g,n,nQe),M=me.fromRadians(e.west,e.south,n,iQe),O=me.fromRadians(L,e.south,n,oQe),G=i.cartographicToCartesian(b,rQe),k=i.cartographicToCartesian(T,Jre),z=i.cartographicToCartesian(B,aQe),F=i.cartographicToCartesian(M,Zre),H=i.cartographicToCartesian(O,sQe),Y=N.projectPointToNearestOnPlane(G,cQe),$=N.projectPointToNearestOnPlane(k,lQe),W=N.projectPointToNearestOnPlane(z,uQe),K=N.projectPointToNearestOnPlane(F,fQe),Z=N.projectPointToNearestOnPlane(H,dQe);return r=Math.min($.x,W.x,K.x),a=-r,c=Math.max($.y,Y.y),s=Math.min(K.y,Z.y),T.height=M.height=t,k=i.cartographicToCartesian(T,Jre),F=i.cartographicToCartesian(M,Zre),u=Math.min(cn.getPointDistance(h,k),cn.getPointDistance(h,F)),f=n,Kre(N.origin,N.xAxis,N.yAxis,N.zAxis,r,a,s,c,u,f,o)}let p=e.south>0,A=e.north<0,m=p?e.south:A?e.north:0,_=ce.center(e,Xre).longitude,y=d.fromRadians(_,m,n,i,hQe);y.z=0;let E=Math.abs(y.x)<D.EPSILON10&&Math.abs(y.y)<D.EPSILON10?d.UNIT_X:d.normalize(y,mQe),I=d.UNIT_Z,x=d.cross(E,I,pQe);h=cn.fromPointNormal(y,E,EQe);let S=d.fromRadians(_+D.PI_OVER_TWO,m,n,i,AQe);a=d.dot(cn.projectPointOntoPlane(h,S,gQe),x),r=-a,c=d.fromRadians(0,e.north,A?t:n,i,_Qe).z,s=d.fromRadians(0,e.south,p?t:n,i,yQe).z;let w=d.fromRadians(e.east,m,n,i,CQe);return u=cn.getPointDistance(h,w),f=0,Kre(y,x,I,E,r,a,s,c,u,f,o)};Zi.fromTransformation=function(e,t){return l(t)||(t=new Zi),t.center=P.getTranslation(e,t.center),t.halfAxes=P.getMatrix3(e,t.halfAxes),t.halfAxes=J.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Zi.clone=function(e,t){if(l(e))return l(t)?(d.clone(e.center,t.center),J.clone(e.halfAxes,t.halfAxes),t):new Zi(e.center,e.halfAxes)};Zi.intersectPlane=function(e,t){let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,a=i.y,s=i.z,c=Math.abs(r*o[J.COLUMN0ROW0]+a*o[J.COLUMN0ROW1]+s*o[J.COLUMN0ROW2])+Math.abs(r*o[J.COLUMN1ROW0]+a*o[J.COLUMN1ROW1]+s*o[J.COLUMN1ROW2])+Math.abs(r*o[J.COLUMN2ROW0]+a*o[J.COLUMN2ROW1]+s*o[J.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-c?Xt.OUTSIDE:u>=c?Xt.INSIDE:Xt.INTERSECTING};var tae=new d,nae=new d,iae=new d,IQe=new d,$re=new d,bQe=new d;Zi.distanceSquaredTo=function(e,t){let n=d.subtract(t,e.center,eae),i=e.halfAxes,o=J.getColumn(i,0,tae),r=J.getColumn(i,1,nae),a=J.getColumn(i,2,iae),s=d.magnitude(o),c=d.magnitude(r),u=d.magnitude(a),f=!0,h=!0,p=!0;s>0?d.divideByScalar(o,s,o):f=!1,c>0?d.divideByScalar(r,c,r):h=!1,u>0?d.divideByScalar(a,u,a):p=!1;let A=!f+!h+!p,m,_,y;if(A===1){let x=o;m=r,_=a,h?p||(x=a,_=o):(x=r,m=o),y=d.cross(m,_,$re),x===o?o=y:x===r?r=y:x===a&&(a=y)}else if(A===2){m=o,h?m=r:p&&(m=a);let x=d.UNIT_Y;x.equalsEpsilon(m,D.EPSILON3)&&(x=d.UNIT_X),_=d.cross(m,x,IQe),d.normalize(_,_),y=d.cross(m,_,$re),d.normalize(y,y),m===o?(r=_,a=y):m===r?(a=_,o=y):m===a&&(o=_,r=y)}else A===3&&(o=d.UNIT_X,r=d.UNIT_Y,a=d.UNIT_Z);let C=bQe;C.x=d.dot(n,o),C.y=d.dot(n,r),C.z=d.dot(n,a);let E=0,I;return C.x<-s?(I=C.x+s,E+=I*I):C.x>s&&(I=C.x-s,E+=I*I),C.y<-c?(I=C.y+c,E+=I*I):C.y>c&&(I=C.y-c,E+=I*I),C.z<-u?(I=C.z+u,E+=I*I):C.z>u&&(I=C.z-u,E+=I*I),E};var xQe=new d,TQe=new d;Zi.computePlaneDistances=function(e,t,n,i){l(i)||(i=new ea);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=e.center,s=e.halfAxes,c=J.getColumn(s,0,tae),u=J.getColumn(s,1,nae),f=J.getColumn(s,2,iae),h=d.add(c,u,xQe);d.add(h,f,h),d.add(h,a,h);let p=d.subtract(h,t,TQe),A=d.dot(n,p);return o=Math.min(A,o),r=Math.max(A,r),d.add(a,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.add(a,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.add(a,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),d.subtract(a,c,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),A=d.dot(n,p),o=Math.min(A,o),r=Math.max(A,r),i.start=o,i.stop=r,i};var SQe=new d,wQe=new d,BQe=new d;Zi.computeCorners=function(e,t){l(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=J.getColumn(i,0,SQe),r=J.getColumn(i,1,wQe),a=J.getColumn(i,2,BQe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],a,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],a,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],a,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],a,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],a,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],a,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],a,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],a,t[7]),t};var DQe=new J;Zi.computeTransformation=function(e,t){l(t)||(t=new P);let n=e.center,i=J.multiplyByUniformScale(e.halfAxes,2,DQe);return P.fromRotationTranslation(i,n,t)};var vQe=new le;Zi.isOccluded=function(e,t){let n=le.fromOrientedBoundingBox(e,vQe);return!t.isBoundingSphereVisible(n)};Zi.prototype.intersectPlane=function(e){return Zi.intersectPlane(this,e)};Zi.prototype.distanceSquaredTo=function(e){return Zi.distanceSquaredTo(this,e)};Zi.prototype.computePlaneDistances=function(e,t,n){return Zi.computePlaneDistances(this,e,t,n)};Zi.prototype.computeCorners=function(e){return Zi.computeCorners(this,e)};Zi.prototype.computeTransformation=function(e){return Zi.computeTransformation(this,e)};Zi.prototype.isOccluded=function(e){return Zi.isOccluded(this,e)};Zi.equals=function(e,t){return e===t||l(e)&&l(t)&&d.equals(e.center,t.center)&&J.equals(e.halfAxes,t.halfAxes)};Zi.prototype.clone=function(e){return Zi.clone(this,e)};Zi.prototype.equals=function(e){return Zi.equals(this,e)};var en=Zi;var Y1={};Y1.getHeight=function(e,t,n){return(e-n)*t+n};var PQe=new me;Y1.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,PQe);if(!l(r))return d.clone(e,o);let a=Y1.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,a,t,o)};var To=Y1;var q1=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in float batchId;
|
|
|
|
#ifdef EXTRUDED_GEOMETRY
|
|
in vec3 extrudeDirection;
|
|
|
|
uniform float u_globeMinimumAltitude;
|
|
#endif // EXTRUDED_GEOMETRY
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
out vec4 v_color;
|
|
#endif // PER_INSTANCE_COLOR
|
|
|
|
#ifdef TEXTURE_COORDINATES
|
|
#ifdef SPHERICAL
|
|
out vec4 v_sphericalExtents;
|
|
#else // SPHERICAL
|
|
out vec2 v_inversePlaneExtents;
|
|
out vec4 v_westPlane;
|
|
out vec4 v_southPlane;
|
|
#endif // SPHERICAL
|
|
out vec3 v_uvMinAndSphericalLongitudeRotation;
|
|
out vec3 v_uMaxAndInverseDistance;
|
|
out vec3 v_vMaxAndInverseDistance;
|
|
#endif // TEXTURE_COORDINATES
|
|
|
|
void main()
|
|
{
|
|
vec4 position = czm_computePosition();
|
|
|
|
#ifdef EXTRUDED_GEOMETRY
|
|
float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
|
|
delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;
|
|
|
|
//extrudeDirection is zero for the top layer
|
|
position = position + vec4(extrudeDirection * delta, 0.0);
|
|
#endif
|
|
|
|
#ifdef TEXTURE_COORDINATES
|
|
#ifdef SPHERICAL
|
|
v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
|
|
v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
|
|
#else // SPHERICAL
|
|
#ifdef COLUMBUS_VIEW_2D
|
|
vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
|
|
vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);
|
|
|
|
// If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w):
|
|
// - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts)
|
|
// - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w)
|
|
// - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow)
|
|
vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
|
|
bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
|
|
planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
|
|
planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);
|
|
|
|
// - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0)
|
|
// - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x)
|
|
// - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow)
|
|
idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
|
|
idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
|
|
planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
|
|
planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);
|
|
|
|
vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
|
|
vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
|
|
vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
|
|
#else // COLUMBUS_VIEW_2D
|
|
// 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction
|
|
vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
|
|
vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
|
|
vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
|
|
#endif // COLUMBUS_VIEW_2D
|
|
|
|
vec3 eastWard = southEastCorner - southWestCorner;
|
|
float eastExtent = length(eastWard);
|
|
eastWard /= eastExtent;
|
|
|
|
vec3 northWard = northWestCorner - southWestCorner;
|
|
float northExtent = length(northWard);
|
|
northWard /= northExtent;
|
|
|
|
v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
|
|
v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
|
|
v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
|
|
#endif // SPHERICAL
|
|
vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
|
|
vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);
|
|
|
|
v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
|
|
v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
|
|
v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
|
|
#endif // TEXTURE_COORDINATES
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
v_color = czm_batchTable_color(batchId);
|
|
#endif
|
|
|
|
gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
|
|
}
|
|
`;var qC=`#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 oae={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};oae.NUMBER_OF_CLASSIFICATION_TYPES=3;var ei=Object.freeze(oae);var RQe={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS},hc=Object.freeze(RQe);function MQe(e,t){let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var K1=MQe;function uA(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=NQe(t),o=e.floatingPointTexture,r=i===He.FLOAT&&!o,a=LQe(t,r),s=OQe(a,t,r),c=Math.floor(Nt.maximumTextureSize/s),u=Math.min(n,c),f=s*u,h=Math.ceil(n/u),p=1/f,A=p*.5,m=1/h,_=m*.5;this._textureDimensions=new Q(f,h),this._textureStep=new ie(p,A,m,_),this._pixelDatatype=r?He.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=a,this._stride=s,this._texture=void 0;let y=4*f*h;this._batchValues=i===He.FLOAT&&!r?new Float32Array(y):new Uint8Array(y),this._batchValuesDirty=!1}Object.defineProperties(uA.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function NQe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==j.UNSIGNED_BYTE){t=!0;break}return t?He.FLOAT:He.UNSIGNED_BYTE}function aae(e,t){let n=e[t].componentsPerAttribute;return n===2?Q:n===3?d:n===4?ie:Number}function LQe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r].componentDatatype;n[r]=i,s!==j.UNSIGNED_BYTE&&t?i+=4:++i}return n}function OQe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==j.UNSIGNED_BYTE&&n?o+4:o+1}var Hw=new ie;function FQe(e,t,n){let i=ie.unpack(e,t,Hw),o=ie.unpackFloat(i);i=ie.unpack(e,t+4,Hw);let r=ie.unpackFloat(i);i=ie.unpack(e,t+8,Hw);let a=ie.unpackFloat(i);i=ie.unpack(e,t+12,Hw);let s=ie.unpackFloat(i);return ie.fromElements(o,r,a,s,n)}function QQe(e,t,n){let i=ie.packFloat(e.x,Hw);ie.pack(i,t,n),i=ie.packFloat(e.y,i),ie.pack(i,t,n+4),i=ie.packFloat(e.z,i),ie.pack(i,t,n+8),i=ie.packFloat(e.w,i),ie.pack(i,t,n+12)}var rae=new ie;uA.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,o=this._offsets[t],a=4*this._stride*e+4*o,s;this._packFloats&&i[t].componentDatatype!==He.UNSIGNED_BYTE?s=FQe(this._batchValues,a,rae):s=ie.unpack(this._batchValues,a,rae);let c=aae(i,t);return l(c.fromCartesian4)?c.fromCartesian4(s,n):l(c.clone)?c.clone(s,n):s.x};var kQe=[void 0,void 0,new Q,new d,new ie],UQe=new ie;uA.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,o=kQe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),a=aae(this._attributes,t);if(l(a.equals)?a.equals(r,n):r===n)return;let c=UQe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==He.UNSIGNED_BYTE?QQe(c,this._batchValues,h):ie.pack(c,this._batchValues,h),this._batchValuesDirty=!0};function zQe(e,t){let n=e._textureDimensions;e._texture=new vt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:jt.NEAREST,flipY:!1})}function GQe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}uA.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||zQe(this,e.context),GQe(this))};uA.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Pt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function VQe(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 HQe(e){return e===1?"float":`vec${e}`}function WQe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function jQe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,a=HQe(o),s=WQe(o),c=e._offsets[t],u=`${a} ${r}(float batchId)
|
|
{
|
|
vec2 st = computeSt(batchId);
|
|
st.x += batchTextureStep.x * float(${c});
|
|
`;return e._packFloats&&i.componentDatatype!==He.UNSIGNED_BYTE?u+=`vec4 textureValue;
|
|
textureValue.x = czm_unpackFloat(texture(batchTexture, st));
|
|
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
|
|
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
|
|
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
|
|
`:u+=` vec4 textureValue = texture(batchTexture, st);
|
|
`,u+=` ${a} value = textureValue${s};
|
|
`,e._pixelDatatype===He.UNSIGNED_BYTE&&i.componentDatatype===j.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
|
|
`:e._pixelDatatype===He.FLOAT&&i.componentDatatype===j.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
|
|
`),u+=` return value;
|
|
}
|
|
`,u}uA.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
|
|
`;t+=`${VQe(this)}
|
|
`;let n=e.length;for(let i=0;i<n;++i)t+=jQe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),a=i.substring(o);return`${r}
|
|
${t}
|
|
${a}`}};uA.prototype.isDestroyed=function(){return!1};uA.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var nb=uA;function Xl(e){this._ellipsoid=e??te.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Xl.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});Xl.mercatorAngleToGeodeticLatitude=function(e){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};Xl.geodeticLatitudeToMercatorAngle=function(e){e>Xl.MaximumLatitude?e=Xl.MaximumLatitude:e<-Xl.MaximumLatitude&&(e=-Xl.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};Xl.MaximumLatitude=Xl.mercatorAngleToGeodeticLatitude(Math.PI);Xl.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=Xl.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return l(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};Xl.prototype.unproject=function(e,t){let n=this._oneOverSemimajorAxis,i=e.x*n,o=Xl.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return l(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new me(i,o,r)};var mi=Xl;function YQe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let a=e[0].modelMatrix;for(r=1;r<o;++r)if(!P.equals(a,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)l(e[r].geometry)&&jn.transformToWorldCoordinates(e[r]);else P.multiplyTransformation(t,e[0].modelMatrix,t)}function Wj(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let a=0;a<o;++a)r[a]=t}function qQe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?Wj(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(Wj(i.westHemisphereGeometry,n),Wj(i.eastHemisphereGeometry,n))}}function KQe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,a=e.compressVertices,s=e.modelMatrix,c,u,f,h=t.length;for(c=0;c<h;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(YQe(t,s,o),!o)for(c=0;c<h;++c)l(t[c].geometry)&&jn.splitLongitude(t[c]);if(qQe(t),r)for(c=0;c<h;++c){let A=t[c];l(A.geometry)?(jn.reorderForPostVertexCache(A.geometry),jn.reorderForPreVertexCache(A.geometry)):l(A.westHemisphereGeometry)&&l(A.eastHemisphereGeometry)&&(jn.reorderForPostVertexCache(A.westHemisphereGeometry),jn.reorderForPreVertexCache(A.westHemisphereGeometry),jn.reorderForPostVertexCache(A.eastHemisphereGeometry),jn.reorderForPreVertexCache(A.eastHemisphereGeometry))}let p=jn.combineInstances(t);for(h=p.length,c=0;c<h;++c){u=p[c];let A=u.attributes;if(o)for(let m in A)A.hasOwnProperty(m)&&A[m].componentDatatype===j.DOUBLE&&jn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in A)if(A.hasOwnProperty(m)&&A[m].componentDatatype===j.DOUBLE){let _=`${m}3D`,y=`${m}2D`;jn.projectTo2D(u,m,_,y,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),jn.encodeAttribute(u,_,`${_}High`,`${_}Low`),jn.encodeAttribute(u,y,`${y}High`,`${y}Low`)}a&&jn.compressVertices(u)}if(!i){let A=[];for(h=p.length,c=0;c<h;++c)u=p[c],A=A.concat(jn.fitToUnsignedShortIndices(u));p=A}return p}function jj(e,t,n,i){let o,r,a,s=i.length-1;if(s>=0){let u=i[s];o=u.offset+u.count,a=u.index,r=n[a].indices.length}else o=0,a=0,r=n[a].indices.length;let c=e.length;for(let u=0;u<c;++u){let h=e[u][t];if(!l(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++a].indices.length),i.push({index:a,offset:o,count:p}),o+=p}}function XQe(e,t){let n=[];return jj(e,"geometry",t,n),jj(e,"westHemisphereGeometry",t,n),jj(e,"eastHemisphereGeometry",t,n),n}var fA={};fA.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,a,s=!1;o>0&&(t=KQe(e),t.length>0&&(n=jn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=XQe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(a=new Array(o),s=!0));let c=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,s&&(a[f]=h.geometry.offsetAttribute));let A=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;l(A)&&l(m)&&(l(A.boundingSphere)&&l(m.boundingSphere)&&(c[f]=le.union(A.boundingSphere,m.boundingSphere)),l(A.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=le.union(A.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:a,boundingSpheres:c,boundingSpheresCV:u}};function JQe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];l(o)&&l(o.values)&&t.push(o.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function ZQe(e,t){let n=e.length;for(let i=0;i<n;++i)JQe(e[i],t)}function $Qe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!l(o))continue;let r=o.attributes;t+=7+2*le.packedLength+(l(o.indices)?o.indices.length:0);for(let a in r)if(r.hasOwnProperty(a)&&l(r[a])){let s=r[a];t+=5+s.values.length}}return t}fA.packCreateGeometryResults=function(e,t){let n=new Float64Array($Qe(e)),i=[],o={},r=e.length,a=0;n[a++]=r;for(let s=0;s<r;s++){let c=e[s],u=l(c);if(n[a++]=u?1:0,!u)continue;n[a++]=c.primitiveType,n[a++]=c.geometryType,n[a++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[a++]=f,f&&le.pack(c.boundingSphere,n,a),a+=le.packedLength;let h=l(c.boundingSphereCV)?1:0;n[a++]=h,h&&le.pack(c.boundingSphereCV,n,a),a+=le.packedLength;let p=c.attributes,A=[];for(let _ in p)p.hasOwnProperty(_)&&l(p[_])&&(A.push(_),l(o[_])||(o[_]=i.length,i.push(_)));n[a++]=A.length;for(let _=0;_<A.length;_++){let y=A[_],C=p[y];n[a++]=o[y],n[a++]=C.componentDatatype,n[a++]=C.componentsPerAttribute,n[a++]=C.normalize?1:0,n[a++]=C.values.length,n.set(C.values,a),a+=C.values.length}let m=l(c.indices)?c.indices.length:0;n[a++]=m,m>0&&(n.set(c.indices,a),a+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};fA.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,a=1;for(;a<n.length;){if(!(n[a++]===1)){o[r++]=void 0;continue}let c=n[a++],u=n[a++],f=n[a++];f===-1&&(f=void 0);let h,p;n[a++]===1&&(h=le.unpack(n,a)),a+=le.packedLength,n[a++]===1&&(p=le.unpack(n,a)),a+=le.packedLength;let _,y,C,E=new En,I=n[a++];for(i=0;i<I;i++){let S=t[n[a++]],w=n[a++];C=n[a++];let v=n[a++]!==0;_=n[a++],y=j.createTypedArray(w,_);for(let R=0;R<_;R++)y[R]=n[a++];E[S]=new Me({componentDatatype:w,componentsPerAttribute:C,normalize:v,values:y})}let x;if(_=n[a++],_>0){let S=y.length/C;for(x=Ue.createTypedArray(S,_),i=0;i<_;i++)x[i]=n[a++]}o[r++]=new yt({primitiveType:c,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:x,attributes:E,offsetAttribute:f})}return o};function e2e(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 a=e[r];if(P.pack(a.modelMatrix,i,o),o+=P.packedLength,l(a.attributes)&&l(a.attributes.offset)){let s=a.attributes.offset.value;i[o]=s[0],i[o+1]=s[1],i[o+2]=s[2]}o+=3}return t.push(i.buffer),i}function t2e(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=P.unpack(t,o),a;o+=P.packedLength,l(t[o])&&(a={offset:new go(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:a}}return n}fA.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:e2e(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof qi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};fA.unpackCombineGeometryParameters=function(e){let t=t2e(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let s=0;s<i;s++){let c=fA.unpackCreateGeometryResults(n[s]),u=c.length;for(let f=0;f<u;f++){let h=c[f],p=t[o];p.geometry=h,++o}}let r=te.clone(e.ellipsoid),a=e.isGeographic?new qi(r):new mi(r);return{instances:t,ellipsoid:r,projection:a,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:P.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function sae(e){let t=e.length,n=1+(le.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let a=e[r];l(a)?(i[o++]=1,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function cae(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=le.unpack(e,i)),++n,i+=le.packedLength;return t}fA.packCombineGeometryResults=function(e,t){l(e.geometries)&&ZQe(e.geometries,t);let n=sae(e.boundingSpheres),i=sae(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}};fA.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:cae(e.boundingSpheres),boundingSpheresCV:cae(e.boundingSpheresCV)}};var ib=fA;var n2e={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},na=Object.freeze(n2e);var Vu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Vu.NUMBER_OF_SHADOW_MODES=4;Vu.castShadows=function(e){return e===Vu.ENABLED||e===Vu.CAST_ONLY};Vu.receiveShadows=function(e){return e===Vu.ENABLED||e===Vu.RECEIVE_ONLY};Vu.fromCastReceive=function(e,t){return e&&t?Vu.ENABLED:e?Vu.CAST_ONLY:t?Vu.RECEIVE_ONLY:Vu.DISABLED};var Bn=Object.freeze(Vu);function kr(e){e=e??V.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Bn.DISABLED,this._translucent=void 0,this._state=na.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(kr.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 i2e(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&l(i[o])){let r=i[o],a=!0;for(let s=1;s<t;++s){let c=e[s].attributes[o];if(!l(c)||r.componentDatatype!==c.componentDatatype||r.componentsPerAttribute!==c.componentsPerAttribute||r.normalize!==c.normalize){a=!1;break}}a&&n.push(o)}return n}var o2e=new Q,r2e=new d,gae=new ie;function _ae(e){let t=e.length;if(t===1)return e[0];if(t===2)return Q.unpack(e,0,o2e);if(t===3)return d.unpack(e,0,r2e);if(t===4)return ie.unpack(e,0,gae)}function a2e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=i2e(i),a=r.length,s=[],c={},u={},f,p=i[0].attributes,A,m,_;for(A=0;A<a;++A)m=r[A],_=p[m],c[m]=A,s.push({functionName:`czm_batchTable_${m}`,componentDatatype:_.componentDatatype,componentsPerAttribute:_.componentsPerAttribute,normalize:_.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(s.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:j.FLOAT,componentsPerAttribute:1}),u.center3DHigh=s.length-5,u.center3DLow=s.length-4,u.center2DHigh=s.length-3,u.center2DLow=s.length-2,u.radius=s.length-1),r.indexOf("offset")!==-1&&(s.push({functionName:"czm_batchTable_offset2D",componentDatatype:j.FLOAT,componentsPerAttribute:3}),f=s.length-1),s.push({functionName:"czm_batchTable_pickColor",componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let y=s.length,C=new nb(t,s,o);for(A=0;A<o;++A){let E=i[A];p=E.attributes;for(let v=0;v<a;++v){m=r[v],_=p[m];let R=_ae(_.value),N=c[m];C.setBatchedAttribute(A,N,R)}let I={primitive:E.pickPrimitive??e};l(E.id)&&(I.id=E.id);let x=t.createPickId(I);e._pickIds.push(x);let S=x.color,w=gae;w.x=U.floatToByte(S.red),w.y=U.floatToByte(S.green),w.z=U.floatToByte(S.blue),w.w=U.floatToByte(S.alpha),C.setBatchedAttribute(A,y-1,w)}e._batchTable=C,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function s2e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Me({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function c2e(e){let t=e.attributes,n=new En;for(let o in t)t.hasOwnProperty(o)&&l(t[o])&&(n[o]=s2e(t[o]));let i;if(l(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new yt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function l2e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:P.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var u2e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;kr._modifyShaderPosition=function(e,t,n){let i,o="",r="",a="";for(;(i=u2e.exec(t))!==null;){let s=i[1],c=`vec4 czm_compute${s[0].toUpperCase()}${s.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(o+=`${c};
|
|
`),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
|
|
`,r+=`in vec4 position;
|
|
`,a+=`${c}
|
|
{
|
|
return u_modifiedModelView * position;
|
|
}
|
|
|
|
`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?a+=`${c}
|
|
{
|
|
return czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
|
|
}
|
|
|
|
`:(r+=`in vec3 ${s}2DHigh;
|
|
in vec3 ${s}2DLow;
|
|
`,a+=`${c}
|
|
{
|
|
vec4 p;
|
|
if (czm_morphTime == 1.0)
|
|
{
|
|
p = czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow);
|
|
}
|
|
else if (czm_morphTime == 0.0)
|
|
{
|
|
p = czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy);
|
|
}
|
|
else
|
|
{
|
|
p = czm_columbusViewMorph(
|
|
czm_translateRelativeToEye(${s}2DHigh.zxy, ${s}2DLow.zxy),
|
|
czm_translateRelativeToEye(${s}3DHigh, ${s}3DLow),
|
|
czm_morphTime);
|
|
}
|
|
return p;
|
|
}
|
|
|
|
`)}return[o,r,t,a].join(`
|
|
`)};kr._appendShowToShader=function(e,t){return l(e._batchTableAttributeIndices.show)?`${We.replaceMain(t,"czm_non_show_main")}
|
|
void main()
|
|
{
|
|
czm_non_show_main();
|
|
gl_Position *= czm_batchTable_show(batchId);
|
|
}`:t};kr._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function lae(e){return`${We.replaceMain(e,"czm_non_pick_main")}
|
|
out vec4 v_pickColor;
|
|
void main()
|
|
{
|
|
czm_non_pick_main();
|
|
v_pickColor = czm_batchTable_pickColor(batchId);
|
|
}`}function uae(e){return`in vec4 v_pickColor;
|
|
${e}`}kr._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};kr._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
|
|
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
|
|
`;return o+=` if (czm_sceneMode == czm_sceneMode3D)
|
|
`,o+=` {
|
|
`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` }
|
|
`,o+=` else
|
|
`,o+=` {
|
|
`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` }
|
|
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};kr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=We.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main()
|
|
{
|
|
czm_non_distanceDisplayCondition_main();
|
|
vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
|
|
vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
|
|
vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
|
|
float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
|
|
`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
|
|
`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
|
|
vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
|
|
vec4 centerRTE;
|
|
if (czm_morphTime == 1.0)
|
|
{
|
|
centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
|
|
}
|
|
else if (czm_morphTime == 0.0)
|
|
{
|
|
centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
|
|
}
|
|
else
|
|
{
|
|
centerRTE = czm_columbusViewMorph(
|
|
czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
|
|
czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
|
|
czm_morphTime);
|
|
}
|
|
`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
|
|
float distanceSq;
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
{
|
|
distanceSq = czm_eyeHeight2D.y - radiusSq;
|
|
}
|
|
else
|
|
{
|
|
distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
|
|
}
|
|
distanceSq = max(distanceSq, 0.0);
|
|
float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
|
|
float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
|
|
float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
|
|
gl_Position *= show;
|
|
}`,`${i}
|
|
${o}`};function fae(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,a=i&&n?2:1;a+=o||r?1:0;let s=a>1?`vec${a}`:"float",c="compressedAttributes",u=`in ${s} ${c};`,f="",h="";if(i){f+=`vec2 st;
|
|
`;let m=a>1?`${c}.x`:c;h+=` st = czm_decompressTextureCoordinates(${m});
|
|
`}n&&o&&r?(f+=`vec3 normal;
|
|
vec3 tangent;
|
|
vec3 bitangent;
|
|
`,h+=` czm_octDecode(${c}.${i?"yz":"xy"}, normal, tangent, bitangent);
|
|
`):(n&&(f+=`vec3 normal;
|
|
`,h+=` normal = czm_octDecode(${c}${a>1?`.${i?"y":"x"}`:""});
|
|
`),o&&(f+=`vec3 tangent;
|
|
`,h+=` tangent = czm_octDecode(${c}.${i&&n?"z":"y"});
|
|
`),r&&(f+=`vec3 bitangent;
|
|
`,h+=` bitangent = czm_octDecode(${c}.${i&&n?"z":"y"});
|
|
`));let 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=We.replaceMain(p,"czm_non_compressed_main");let A=`void main()
|
|
{
|
|
${h} czm_non_compressed_main();
|
|
}`;return[u,f,p,A].join(`
|
|
`)}function f2e(e){let t=We.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
|
|
czm_non_depth_clamp_main();
|
|
gl_Position = czm_depthClamp(gl_Position);}
|
|
`,t}function d2e(e){let t=We.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
|
|
czm_non_depth_clamp_main();
|
|
#if defined(LOG_DEPTH)
|
|
czm_writeLogDepth();
|
|
#else
|
|
czm_writeDepthClamp();
|
|
#endif
|
|
}
|
|
`,t}function dae(e,t){let n=e.vertexAttributes}function h2e(e,t){return function(){return e[t]}}var Yj=Math.max(hn.hardwareConcurrency-1,1),X1,m2e=new Zn("combineGeometry");function p2e(e,t){let n,i,o,r,a=e._instanceIds;if(e._state===na.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let s=e._numberOfInstances=n.length,c=[],u=[];for(o=0;o<s;++o)i=n[o].geometry,a.push(n[o].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(X1))for(X1=new Array(Yj),o=0;o<Yj;o++)X1[o]=new Zn("createGeometry");let f;for(u=K1(u,Yj),o=0;o<u.length;o++){let h=0,p=u[o],A=p.length;for(r=0;r<A;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(f.offset=h,h+=i.constructor.packedLength??i.packedLength);let m;if(h>0){let _=new Float64Array(h);for(m=[_.buffer],r=0;r<A;++r)f=p[r],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,_,f.offset),f.geometry=_)}c.push(X1[o].scheduleTask({subTasks:u[o]},m))}e._state=na.CREATING,Promise.all(c).then(function(h){e._createGeometryResults=h,e._state=na.CREATED}).catch(function(h){jw(e,t,na.FAILED,h)})}else if(e._state===na.CREATED){let s=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=m2e.scheduleTask(ib.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},s),s);e._createGeometryResults=void 0,e._state=na.COMBINING,Promise.resolve(f).then(function(h){let p=ib.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=P.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=na.COMBINED):jw(e,t,na.FAILED,void 0)}).catch(function(h){jw(e,t,na.FAILED,h)})}}function A2e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,a,s,c=0;for(s=0;s<i;s++){a=n[s];let p=a.geometry,A;l(p.attributes)&&l(p.primitiveType)?A=c2e(p):A=p.constructor.createGeometry(p),o[c++]=l2e(a,A),r.push(a.id)}o.length=c;let u=t.scene3DOnly,f=t.mapProjection,h=ib.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=P.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=na.COMBINED):jw(e,t,na.FAILED,void 0)}function g2e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,a=r.length,s=e._tempBoundingSpheres;if(!l(s)){for(s=new Array(a),i=0;i<a;i++)s[i]=new le;e._tempBoundingSpheres=s}for(i=0;i<a;++i){let _=s[i],y=e._batchTable.getBatchedAttribute(i,n,new d);_=r[i].clone(_),Iae(_,y,o[i])}let c=[],u=[],f=[];for(i=0;i<a;++i){let _=s[i];_.center.x-_.radius>0||le.intersectPlane(_,cn.ORIGIN_ZX_PLANE)!==Xt.INTERSECTING?c.push(_):(u.push(_),f.push(_))}let h=c[0],p=f[0],A=u[0];for(i=1;i<c.length;i++)h=le.union(h,c[i]);for(i=1;i<f.length;i++)p=le.union(p,f[i]);for(i=1;i<u.length;i++)A=le.union(A,u[i]);let m=[];for(l(h)&&m.push(h),l(p)&&m.push(p),l(A)&&m.push(A),i=0;i<m.length;i++){let _=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=_,e._boundingSphereCV[i]=le.projectTo2D(_,t.mapProjection,e._boundingSphereCV[i])}kr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var hae=new xn,yae=new me,Cae=new d,Eae=new le;function _2e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,a=i.center2DHigh,s=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,A=p.length;for(let m=0;m<A;++m){let _=p[m];if(!l(_))continue;let y=e.modelMatrix;l(y)&&(_=le.transform(_,y,Eae));let C=_.center,E=_.radius,I=xn.fromCartesian(C,hae);if(h.setBatchedAttribute(m,o,I.high),h.setBatchedAttribute(m,r,I.low),!t.scene3DOnly){let x=f.cartesianToCartographic(C,yae),S=u.project(x,Cae);I=xn.fromCartesian(S,hae),h.setBatchedAttribute(m,a,I.high),h.setBatchedAttribute(m,s,I.low)}h.setBatchedAttribute(m,c,E)}e._batchTableBoundingSpheresUpdated=!0}var qj=new d,y2e=new d;function mae(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,a=e._batchTable,s=e._instanceBoundingSpheres,c=s.length;for(let u=0;u<c;++u){let f=s[u];if(!l(f))continue;let h=a.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){a.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=le.transform(f,p,Eae));let A=f.center;A=r.scaleToGeodeticSurface(A,y2e);let m=r.cartesianToCartographic(A,yae),_=o.project(m,Cae),y=d.add(h,A,qj);m=r.cartesianToCartographic(y,m);let C=o.project(m,qj),E=d.subtract(C,_,qj),I=E.x;E.x=E.z,E.z=E.y,E.y=I,a.setBatchedAttribute(u,i,E)}e._batchTableOffsetsUpdated=!0}function C2e(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,a=[],s=i.length;for(let c=0;c<s;++c){let u=i[c];if(a.push(Vn.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Re.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,A=f.z;f.x=A,f.y=h,f.z=p,e._boundingSphereCV.push(le.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new le),e._boundingSphereMorph.push(new le)}}e._va=a,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,jw(e,t,na.COMPLETE,void 0)}function E2e(e,t,n,i){let o=n.getRenderState(),r;i?(r=Ye(o,!1),r.cull={enabled:!0,face:Li.BACK},e._frontFaceRS=Ve.fromCache(r),r.cull.face=Li.FRONT,e._backFaceRS=Ve.fromCache(r)):(e._frontFaceRS=Ve.fromCache(o),e._backFaceRS=e._frontFaceRS),r=Ye(o,!1),l(e._depthFailAppearance)&&(r.depthTest.enabled=!1),l(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=Ye(o,!1),r.depthTest.func=hc.GREATER,i?(r.cull={enabled:!0,face:Li.BACK},e._frontFaceDepthFailRS=Ve.fromCache(r),r.cull.face=Li.FRONT,e._backFaceDepthFailRS=Ve.fromCache(r)):(e._frontFaceDepthFailRS=Ve.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function I2e(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=kr._appendOffsetToShader(e,r),r=kr._appendShowToShader(e,r),r=kr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=lae(r),r=kr._updateColorAttribute(e,r,!1),r=fae(e,r),r=kr._modifyShaderPosition(e,r,t.scene3DOnly);let a=n.getFragmentShaderSource();a=uae(a),e._sp=$t.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o}),dae(e._sp,o),l(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=kr._appendShowToShader(e,r),r=kr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=lae(r),r=kr._updateColorAttribute(e,r,!0),r=fae(e,r),r=kr._modifyShaderPosition(e,r,t.scene3DOnly),r=f2e(r),a=e._depthFailAppearance.getFragmentShaderSource(),a=uae(a),a=d2e(a),e._spDepthFail=$t.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o}),dae(e._spDepthFail,o))}var Ww=new P,pae=new d;function Aae(e,t,n,i){let o=l(n)?n._uniforms:void 0,r={},a=t.uniforms;if(l(a))for(let c in a)a.hasOwnProperty(c)&&(r[c]=h2e(a,c));let s=Pt(r,o);return s=e._batchTable.getUniformMapCallback()(s),l(e.rtcCenter)&&(s.u_modifiedModelView=function(){let c=i.context.uniformState.view;return P.multiply(c,e._modelMatrix,Ww),P.multiplyByPoint(Ww,e.rtcCenter,pae),P.setTranslation(Ww,pae,Ww),Ww}),s}function b2e(e,t,n,i,o,r,a,s){let c=Aae(e,t,n,s),u;l(e._depthFailAppearance)&&(u=Aae(e,e._depthFailAppearance,e._depthFailAppearance.material,s));let f=i?Be.TRANSLUCENT:Be.OPAQUE,h=o?2:1;h*=l(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,A=0;for(let m=0;m<p;++m){let _;o&&(_=r[m],l(_)||(_=r[m]=new it({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._backFaceRS,_.shaderProgram=e._sp,_.uniformMap=c,_.pass=f,++m),_=r[m],l(_)||(_=r[m]=new it({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._frontFaceRS,_.shaderProgram=e._sp,_.uniformMap=c,_.pass=f,l(e._depthFailAppearance)&&(o&&(++m,_=r[m],l(_)||(_=r[m]=new it({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._backFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=u,_.pass=f),++m,_=r[m],l(_)||(_=r[m]=new it({owner:e,primitiveType:e._primitiveType})),_.vertexArray=e._va[A],_.renderState=e._frontFaceDepthFailRS,_.shaderProgram=e._spDepthFail,_.uniformMap=u,_.pass=f),++A}}kr._updateBoundingVolumes=function(e,t,n,i){let o,r,a;if(i||!P.equals(n,e._modelMatrix))for(P.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)a=e._boundingSpheres[o],l(a)&&(e._boundingSphereWC[o]=le.transform(a,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=le.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphereMorph[o]=le.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let s=e.appearance.pixelSize;if(l(s))for(r=e._boundingSpheres.length,o=0;o<r;++o){a=e._boundingSpheres[o];let c=e._boundingSphereWC[o],f=t.camera.getPixelSize(a,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*s;c.radius=a.radius+f}};function x2e(e,t,n,i,o,r,a,s){kr._updateBoundingVolumes(e,t,o);let c;t.mode===oe.SCENE3D?c=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===oe.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=Bn.castShadows(e.shadows),A=Bn.receiveShadows(e.shadows),m=n.length,_=s?2:1;_*=l(e._depthFailAppearance)?2:1;for(let y=0;y<m;++y){let C=Math.floor(y/_),E=n[y];E.modelMatrix=o,E.boundingVolume=c[C],E.cull=r,E.debugShowBoundingVolume=a,E.castShadows=p,E.receiveShadows=A,h?E.pickId="v_pickColor":E.pickId=void 0,u.push(E)}}}kr.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===na.FAILED)return;let t=e.context;if(l(this._batchTable)||a2e(this,t),this._batchTable.attributes.length>0){if(Nt.maximumVertexTextureImageUnits===0)throw new ue("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==na.COMPLETE&&this._state!==na.COMBINED&&(this.asynchronous?p2e(this,e):A2e(this,e)),this._state===na.COMBINED&&(_2e(this,e),mae(this,e),C2e(this,e)),!this.show||this._state!==na.COMPLETE)return;this._batchTableOffsetsUpdated||mae(this,e),this._recomputeBoundingSpheres&&g2e(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 a=this.depthFailAppearance,s=l(a)?a.material:void 0;this._depthFailAppearance!==a?(this._depthFailAppearance=a,this._depthFailMaterial=s,o=!0,r=!0):this._depthFailMaterial!==s&&(this._depthFailMaterial=s,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;o&&(this._createRenderStatesFunction??E2e)(this,t,n,u),r&&(this._createShaderProgramFunction??I2e)(this,e,n),(o||r)&&(this._createCommandsFunction??b2e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??x2e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var T2e=new le,S2e=new le;function Iae(e,t,n){if(n===mn.TOP){let i=le.clone(e,T2e),o=le.clone(e,S2e);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===mn.ALL&&(e.center=d.add(e.center,t,e.center));return e}function w2e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,a=j.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,a,0):a[0]=i,a}}function B2e(e,t,n,i,o){return function(r){let a=_ae(r);e.setBatchedAttribute(t,n,a),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var D2e=new d;function v2e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&Iae(i,d.fromArray(r.get(),0,D2e),e._offsetInstanceExtend[n]),l(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function P2e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}kr.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let a=this._batchTable,s=this._batchTableAttributeIndices;t={};let c={};for(let u in s)if(s.hasOwnProperty(u)){let f=s[u];c[u]={get:w2e(a,n,f),set:B2e(a,n,f,this,u)}}return v2e(this,c,n),P2e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};kr.prototype.isDestroyed=function(){return!1};kr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,fe(this)};function jw(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===na.COMPLETE||e._state===na.FAILED,!0})}var Ln=kr;function R2e(e){e=e??V.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var hl=R2e;var Yw=`#ifdef TEXTURE_COORDINATES
|
|
#ifdef SPHERICAL
|
|
in vec4 v_sphericalExtents;
|
|
#else // SPHERICAL
|
|
in vec2 v_inversePlaneExtents;
|
|
in vec4 v_westPlane;
|
|
in vec4 v_southPlane;
|
|
#endif // SPHERICAL
|
|
in vec3 v_uvMinAndSphericalLongitudeRotation;
|
|
in vec3 v_uMaxAndInverseDistance;
|
|
in vec3 v_vMaxAndInverseDistance;
|
|
#endif // TEXTURE_COORDINATES
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
in vec4 v_color;
|
|
#endif
|
|
|
|
#ifdef NORMAL_EC
|
|
vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
|
|
return eyeCoordinate.xyz / eyeCoordinate.w;
|
|
}
|
|
|
|
vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
|
|
vec2 glFragCoordXY = gl_FragCoord.xy;
|
|
// Sample depths at both offset and negative offset
|
|
float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
|
|
float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
|
|
// Explicitly evaluate both paths
|
|
// Necessary for multifrustum and for edges of the screen
|
|
bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
|
|
float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
|
|
float useDownOrLeft = float(useUpOrRight == 0.0);
|
|
vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
|
|
vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
|
|
return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
|
|
}
|
|
#endif // NORMAL_EC
|
|
|
|
void main(void)
|
|
{
|
|
#ifdef REQUIRES_EC
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
#endif
|
|
|
|
#ifdef REQUIRES_WC
|
|
vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
|
|
vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
|
|
#endif
|
|
|
|
#ifdef TEXTURE_COORDINATES
|
|
vec2 uv;
|
|
#ifdef SPHERICAL
|
|
// Treat world coords as a sphere normal for spherical coordinates
|
|
vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
|
|
sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
|
|
sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
|
|
uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
|
|
uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
|
|
#else // SPHERICAL
|
|
// Unpack planes and transform to eye space
|
|
uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
|
|
uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
|
|
#endif // SPHERICAL
|
|
#endif // TEXTURE_COORDINATES
|
|
|
|
#ifdef CULL_FRAGMENTS
|
|
// When classifying translucent geometry, logDepthOrDepth == 0.0
|
|
// indicates a region that should not be classified, possibly due to there
|
|
// being opaque pixels there in another buffer.
|
|
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef PICK
|
|
out_FragColor.a = 1.0; // Explicitly set the alpha, otherwise this may be discarded by ShaderSource.createPickFragmentShaderSource
|
|
#ifdef CULL_FRAGMENTS
|
|
czm_writeDepthClamp();
|
|
#endif // CULL_FRAGMENTS
|
|
#else // PICK
|
|
|
|
#ifdef NORMAL_EC
|
|
// Compute normal by sampling adjacent pixels in 2x2 block in screen space
|
|
vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
|
|
vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
|
|
vec3 normalEC = normalize(cross(leftRight, downUp));
|
|
#endif
|
|
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
|
|
vec4 color = czm_gammaCorrect(v_color);
|
|
#ifdef FLAT
|
|
out_FragColor = color;
|
|
#else // FLAT
|
|
czm_materialInput materialInput;
|
|
materialInput.normalEC = normalEC;
|
|
materialInput.positionToEyeEC = -eyeCoordinate.xyz;
|
|
czm_material material = czm_getDefaultMaterial(materialInput);
|
|
material.diffuse = color.rgb;
|
|
material.alpha = color.a;
|
|
|
|
out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
|
|
#endif // FLAT
|
|
|
|
// Premultiply alpha. Required for classification primitives on translucent globe.
|
|
out_FragColor.rgb *= out_FragColor.a;
|
|
|
|
#else // PER_INSTANCE_COLOR
|
|
|
|
// Material support.
|
|
// USES_ is distinct from REQUIRES_, because some things are dependencies of each other or
|
|
// dependencies for culling but might not actually be used by the material.
|
|
|
|
czm_materialInput materialInput;
|
|
|
|
#ifdef USES_NORMAL_EC
|
|
materialInput.normalEC = normalEC;
|
|
#endif
|
|
|
|
#ifdef USES_POSITION_TO_EYE_EC
|
|
materialInput.positionToEyeEC = -eyeCoordinate.xyz;
|
|
#endif
|
|
|
|
#ifdef USES_TANGENT_TO_EYE
|
|
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
|
|
#endif
|
|
|
|
#ifdef USES_ST
|
|
// Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired
|
|
// texture coordinate system, which typically forms a tight oriented bounding box around the geometry.
|
|
// Shader is provided a set of reference points for remapping.
|
|
materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
|
|
materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
|
|
#endif
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
|
|
#ifdef FLAT
|
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
#else // FLAT
|
|
out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
|
|
#endif // FLAT
|
|
|
|
// Premultiply alpha. Required for classification primitives on translucent globe.
|
|
out_FragColor.rgb *= out_FragColor.a;
|
|
|
|
#endif // PER_INSTANCE_COLOR
|
|
czm_writeDepthClamp();
|
|
#endif // PICK
|
|
}
|
|
`;function jf(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new Kj;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new Kj;if(o.requiresTextureCoordinates=e,n instanceof gn)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}jf.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof gn&&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 gn||(o=t.material.shaderSource),new We({defines:i,sources:[o,Yw]})};jf.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new We({defines:n,sources:[Yw],pickColorQualifier:"in"})};jf.prototype.createVertexShader=function(e,t,n,i){return vae(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};jf.prototype.createPickVertexShader=function(e,t,n,i){return vae(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var bae=new d,xae=new me,Tae={high:0,low:0};function vae(e,t,n,i,o,r,a,s){let c=i.slice();if(s.eastMostYhighDefine===""){let u=xae;u.longitude=D.PI,u.latitude=0,u.height=0;let f=a.project(u,bae),h=xn.encode(f.x,Tae);s.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,s.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=xae;p.longitude=-D.PI,p.latitude=0,p.height=0;let A=a.project(p,bae);h=xn.encode(A.x,Tae),s.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,s.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(c.push(s.eastMostYhighDefine),c.push(s.eastMostYlowDefine),c.push(s.westMostYhighDefine),c.push(s.westMostYlowDefine)),l(r)&&r instanceof gn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new We({defines:c,sources:[o]})}function Kj(){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(Kj.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 Sae(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)/Q.distance(t,e)}var M2e=[new Q,new Q,new Q,new Q];function Pae(e,t){let n=M2e,i=Q.unpack(t,0,n[0]),o=Q.unpack(t,2,n[1]),r=Q.unpack(t,4,n[2]);e.uMaxVmax=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let a=1/Sae(i,o,r),s=1/Sae(i,r,o);e.uvMinAndExtents=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,a,s]})}var Rae=new me,Mae=new d,N2e=new d,L2e=new d,J1={high:0,low:0};function Nae(e,t,n){let i=Rae;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Mae);i.latitude=e.north;let r=t.project(i,N2e);i.longitude=e.east,i.latitude=e.south;let a=t.project(i,L2e),s=[0,0,0,0],c=[0,0,0,0],u=xn.encode(o.x,J1);s[0]=u.high,c[0]=u.low,u=xn.encode(o.y,J1),s[1]=u.high,c[1]=u.low,u=xn.encode(r.y,J1),s[2]=u.high,c[2]=u.low,u=xn.encode(a.x,J1),s[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:s}),n.planes2D_LOW=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var O2e=new P,F2e=new P,wae=new d,Q2e=new me,k2e=[new me,new me,new me,new me,new me,new me,new me,new me];function U2e(e,t,n,i,o,r){let a=ce.center(e,Q2e);a.height=n;let s=me.toCartesian(a,t,wae),c=At.eastNorthUpToFixedFrame(s,t,O2e),u=P.inverse(c,F2e),f=e.west,h=e.east,p=e.north,A=e.south,m=k2e;m[0].latitude=A,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=A,m[3].longitude=h;let _=(f+h)*.5,y=(p+A)*.5;m[4].latitude=A,m[4].longitude=_,m[5].latitude=p,m[5].longitude=_,m[6].latitude=y,m[6].longitude=f,m[7].latitude=y,m[7].longitude=h;let C=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,I=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let N=me.toCartesian(m[R],t,wae);P.multiplyByPoint(u,N,N),N.z=0,C=Math.min(C,N.x),E=Math.max(E,N.x),I=Math.min(I,N.y),x=Math.max(x,N.y)}let S=i;S.x=C,S.y=I,S.z=0,P.multiplyByPoint(c,S,S);let w=o;w.x=E,w.y=I,w.z=0,P.multiplyByPoint(c,w,w),d.subtract(w,S,o);let v=r;v.x=C,v.y=x,v.z=0,P.multiplyByPoint(c,v,v),d.subtract(v,S,r)}var z2e=new d,G2e=new d,V2e=new xn;jf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=Mae,a=z2e,s=G2e;U2e(e,n,o??0,r,a,s);let c={};Pae(c,t);let u=xn.fromCartesian(r,V2e);return c.southWest_HIGH=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),c.southWest_LOW=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),c.eastward=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),c.northward=new hl({componentDatatype:j.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),Nae(e,i,c),c};var H2e=new d;function Bae(e,t,n,i){let o=Rae;o.latitude=e,o.longitude=t,o.height=0;let r=me.toCartesian(o,n,H2e),a=Math.sqrt(r.x*r.x+r.y*r.y),s=D.fastApproximateAtan2(a,r.z),c=D.fastApproximateAtan2(r.x,r.y);return i.x=s,i.y=c,i}var Dae=new Q;jf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Bae(e.south,e.west,n,Dae),r=o.x,a=o.y,s=Bae(e.north,e.east,n,Dae),c=s.x,u=s.y,f=0;a>u&&(f=D.PI-a,a=-D.PI,u+=f),r-=D.EPSILON5,a-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let h=1/(u-a),p=1/(c-r),A={sphericalExtents:new hl({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,a,p,h]}),longitudeRotation:new hl({componentDatatype:j.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Pae(A,t),Nae(e,i,A),A};jf.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};jf.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function W2e(e){return Math.max(e.width,e.height)>jf.MAX_WIDTH_FOR_PLANAR_EXTENTS}jf.shouldUseSphericalCoordinates=function(e){return W2e(e)};jf.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Yf=jf;var j2e={NEVER:ee.NEVER,LESS:ee.LESS,EQUAL:ee.EQUAL,LESS_OR_EQUAL:ee.LEQUAL,GREATER:ee.GREATER,NOT_EQUAL:ee.NOTEQUAL,GREATER_OR_EQUAL:ee.GEQUAL,ALWAYS:ee.ALWAYS},ti=Object.freeze(j2e);var Y2e={ZERO:ee.ZERO,KEEP:ee.KEEP,REPLACE:ee.REPLACE,INCREMENT:ee.INCR,DECREMENT:ee.DECR,INVERT:ee.INVERT,INCREMENT_WRAP:ee.INCR_WRAP,DECREMENT_WRAP:ee.DECR_WRAP},wt=Object.freeze(Y2e);var Z1={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};Z1.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ti.ALWAYS,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.REPLACE},backFunction:ti.ALWAYS,backOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.REPLACE},reference:Z1.CESIUM_3D_TILE_MASK,mask:Z1.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(Z1);function KC(e){e=e??V.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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(KC.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}}});KC.isSupported=function(e){return e.context.stencilBuffer};function ob(e,t){let n=t?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:wt.KEEP,zFail:wt.DECREMENT_WRAP,zPass:wt.KEEP},backFunction:n,backOperation:{fail:wt.KEEP,zFail:wt.INCREMENT_WRAP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}function Jj(e){return{stencilTest:{enabled:e,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND}}var q2e={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function K2e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ve.fromCache(ob(o,!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(ob(o,!0)),e._rsColorPass=Ve.fromCache(Jj(o,!1)),e._rsPickPass=Ve.fromCache(q2e)}function X2e(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);
|
|
`,a=t;a=a.replace(/in\s+vec3\s+extrudeDirection;/g,""),a=We.replaceMain(a,"czm_non_compressed_main");let s=`void main()
|
|
{
|
|
${r} czm_non_compressed_main();
|
|
}`;return[i,o,a,s].join(`
|
|
`)}}function J2e(e,t){let n=t.context,i=e._primitive,o=q1;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=Ln._appendDistanceDisplayConditionToShader(i,o),o=Ln._modifyShaderPosition(e,o,t.scene3DOnly),o=Ln._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,a=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=X2e(i,o));let s=e._extruded?"EXTRUDED_GEOMETRY":"",c=new We({defines:[s],sources:[o]}),u=new We({sources:[qC]}),f=e._primitive._attributeLocations,h=new Yf(a,r,e.appearance);if(e._spStencil=$t.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=We.createPickVertexShaderSource(o);m=Ln._appendShowToShader(i,m),m=Ln._updatePickColorAttribute(m);let _=h.createPickFragmentShader(!1),y=h.createPickVertexShader([s],m,!1,t.mapProjection);if(e._spPick=$t.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:y,fragmentShaderSource:_,attributeLocations:f}),a){let C=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(C)){let E=h.createPickFragmentShader(!0),I=h.createPickVertexShader([s],m,!0,t.mapProjection);C=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:I,fragmentShaderSource:E,attributeLocations:f})}e._spPick2D=C}}else e._spPick=$t.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});o=Ln._appendShowToShader(i,o),c=new We({defines:[s],sources:[o]}),e._sp=$t.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),A=h.createVertexShader([s],o,!1,t.mapProjection);if(e._spColor=$t.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:A,fragmentShaderSource:p,attributeLocations:f}),a){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let _=h.createFragmentShader(!0),y=h.createVertexShader([s],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:y,fragmentShaderSource:_,attributeLocations:f})}e._spColor2D=m}}function Z2e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,a,s=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let A=n._va[s++];r=t[o],l(r)||(r=t[o]=new it({owner:e,primitiveType:n._primitiveType})),r.vertexArray=A,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=c,r.pass=Be.TERRAIN_CLASSIFICATION,a=it.shallowClone(r,r.derivedCommands.tileset),a.renderState=e._rsStencilDepthPass3DTiles,a.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,r=t[o+1],l(r)||(r=t[o+1]=new it({owner:e,primitiveType:n._primitiveType})),r.vertexArray=A,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=Be.TERRAIN_CLASSIFICATION;let _=e.appearance.material;if(l(_)&&(c=Pt(c,_._uniforms)),r.uniformMap=c,a=it.shallowClone(r,r.derivedCommands.tileset),a.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=a,u){let y=it.shallowClone(r,r.derivedCommands.appearance2D);y.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=y,y=it.shallowClone(a,a.derivedCommands.appearance2D),y.shaderProgram=e._spColor2D,a.derivedCommands.appearance2D=y}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let A=0;A<i;++A){let m=f[A]=it.shallowClone(t[p],f[A]);m.shaderProgram=h,m.pass=Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function $2e(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,a=0,s;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let c,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),A=e._needs2DShader;for(c=0;c<o;c+=2){let m=i._va[h++];if(n&&(s=r[a++],m=i._va[s.index]),u=t[c],l(u)||(u=t[c]=new it({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Be.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=it.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new it({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Be.TERRAIN_CLASSIFICATION,n&&(u.offset=s.offset,u.count=s.count),f=it.shallowClone(u,u.derivedCommands.tileset),f.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,A){let _=it.shallowClone(u,u.derivedCommands.pick2D);_.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=_,_=it.shallowClone(f,f.derivedCommands.pick2D),_.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=_}}}function eke(e,t,n,i,o,r,a){Z2e(e,r),$2e(e,a)}function Lae(e,t){return Math.floor(e%t/2)}function Xj(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Oae(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function tke(e,t,n,i,o,r,a,s){let c=e._primitive;Ln._updateBoundingVolumes(c,t,o);let u;t.mode===oe.SCENE3D?u=c._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===oe.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,h=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN,A=t.passes,m,_,y;if(A.render){let C=n.length;for(m=0;m<C;++m)_=u[Lae(m,C)],h&&(y=n[m],Xj(y,t,o,r,_,a)),p&&(y=n[m].derivedCommands.tileset,Xj(y,t,o,r,_,a));if(t.invertClassification){let E=e._commandsIgnoreShow,I=E.length;for(m=0;m<I;++m)_=u[m],y=E[m],Xj(y,t,o,r,_,a)}}if(A.pick){let C=i.length,E=c._pickOffsets;for(m=0;m<C;++m){let I=E[Lae(m,C)];_=u[I.index],h&&(y=i[m],Oae(y,t,o,r,_)),p&&(y=i[m].derivedCommands.tileset,Oae(y,t,o,r,_))}}}KC.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,a,s,c,u=!1,f=!0,h,p=!1,A=!1;for(r>0&&(c=o[0].attributes,p=Yf.hasAttributesForSphericalExtents(c),A=Yf.hasAttributesForTextureCoordinatePlanes(c),h=c.color),a=0;a<r;a++){s=o[a];let _=s.attributes.color;l(_)&&(u=!0),f=f&&l(_)&&Jt.equals(h,_)}if(!f&&!p&&!A)throw new de("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new gn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!A,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=A,this._hasPerColorAttribute=u;let m=new Array(r);for(a=0;a<r;++a)s=o[a],m[a]=new Lt({geometry:s.geometry,attributes:s.attributes,modelMatrix:s.modelMatrix,id:s.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(_,y){n._createBoundingVolumeFunction(_,y)}),i._createRenderStatesFunction=function(_,y,C,E){K2e(n,y)},i._createShaderProgramFunction=function(_,y,C){J2e(n,y)},i._createCommandsFunction=function(_,y,C,E,I,x,S){eke(n,void 0,void 0,!0,!1,x,S)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(_,y,C,E,I,x,S,w){n._updateAndQueueCommandsFunction(_,y,C,E,I,x,S,w)}:i._updateAndQueueCommandsFunction=function(_,y,C,E,I,x,S,w){tke(n,y,C,E,I,x,S,w)},this._primitive=new Ln(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ve.fromCache(ob(!1,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(ob(!1,!0)),this._rsColorPass=Ve.fromCache(Jj(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ve.fromCache(ob(!0,!1)),this._rsStencilDepthPass3DTiles=Ve.fromCache(ob(!0,!0)),this._rsColorPass=Ve.fromCache(Jj(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};KC.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};KC.prototype.isDestroyed=function(){return!1};KC.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,fe(this)};var qw=KC;var nke={u_globeMinimumAltitude:function(){return 55e3}};function Jl(e){e=e??V.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let a=0;a<r;a++){let s=o[a].attributes;if(l(s)&&l(s.color)){t=new gn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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=vi._defaultMaxTerrainHeight,this._minTerrainHeight=vi._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:nke}}Object.defineProperties(Jl.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}}});Jl.isSupported=qw.isSupported;function Fae(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Qae(e){return function(t,n){return e._minHeight}}var ike=new d,oke=new d,rke=new d,ake=new me,ske=new ce;function $1(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,ike),A=d.unpack(o,h,oke),m=d.add(p,A,rke),_=n.cartesianToCartographic(m,ake),y=_.latitude,C=_.longitude;a=Math.min(a,y),s=Math.min(s,C),c=Math.max(c,y),u=Math.max(u,C)}let f=ske;return f.north=c,f.south=a,f.east=u,f.west=s,f}function cke(e,t,n){let i=vi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function lke(e,t,n){let i=t.mapProjection.ellipsoid,o=$1(t,n),r=en.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let a=t.mapProjection,s=le.fromRectangleWithHeights2D(o,a,e._maxHeight,e._minHeight);d.fromElements(s.center.z,s.center.x,s.center.y,s.center),e._boundingVolumes2D.push(s)}}function Zj(e,t){return Math.floor(e%t/2)}function $j(e,t,n,i,o,r,a){let s=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===s._spColor&&s._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function kae(e,t,n,i,o,r){let a=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===a._spPick&&a._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function uke(e,t,n,i,o,r,a,s){let c;t.mode===oe.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==ei.CESIUM_3D_TILE,h=u!==ei.TERRAIN,p=t.passes,A=e._primitive,m,_,y;if(p.render){let C=n.length;for(m=0;m<C;++m)_=c[Zj(m,C)],f&&(y=n[m],$j(e,y,t,o,r,_,a)),h&&(y=n[m].derivedCommands.tileset,$j(e,y,t,o,r,_,a));if(t.invertClassification){let E=A._commandsIgnoreShow,I=E.length;for(m=0;m<I;++m)_=c[m],y=E[m],$j(e,y,t,o,r,_,a)}}if(p.pick){let C=i.length,E;for(e._useFragmentCulling||(E=A._primitive._pickOffsets),m=0;m<C;++m){if(_=c[Zj(m,C)],!e._useFragmentCulling){let I=E[Zj(m,C)];_=c[I.index]}f&&(y=i[m],kae(e,y,t,o,r,_)),h&&(y=i[m].derivedCommands.tileset,kae(e,y,t,o,r,_))}}}Jl.initializeTerrainHeights=function(){return vi.initialize()};Jl.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!vi.initialized){Jl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,a,s=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=s.length,u=new Array(c),f,h;for(f=0;f<c;++f){o=s[f],r=o.geometry;let _=$1(e,r);l(h)?l(_)&&ce.union(h,_,h):h=ce.clone(_);let y=o.id;if(l(y)&&l(_)){let C=vi.getBoundingSphere(_,i);this._boundingSpheresKeys.push(y),this._boundingSpheres.push(C)}a=r.constructor,!l(a)||l(a.createShadowVolume)}cke(this,h,i);let p=e.verticalExaggeration,A=e.verticalExaggerationRelativeHeight;this._minHeight=To.getHeight(this._minTerrainHeight,p,A),this._maxHeight=To.getHeight(this._maxTerrainHeight,p,A);let m=Jl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let _,y=!0;for(f=0;f<c;++f)if(o=s[f],r=o.geometry,h=$1(e,r),Yf.shouldUseSphericalCoordinates(h)){y=!1;break}for(f=0;f<c;++f){o=s[f],r=o.geometry,a=r.constructor;let C=$1(e,r),E=r.textureCoordinateRotationPoints;y?_=Yf.getPlanarTextureCoordinateAttributes(C,E,i,e.mapProjection,this._maxHeight):_=Yf.getSphericalExtentGeometryInstanceAttributes(C,E,i,e.mapProjection);let I=o.attributes;for(let x in I)I.hasOwnProperty(x)&&(_[x]=I[x]);u[f]=new Lt({geometry:a.createShadowVolume(r,Qae(this),Fae(this)),attributes:_,id:o.id})}}else for(f=0;f<c;++f)o=s[f],r=o.geometry,a=r.constructor,u[f]=new Lt({geometry:a.createShadowVolume(r,Qae(this),Fae(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(_,y){lke(t,_,y)},n._updateAndQueueCommandsFunction=function(_,y,C,E,I,x,S,w){uke(t,y,C,E,I,x,S,w)},this._primitive=new qw(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Jl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Jl.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Jl.prototype.isDestroyed=function(){return!1};Jl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};Jl._supportsMaterials=function(e){return e.depthTexture};Jl.supportsMaterials=function(e){return Jl._supportsMaterials(e.frameState.context)};var Zl=Jl;function rb(){de.throwInstantiationError()}Object.defineProperties(rb.prototype,{isConstant:{get:de.throwInstantiationError},definitionChanged:{get:de.throwInstantiationError}});rb.prototype.getType=de.throwInstantiationError;rb.prototype.getValue=de.throwInstantiationError;rb.prototype.equals=de.throwInstantiationError;var fke=new X;rb.getValue=function(e,t,n){let i;return l(e)||(e=X.now(fke)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Xi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Xi.ColorType)&&(n=Xi.fromType(Xi.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var vr=rb;function XC(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}XC.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!q.getValueOrDefault(t.show,n,!0)};XC.prototype._setOptions=de.throwInstantiationError;XC.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,a=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,a,e),this._isHidden(r,a,e))return;let s=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(a.fill)||a.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,h,p=t._getIsClosed(c);if(f)h=new gn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let A=vr.getValue(e,u,this._material);this._material=A,h=new _o({material:A,translucent:A.isTranslucent(),closed:p})}if(n)c.vertexFormat=gn.VERTEX_FORMAT,this._primitive=o.add(new Zl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:s,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),q.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=h.vertexFormat;let A=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=A.attributes.color.value[3]!==255),this._primitive=i.add(new Ln({geometryInstances:A,appearance:h,asynchronous:!1,shadows:s}))}}if(!n&&l(a.outline)&&a.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=q.getValueOrDefault(a.outlineWidth,e,1);this._outlinePrimitive=i.add(new Ln({geometryInstances:u,appearance:new gn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:s}))}};XC.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),Ct.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(le.clone(o.boundingSphere,e),Ct.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Ct.PENDING:Ct.FAILED};XC.prototype.isDestroyed=function(){return!1};XC.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),fe(this)};var xi=XC;var Uae={};function Kw(e,t){l(Uae[e])||(Uae[e]=!0,console.warn(t??e))}Kw.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.";Kw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Kw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Kw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var bt=Kw;var dke={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},n_=Object.freeze(dke);var hke={NONE:0,GEODESIC:1,RHUMB:2},un=Object.freeze(hke);var zae=D.EPSILON10;function mke(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let a,s=e[0],c,u,f=0,h=-1;for(a=1;a<r;++a)c=e[a],t(s,c,zae)?(l(u)||(u=e.slice(0,a),f=a-1,h=0),o&&i.push(a)):(l(u)&&(u.push(c),f=a,o&&(h=i.length)),s=c);return n&&t(e[0],e[r-1],zae)&&(o&&(l(u)?i.splice(h,0,f):i.push(r-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var jo=mke;function pke(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),a=Math.sin(e._startHeading),s=(1-o)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+s*s),u=c*s,f=Math.atan2(s,r),h=c*a,p=h*h,A=1-p,m=Math.sqrt(A),_=t/4,y=_*_,C=y*_,E=y*y,I=1+_-3*y/4+5*C/4-175*E/64,x=1-_+15*y/8-35*C/8,S=1-3*_+35*y/4,w=1-5*_,v=I*f-x*Math.sin(2*f)*_/2-S*Math.sin(4*f)*y/16-w*Math.sin(6*f)*C/48-Math.sin(8*f)*5*E/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=a,R.tanU=s,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=h,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=A,R.cosineAlpha=m,R.u2Over4=_,R.u4Over16=y,R.u6Over64=C,R.u8Over256=E,R.a0=I,R.a1=x,R.a2=S,R.a3=w,R.distanceRatio=v}function Ake(e,t){return e*t*(4+e*(4-3*t))/16}function Gae(e,t,n,i,o,r,a){let s=Ake(e,n);return(1-s)*e*t*(i+s*o*(a+s*r*(2*a*a-1)))}function gke(e,t,n,i,o,r,a){let s=(t-n)/t,c=r-i,u=Math.atan((1-s)*Math.tan(o)),f=Math.atan((1-s)*Math.tan(a)),h=Math.cos(u),p=Math.sin(u),A=Math.cos(f),m=Math.sin(f),_=h*A,y=h*m,C=p*m,E=p*A,I=c,x=D.TWO_PI,S=Math.cos(I),w=Math.sin(I),v,R,N,L,g;do{S=Math.cos(I),w=Math.sin(I);let F=y-E*S;N=Math.sqrt(A*A*w*w+F*F),R=C+_*S,v=Math.atan2(N,R);let H;N===0?(H=0,L=1):(H=_*w/N,L=1-H*H),x=I,g=R-2*C/L,isFinite(g)||(g=0),I=c+Gae(s,H,L,v,N,R,g)}while(Math.abs(I-x)>D.EPSILON12);let b=L*(t*t-n*n)/(n*n),T=1+b*(4096+b*(b*(320-175*b)-768))/16384,B=b*(256+b*(b*(74-47*b)-128))/1024,M=g*g,O=B*N*(g+B*(R*(2*M-1)-B*g*(4*N*N-3)*(4*M-3)/6)/4),G=n*T*(v-O),k=Math.atan2(A*w,y-E*S),z=Math.atan2(h*w,y*S-E);e._distance=G,e._startHeading=k,e._endHeading=z,e._uSquared=b}var _ke=new d,e6=new d;function Vae(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,e6),_ke),r=d.normalize(i.cartographicToCartesian(n,e6),e6);gke(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=me.clone(t,e._start),e._end=me.clone(n,e._end),e._start.height=0,e._end.height=0,pke(e)}function Xw(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new me,this._end=new me,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Vae(this,e,t,i)}Object.defineProperties(Xw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});Xw.prototype.setEndPoints=function(e,t){Vae(this,e,t,this._ellipsoid)};Xw.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};Xw.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),a=Math.cos(6*i),s=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,A=n.u8Over256,m=n.u2Over4,_=n.u6Over64,y=n.u4Over16,C=2*p*A*o/3+i*(1-m+7*y/4-15*_/4+579*A/64-(y-15*_/4+187*A/16)*o-(5*_/4-115*A/16)*r-29*A*a/16)+(m/2-y+71*_/32-85*A/16)*s+(5*y/16-5*_/4+383*A/96)*c-h*((_-11*A/2)*s+5*A*c/2)+(29*_/96-29*A/16)*u+539*A*f/1536,E=Math.asin(Math.sin(C)*n.cosineAlpha),I=Math.atan(n.a/n.b*Math.tan(E));C=C-n.sigma;let x=Math.cos(2*n.sigma+C),S=Math.sin(C),w=Math.cos(C),v=n.cosineU*w,R=n.sineU*S,L=Math.atan2(S*n.sineHeading,v-R*n.cosineHeading)-Gae(n.f,n.sineAlpha,n.cosineSquaredAlpha,C,S,w,x);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=I,t.height=0,t):new me(this._start.longitude+L,I,0)};var i_=Xw;function n6(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,a=r*i,s=a*i,c=s*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),A=Math.sin(8*u),m=Math.sin(10*u),_=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*a/16384-441*s/65536-4851*c/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*a/4096+2205*s/131072+6237*c/524288)*f+(15*o/256+45*r/1024+525*a/16384+1575*s/65536+155925*c/8388608)*h-(35*r/3072+175*a/12288+3675*s/262144+13475*c/1048576)*p+(315*a/131072+2205*s/524288+43659*c/8388608)*A-(693*s/1310720+6237*c/5242880)*m+1001*c/8388608*_)}function yke(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,a=r*i,s=t,c=s*s,u=c*c,f=u*c,h=f*c,p=h*c,A=p*c,m=Math.sin(2*i),_=Math.cos(2*i),y=Math.sin(4*i),C=Math.cos(4*i),E=Math.sin(6*i),I=Math.cos(6*i),x=Math.sin(8*i),S=Math.cos(8*i),w=Math.sin(10*i),v=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*A/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*a)*A/5242880)*_+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*A/1048576)*C+(151*i*h/4096+4681*i*p/65536+1479*i*A/16384-453*r*A/32768)*I+(1097*i*p/65536+42783*i*A/1048576)*S+8011*i*A/1048576*v+(3*c/8+3*u/16+213*f/2048-3*o*f/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+a*p/1024+28273*A/1048576-471*o*A/8192+9*a*A/4096)*m+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*A/16777216-12517*o*A/131072+7*a*A/2048)*y+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*A/786432-8607*o*A/131072)*E+(1097*h/131072+1097*p/65536+225797*A/10485760-1097*o*A/65536)*x+(8011*p/2621440+8011*A/1048576)*w+293393*A/251658240*R}function ab(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function Cke(e,t,n,i,o){let r=ab(e._ellipticity,n),a=ab(e._ellipticity,o);return Math.atan2(D.negativePiToPi(i-t),a-r)}function Eke(e,t,n,i,o,r,a){let s=e._heading,c=r-i,u=0;if(D.equalsEpsilon(Math.abs(s),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(o)*D.negativePiToPi(c);else{let f=Math.sin(o);u=t*Math.cos(o)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=n6(e._ellipticity,t,o);u=(n6(e._ellipticity,t,a)-f)/Math.cos(s)}return Math.abs(u)}var Ike=new d,t6=new d;function Hae(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,t6),Ike),r=d.normalize(i.cartographicToCartesian(n,t6),t6),a=i.maximumRadius,s=i.minimumRadius,c=a*a,u=s*s;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=me.clone(t,e._start),e._start.height=0,e._end=me.clone(n,e._end),e._end.height=0,e._heading=Cke(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=Eke(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Wae(e,t,n,i,o,r){if(n===0)return me.clone(e,r);let a=o*o,s,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=n6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(c=yke(p,o,i),Math.abs(t)<D.EPSILON10)s=D.negativePiToPi(e.longitude);else{let A=ab(o,e.latitude),m=ab(o,c);u=Math.tan(t)*(m-A),s=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-a*h*h)}u=n/f,t>0?s=D.negativePiToPi(e.longitude+u):s=D.negativePiToPi(e.longitude-u)}return l(r)?(r.longitude=s,r.latitude=c,r.height=0,r):new me(s,c,0)}function dA(e,t,n){let i=n??te.default;this._ellipsoid=i,this._start=new me,this._end=new me,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Hae(this,e,t,i)}Object.defineProperties(dA.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});dA.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??te.default,a=r.maximumRadius,s=r.minimumRadius,c=a*a,u=s*s,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let h=Wae(e,t,n,r.maximumRadius,f);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new dA(e,h,r):(o.setEndPoints(e,h),o)};dA.prototype.setEndPoints=function(e,t){Hae(this,e,t,this._ellipsoid)};dA.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};dA.prototype.interpolateUsingSurfaceDistance=function(e,t){return Wae(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};dA.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(r.longitude)*Math.PI),l(t)||(t=new me),Math.abs(D.PI_OVER_TWO-o)<=D.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-o),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,r.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let a=r.latitude,s=n*Math.sin(a),c=Math.tan(.5*(D.PI_OVER_TWO+a))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+s)/(1-s),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),A=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(A/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,h,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};dA.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let r=ab(n,o.latitude),a=ab(n,e),s=Math.tan(i)*(a-r),c=D.negativePiToPi(o.longitude+s);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new me(c,e,0)};var Oc=dA;var u6=[qi,mi],bke=u6.length,fse=Math.cos(D.toRadians(30)),jae=Math.cos(D.toRadians(150)),dse=0,hse=1e3;function r_(e){e=e??V.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??un.GEODESIC,this._ellipsoid=te.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(r_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+te.packedLength+1+1}}});r_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<bke;i++)if(t instanceof u6[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var xke=new d,Yae=new d,qae=new d;function l6(e,t,n,i,o){let r=ml(i,e,0,xke),a=ml(i,e,n,Yae),s=ml(i,t,0,qae),c=hA(a,r,Yae),u=hA(s,r,qae);return d.cross(u,c,o),d.normalize(o,o)}var Tke=new me,Ske=new d,wke=new d,Bke=new d;function i6(e,t,n,i,o,r,a,s,c,u,f){if(o===0)return;let h;r===un.GEODESIC?h=new i_(e,t,a):r===un.RHUMB&&(h=new Oc(e,t,a));let p=h.surfaceDistance;if(p<o)return;let A=l6(e,t,i,a,Bke),m=Math.ceil(p/o),_=p/m,y=_,C=m-1,E=s.length;for(let I=0;I<C;I++){let x=h.interpolateUsingSurfaceDistance(y,Tke),S=ml(a,x,n,Ske),w=ml(a,x,i,wke);d.pack(A,s,E),d.pack(S,c,E),d.pack(w,u,E),f.push(x.latitude),f.push(x.longitude),E+=3,y+=_}}var o6=new me;function ml(e,t,n,i){return me.clone(t,o6),o6.height=n,me.toCartesian(o6,e,i)}r_.pack=function(e,t,n){let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let a=0;a<r;++a){let s=o[a];d.pack(s,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,te.pack(e._ellipsoid,t,i),i+=te.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};r_.unpack=function(e,t,n){let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let a=e[i++],s=e[i++]===1,c=e[i++],u=te.unpack(e,i);i+=te.packedLength;let f=e[i++],h=e[i++]===1;return l(n)||(n=new r_({positions:r})),n._positions=r,n.granularity=a,n.loop=s,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function hA(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function Kae(e,t,n,i){return i=hA(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var Dke=new d,vke=new d,Pke=new d,mse=new d,Rke=0,Mke=-1;function r6(e,t,n,i,o){let r=hA(n,t,mse),a=Kae(e,t,r,Dke),s=Kae(i,t,r,vke);if(D.equalsEpsilon(d.dot(a,s),Mke,D.EPSILON5))return o=d.cross(r,a,o),o=d.normalize(o,o),o;o=d.add(s,a,o),o=d.normalize(o,o);let c=d.cross(r,o,Pke);return d.dot(s,c)<Rke&&(o=d.negate(o,o)),o}var iF=cn.fromPointNormal(d.ZERO,d.UNIT_Y),Nke=new d,Lke=new d,Oke=new d,Fke=new d,Qke=new d,eF=new d,tF=new me,Xae=new me,Jae=new me;r_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,a=new u6[e._projectionIndex](i),s=dse,c=hse,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let A,m,_,y,C=new Oc(void 0,void 0,i),E,I,x,S=[h[0]];for(f=0;f<p-1;f++)A=h[f],m=h[f+1],E=di.lineSegmentPlane(A,m,iF,eF),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&(e.arcType===un.GEODESIC?S.push(d.clone(E)):e.arcType===un.RHUMB&&(x=i.cartesianToCartographic(E,tF).longitude,_=i.cartesianToCartographic(A,tF),y=i.cartesianToCartographic(m,Xae),C.setEndPoints(_,y),I=C.findIntersectionWithLongitude(x,Jae),E=i.cartographicToCartesian(I,eF),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&S.push(d.clone(E)))),S.push(m);n&&(A=h[p-1],m=h[0],E=di.lineSegmentPlane(A,m,iF,eF),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&(e.arcType===un.GEODESIC?S.push(d.clone(E)):e.arcType===un.RHUMB&&(x=i.cartesianToCartographic(E,tF).longitude,_=i.cartesianToCartographic(A,tF),y=i.cartesianToCartographic(m,Xae),C.setEndPoints(_,y),I=C.findIntersectionWithLongitude(x,Jae),E=i.cartographicToCartesian(I,eF),l(E)&&!d.equalsEpsilon(E,A,D.EPSILON7)&&!d.equalsEpsilon(E,m,D.EPSILON7)&&S.push(d.clone(E)))));let w=S.length,v=new Array(w);for(f=0;f<w;f++){let Y=me.fromCartesian(S[f],i);Y.height=0,v[f]=Y}if(v=jo(v,me.equalsEpsilon),w=v.length,w<2)return;let R=[],N=[],L=[],g=[],b=Nke,T=Lke,B=Oke,M=Fke,O=Qke,G=v[0],k=v[1],z=v[w-1];for(b=ml(i,z,s,b),M=ml(i,k,s,M),T=ml(i,G,s,T),B=ml(i,G,c,B),n?O=r6(b,T,B,M,O):O=l6(G,k,c,i,O),d.pack(O,N,0),d.pack(T,L,0),d.pack(B,g,0),R.push(G.latitude),R.push(G.longitude),i6(G,k,s,c,o,r,i,N,L,g,R),f=1;f<w-1;++f){b=d.clone(T,b),T=d.clone(M,T);let Y=v[f];ml(i,Y,c,B),ml(i,v[f+1],s,M),r6(b,T,B,M,O),u=N.length,d.pack(O,N,u),d.pack(T,L,u),d.pack(B,g,u),R.push(Y.latitude),R.push(Y.longitude),i6(v[f],v[f+1],s,c,o,r,i,N,L,g,R)}let F=v[w-1],H=v[w-2];if(T=ml(i,F,s,T),B=ml(i,F,c,B),n){let Y=v[0];b=ml(i,H,s,b),M=ml(i,Y,s,M),O=r6(b,T,B,M,O)}else O=l6(H,F,c,i,O);if(u=N.length,d.pack(O,N,u),d.pack(T,L,u),d.pack(B,g,u),R.push(F.latitude),R.push(F.longitude),n){for(i6(F,G,s,c,o,r,i,N,L,g,R),u=N.length,f=0;f<3;++f)N[u+f]=N[f],L[u+f]=L[f],g[u+f]=g[f];R.push(G.latitude),R.push(G.longitude)}return u3e(n,a,L,g,N,R,t)};var kke=new d,Uke=new J,zke=new Qe;function Zae(e,t,n,i){let o=hA(n,t,kke),r=d.dot(o,e);if(r>fse||r<jae){let a=hA(i,n,mse),s=r<jae?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Qe.fromAxisAngle(a,s,zke),u=J.fromQuaternion(c,Uke);return J.multiplyByVector(u,e,e),!0}return!1}var $ae=new me,Gke=new d,ese=new d;function Jw(e,t,n,i,o){let r=me.toCartesian(t,e._ellipsoid,Gke),a=d.add(r,n,ese),s=!1,c=e._ellipsoid,u=c.cartesianToCartographic(a,$ae);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(s=!0,a=d.subtract(r,n,ese),u=c.cartesianToCartographic(a,$ae)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),s&&d.negate(o,o),o}var Vke=new d,tse=new d;function nse(e,t,n,i,o,r){let a=d.subtract(t,e,Vke);d.normalize(a,a);let s=n-dse,c=d.multiplyByScalar(a,s,tse);d.add(e,c,o);let u=i-hse;c=d.multiplyByScalar(a,u,tse),d.add(t,c,r)}var Hke=new d;function nF(e,t){let n=cn.getPointDistance(iF,e),i=cn.getPointDistance(iF,t),o=Hke;D.equalsEpsilon(n,0,D.EPSILON2)?(o=hA(t,e,o),d.multiplyByScalar(o,D.EPSILON2,o),d.add(e,o,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(o=hA(e,t,o),d.multiplyByScalar(o,D.EPSILON2,o),d.add(t,o,t))}function Wke(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let o=D.sign(t.longitude);return e.longitude=o*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let o=D.sign(e.longitude);return t.longitude=o*(i-D.EPSILON11),2}return 0}var pse=new me,Ase=new me,ise=new d,a6=new d,ose=new d,rse=new d,jke=new d,ase=new d,Yke=[pse,Ase],qke=new ce,Kke=new d,Xke=new d,Jke=new d,Zke=new d,$ke=new d,e3e=new d,s6=new d,c6=new d,t3e=new d,n3e=new d,i3e=new d,sse=new d,o3e=new d,r3e=new d,a3e=new xn,s3e=new xn,cse=new d,c3e=new d,lse=new d,l3e=[new le,new le],gse=[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],use=gse.length;function u3e(e,t,n,i,o,r,a){let s,c,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,A=f*36,m=h>65535?new Uint32Array(A):new Uint16Array(A),_=new Float64Array(h*3),y=new Float32Array(p),C=new Float32Array(p),E=new Float32Array(p),I=new Float32Array(p),x=new Float32Array(p),S,w,v,R;a&&(S=new Float32Array(p),w=new Float32Array(p),v=new Float32Array(p),R=new Float32Array(h*2));let N=r.length/2,L=0,g=pse;g.height=0;let b=Ase;b.height=0;let T=ise,B=a6;if(a)for(c=0,s=1;s<N;s++)g.latitude=r[c],g.longitude=r[c+1],b.latitude=r[c+2],b.longitude=r[c+3],T=t.project(g,T),B=t.project(b,B),L+=d.distance(T,B),c+=2;let M=i.length/3;B=d.unpack(i,0,B);let O=0;for(c=3,s=1;s<M;s++)T=d.clone(B,T),B=d.unpack(i,c,B),O+=d.distance(T,B),c+=3;let G;c=3;let k=0,z=0,F=0,H=0,Y=!1,$=d.unpack(n,0,rse),W=d.unpack(i,0,a6),K=d.unpack(o,0,ase);if(e){let Ne=d.unpack(n,n.length-6,ose);Zae(K,Ne,$,W)&&(K=d.negate(K,K))}let Z=0,pe=0,ge=0;for(s=0;s<f;s++){let Ne=d.clone($,ose),Le=d.clone(W,ise),Oe=d.clone(K,jke);Y&&(Oe=d.negate(Oe,Oe)),$=d.unpack(n,c,rse),W=d.unpack(i,c,a6),K=d.unpack(o,c,ase),Y=Zae(K,Ne,$,W),g.latitude=r[k],g.longitude=r[k+1],b.latitude=r[k+2],b.longitude=r[k+3];let nt,Fe,_t,rt;if(a){let Nn=Wke(g,b);nt=t.project(g,$ke),Fe=t.project(b,e3e);let Vo=hA(Fe,nt,cse);Vo.y=Math.abs(Vo.y),_t=s6,rt=c6,Nn===0||d.dot(Vo,d.UNIT_Y)>fse?(_t=Jw(t,g,Oe,nt,s6),rt=Jw(t,b,K,Fe,c6)):Nn===1?(rt=Jw(t,b,K,Fe,c6),_t.x=0,_t.y=D.sign(g.longitude-Math.abs(b.longitude)),_t.z=0):(_t=Jw(t,g,Oe,nt,s6),rt.x=0,rt.y=D.sign(g.longitude-b.longitude),rt.z=0)}let je=d.distance(Le,W),st=xn.fromCartesian(Ne,a3e),ft=d.subtract($,Ne,t3e),St=d.normalize(ft,sse),be=d.subtract(Le,Ne,n3e);be=d.normalize(be,be);let Se=d.cross(St,be,sse);Se=d.normalize(Se,Se);let qt=d.cross(be,Oe,o3e);qt=d.normalize(qt,qt);let mt=d.subtract(W,$,i3e);mt=d.normalize(mt,mt);let Ut=d.cross(K,mt,r3e);Ut=d.normalize(Ut,Ut);let Gn=je/O,Xe=Z/O,ro=0,Vt,Do,ji,Mi=0,zo=0;if(a){ro=d.distance(nt,Fe),Vt=xn.fromCartesian(nt,s3e),Do=d.subtract(Fe,nt,cse),ji=d.normalize(Do,c3e);let Nn=ji.x;ji.x=ji.y,ji.y=-Nn,Mi=ro/L,zo=pe/L}for(G=0;G<8;G++){let Nn=H+G*4,Vo=z+G*2,Ho=Nn+3,Xa=G<4?1:-1,Ui=G===2||G===3||G===6||G===7?1:-1;d.pack(st.high,y,Nn),y[Ho]=ft.x,d.pack(st.low,C,Nn),C[Ho]=ft.y,d.pack(qt,E,Nn),E[Ho]=ft.z,d.pack(Ut,I,Nn),I[Ho]=Gn*Xa,d.pack(Se,x,Nn);let Eo=Xe*Ui;Eo===0&&Ui<0&&(Eo=9),x[Ho]=Eo,a&&(S[Nn]=Vt.high.x,S[Nn+1]=Vt.high.y,S[Nn+2]=Vt.low.x,S[Nn+3]=Vt.low.y,v[Nn]=-_t.y,v[Nn+1]=_t.x,v[Nn+2]=rt.y,v[Nn+3]=-rt.x,w[Nn]=Do.x,w[Nn+1]=Do.y,w[Nn+2]=ji.x,w[Nn+3]=ji.y,R[Vo]=Mi*Xa,Eo=zo*Ui,Eo===0&&Ui<0&&(Eo=9),R[Vo+1]=Eo)}let ii=Jke,qn=Zke,Yi=Kke,vo=Xke,mo=ce.fromCartographicArray(Yke,qke),Xo=vi.getMinimumMaximumHeights(mo,u),Go=Xo.minimumTerrainHeight,yn=Xo.maximumTerrainHeight;ge+=Math.abs(Go),ge+=Math.abs(yn),nse(Ne,Le,Go,yn,ii,Yi),nse($,W,Go,yn,qn,vo);let Ei=d.multiplyByScalar(Se,D.EPSILON5,lse);d.add(ii,Ei,ii),d.add(qn,Ei,qn),d.add(Yi,Ei,Yi),d.add(vo,Ei,vo),nF(ii,qn),nF(Yi,vo),d.pack(ii,_,F),d.pack(qn,_,F+3),d.pack(vo,_,F+6),d.pack(Yi,_,F+9),Ei=d.multiplyByScalar(Se,-2*D.EPSILON5,lse),d.add(ii,Ei,ii),d.add(qn,Ei,qn),d.add(Yi,Ei,Yi),d.add(vo,Ei,vo),nF(ii,qn),nF(Yi,vo),d.pack(ii,_,F+12),d.pack(qn,_,F+15),d.pack(vo,_,F+18),d.pack(Yi,_,F+21),k+=2,c+=3,z+=16,F+=24,H+=32,Z+=je,pe+=ro}c=0;let re=0;for(s=0;s<f;s++){for(G=0;G<use;G++)m[c+G]=gse[G]+re;re+=8,c+=use}let ye=l3e;le.fromVertices(n,d.ZERO,3,ye[0]),le.fromVertices(i,d.ZERO,3,ye[1]);let Ce=le.fromBoundingSpheres(ye);Ce.radius+=ge/(f*2);let ve={position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,normalize:!1,values:_}),startHiAndForwardOffsetX:o_(y),startLoAndForwardOffsetY:o_(C),startNormalAndForwardOffsetZ:o_(E),endNormalAndTextureCoordinateNormalizationX:o_(I),rightNormalAndTextureCoordinateNormalizationY:o_(x)};return a&&(ve.startHiLo2D=o_(S),ve.offsetAndRight2D=o_(w),ve.startEndNormals2D=o_(v),ve.texcoordNormalization2D=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new yt({attributes:ve,indices:m,boundingSphere:Ce})}function o_(e){return new Me({componentDatatype:j.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}r_._projectNormal=Jw;var sb=r_;var oF=`in vec4 v_startPlaneNormalEcAndHalfWidth;
|
|
in vec4 v_endPlaneNormalEcAndBatchId;
|
|
in vec4 v_rightPlaneEC; // Technically can compute distance for this here
|
|
in vec4 v_endEcAndStartEcX;
|
|
in vec4 v_texcoordNormalizationAndStartEcYZ;
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
in vec4 v_color;
|
|
#endif
|
|
|
|
void main(void)
|
|
{
|
|
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
|
|
vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
|
|
|
|
// Discard for sky
|
|
if (logDepthOrDepth == 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
|
|
// Check distance of the eye coordinate against the right-facing plane
|
|
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
|
|
|
|
// Check eye coordinate against the mitering planes
|
|
float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
|
|
float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
|
|
|
|
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
|
|
// Check distance of the eye coordinate against start and end planes with normals in the right plane.
|
|
// For computing unskewed lengthwise texture coordinate.
|
|
// Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking.
|
|
|
|
// aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward"
|
|
vec3 alignedPlaneNormal;
|
|
|
|
// start aligned plane
|
|
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
|
|
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
|
|
distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
|
|
|
|
// end aligned plane
|
|
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
|
|
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
|
|
distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
#else // PER_INSTANCE_COLOR
|
|
// Clamp - distance to aligned planes may be negative due to mitering,
|
|
// so fragment texture coordinate might be out-of-bounds.
|
|
float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
|
|
s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
|
|
float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);
|
|
|
|
czm_materialInput materialInput;
|
|
|
|
materialInput.s = s;
|
|
materialInput.st = vec2(s, t);
|
|
materialInput.str = vec3(s, t, 0.0);
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
#endif // PER_INSTANCE_COLOR
|
|
|
|
// Premultiply alpha. Required for classification primitives on translucent globe.
|
|
out_FragColor.rgb *= out_FragColor.a;
|
|
|
|
czm_writeDepthClamp();
|
|
}
|
|
`;var rF=`in vec3 v_forwardDirectionEC;
|
|
in vec3 v_texcoordNormalizationAndHalfWidth;
|
|
in float v_batchId;
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
in vec4 v_color;
|
|
#else
|
|
in vec2 v_alignedPlaneDistances;
|
|
in float v_texcoordT;
|
|
#endif
|
|
|
|
float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
|
|
// We don't expect the ray to ever be parallel to the plane
|
|
return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
|
|
}
|
|
|
|
void main(void)
|
|
{
|
|
vec4 eyeCoordinate = gl_FragCoord;
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
#else // PER_INSTANCE_COLOR
|
|
// Use distances for planes aligned with segment to prevent skew in dashing
|
|
float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
|
|
float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);
|
|
|
|
// Clamp - distance to aligned planes may be negative due to mitering
|
|
distanceFromStart = max(0.0, distanceFromStart);
|
|
distanceFromEnd = max(0.0, distanceFromEnd);
|
|
|
|
float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
|
|
s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;
|
|
|
|
czm_materialInput materialInput;
|
|
|
|
materialInput.s = s;
|
|
materialInput.st = vec2(s, v_texcoordT);
|
|
materialInput.str = vec3(s, v_texcoordT, 0.0);
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
#endif // PER_INSTANCE_COLOR
|
|
}
|
|
`;var aF=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
|
|
in vec4 startHiAndForwardOffsetX;
|
|
in vec4 startLoAndForwardOffsetY;
|
|
in vec4 startNormalAndForwardOffsetZ;
|
|
in vec4 endNormalAndTextureCoordinateNormalizationX;
|
|
in vec4 rightNormalAndTextureCoordinateNormalizationY;
|
|
in vec4 startHiLo2D;
|
|
in vec4 offsetAndRight2D;
|
|
in vec4 startEndNormals2D;
|
|
in vec2 texcoordNormalization2D;
|
|
|
|
in float batchId;
|
|
|
|
out vec3 v_forwardDirectionEC;
|
|
out vec3 v_texcoordNormalizationAndHalfWidth;
|
|
out float v_batchId;
|
|
|
|
// For materials
|
|
#ifdef WIDTH_VARYING
|
|
out float v_width;
|
|
#endif
|
|
#ifdef ANGLE_VARYING
|
|
out float v_polylineAngle;
|
|
#endif
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
out vec4 v_color;
|
|
#else
|
|
out vec2 v_alignedPlaneDistances;
|
|
out float v_texcoordT;
|
|
#endif
|
|
|
|
// Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume.
|
|
// Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient.
|
|
void main()
|
|
{
|
|
v_batchId = batchId;
|
|
|
|
// Start position
|
|
vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
|
|
vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
|
|
vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
|
|
vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
|
|
vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
|
|
vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
|
|
|
|
// Start plane
|
|
vec4 startPlane2D;
|
|
vec4 startPlane3D;
|
|
startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
|
|
startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
|
|
startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
|
|
startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
|
|
|
|
// Right plane
|
|
vec4 rightPlane2D;
|
|
vec4 rightPlane3D;
|
|
rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
|
|
rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
|
|
rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
|
|
rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
|
|
|
|
// End position
|
|
posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
|
|
posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
|
|
posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
|
|
posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
|
|
posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
|
|
vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
|
|
vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
|
|
vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
|
|
|
|
// End plane
|
|
vec4 endPlane2D;
|
|
vec4 endPlane3D;
|
|
endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
|
|
endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
|
|
endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
|
|
endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
|
|
|
|
// Forward direction
|
|
v_forwardDirectionEC = normalize(endEC - startEC);
|
|
|
|
vec2 cleanTexcoordNormalization2D;
|
|
cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
|
|
cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
|
|
vec2 cleanTexcoordNormalization3D;
|
|
cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
|
|
cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
|
|
cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
|
|
|
|
v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
v_color = czm_batchTable_color(batchId);
|
|
#else // PER_INSTANCE_COLOR
|
|
// For computing texture coordinates
|
|
|
|
v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
|
|
v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
|
|
#endif // PER_INSTANCE_COLOR
|
|
|
|
#ifdef WIDTH_VARYING
|
|
float width = czm_batchTable_width(batchId);
|
|
float halfWidth = width * 0.5;
|
|
v_width = width;
|
|
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
|
|
#else
|
|
float halfWidth = 0.5 * czm_batchTable_width(batchId);
|
|
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
|
|
#endif
|
|
|
|
// Compute a normal along which to "push" the position out, extending the miter depending on view distance.
|
|
// Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
|
|
// Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
|
|
// Since this is morphing, compute both 3D and 2D positions and then blend.
|
|
|
|
// ****** 3D ******
|
|
// Check distance to the end plane and start plane, pick the plane that is closer
|
|
vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition
|
|
float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
|
|
float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
|
|
vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
|
|
vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
|
|
vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
|
|
|
|
// Nudge the top vertex upwards to prevent flickering
|
|
vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
|
|
geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
|
|
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
|
|
positionEc3D.xyz += geodeticSurfaceNormal;
|
|
|
|
// Determine if this vertex is on the "left" or "right"
|
|
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
|
|
|
|
// A "perfect" implementation would push along normals according to the angle against forward.
|
|
// In practice, just pushing the normal out by halfWidth is sufficient for morph views.
|
|
positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
|
|
|
|
// ****** 2D ******
|
|
// Check distance to the end plane and start plane, pick the plane that is closer
|
|
vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition
|
|
absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
|
|
absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
|
|
planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
|
|
upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
|
|
normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
|
|
|
|
// Nudge the top vertex upwards to prevent flickering
|
|
geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
|
|
geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
|
|
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
|
|
positionEc2D.xyz += geodeticSurfaceNormal;
|
|
|
|
// Determine if this vertex is on the "left" or "right"
|
|
normalEC *= sign(texcoordNormalization2D.x);
|
|
#ifndef PER_INSTANCE_COLOR
|
|
// Use vertex's sidedness to compute its texture coordinate.
|
|
v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
|
|
#endif
|
|
|
|
// A "perfect" implementation would push along normals according to the angle against forward.
|
|
// In practice, just pushing the normal out by halfWidth is sufficient for morph views.
|
|
positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera)
|
|
|
|
// Blend for actual position
|
|
gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
|
|
|
|
#ifdef ANGLE_VARYING
|
|
// Approximate relative screen space direction of the line.
|
|
vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
|
|
approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
|
|
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
|
|
#endif
|
|
}
|
|
`;var sF=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
|
|
// In 2D and in 3D, texture coordinate normalization component signs encodes:
|
|
// * X sign - sidedness relative to right plane
|
|
// * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume
|
|
#ifndef COLUMBUS_VIEW_2D
|
|
in vec4 startHiAndForwardOffsetX;
|
|
in vec4 startLoAndForwardOffsetY;
|
|
in vec4 startNormalAndForwardOffsetZ;
|
|
in vec4 endNormalAndTextureCoordinateNormalizationX;
|
|
in vec4 rightNormalAndTextureCoordinateNormalizationY;
|
|
#else
|
|
in vec4 startHiLo2D;
|
|
in vec4 offsetAndRight2D;
|
|
in vec4 startEndNormals2D;
|
|
in vec2 texcoordNormalization2D;
|
|
#endif
|
|
|
|
in float batchId;
|
|
|
|
out vec4 v_startPlaneNormalEcAndHalfWidth;
|
|
out vec4 v_endPlaneNormalEcAndBatchId;
|
|
out vec4 v_rightPlaneEC;
|
|
out vec4 v_endEcAndStartEcX;
|
|
out vec4 v_texcoordNormalizationAndStartEcYZ;
|
|
|
|
// For materials
|
|
#ifdef WIDTH_VARYING
|
|
out float v_width;
|
|
#endif
|
|
#ifdef ANGLE_VARYING
|
|
out float v_polylineAngle;
|
|
#endif
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
out vec4 v_color;
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
#ifdef COLUMBUS_VIEW_2D
|
|
vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;
|
|
|
|
vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
|
|
vec3 ecEnd = forwardDirectionEC + ecStart;
|
|
forwardDirectionEC = normalize(forwardDirectionEC);
|
|
|
|
// Right plane
|
|
v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
|
|
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
|
|
|
|
// start plane
|
|
vec4 startPlaneEC;
|
|
startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
|
|
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
|
|
|
|
// end plane
|
|
vec4 endPlaneEC;
|
|
endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
|
|
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
|
|
|
|
v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
|
|
v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;
|
|
|
|
#else // COLUMBUS_VIEW_2D
|
|
vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
|
|
vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
|
|
vec3 ecEnd = ecStart + offset;
|
|
|
|
vec3 forwardDirectionEC = normalize(offset);
|
|
|
|
// start plane
|
|
vec4 startPlaneEC;
|
|
startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
|
|
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
|
|
|
|
// end plane
|
|
vec4 endPlaneEC;
|
|
endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
|
|
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
|
|
|
|
// Right plane
|
|
v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
|
|
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
|
|
|
|
v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
|
|
v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;
|
|
|
|
#endif // COLUMBUS_VIEW_2D
|
|
|
|
v_endEcAndStartEcX.xyz = ecEnd;
|
|
v_endEcAndStartEcX.w = ecStart.x;
|
|
v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;
|
|
|
|
#ifdef PER_INSTANCE_COLOR
|
|
v_color = czm_batchTable_color(batchId);
|
|
#endif // PER_INSTANCE_COLOR
|
|
|
|
// Compute a normal along which to "push" the position out, extending the miter depending on view distance.
|
|
// Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes.
|
|
// Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be.
|
|
vec4 positionRelativeToEye = czm_computePosition();
|
|
|
|
// Check distance to the end plane and start plane, pick the plane that is closer
|
|
vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition
|
|
float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
|
|
float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
|
|
vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
|
|
vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane.
|
|
vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too.
|
|
|
|
// Extrude bottom vertices downward for far view distances, like for GroundPrimitives
|
|
upOrDown = cross(forwardDirectionEC, normalEC);
|
|
upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
|
|
upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
|
|
upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
|
|
positionEC.xyz += upOrDown;
|
|
|
|
v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));
|
|
|
|
// Determine distance along normalEC to push for a volume of appropriate width.
|
|
// Make volumes about double pixel width for a conservative fit - in practice the
|
|
// extra cost here is minimal compared to the loose volume heights.
|
|
//
|
|
// N = normalEC (guaranteed "right-facing")
|
|
// R = rightEC
|
|
// p = angle between N and R
|
|
// w = distance to push along R if R == N
|
|
// d = distance to push along N
|
|
//
|
|
// N R
|
|
// { p| } * cos(p) = dot(N, R) = w / d
|
|
// d | |w * d = w / dot(N, R)
|
|
// { | }
|
|
// o---------- polyline segment ---->
|
|
//
|
|
float width = czm_batchTable_width(batchId);
|
|
#ifdef WIDTH_VARYING
|
|
v_width = width;
|
|
#endif
|
|
|
|
v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
|
|
v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;
|
|
|
|
v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
|
|
v_endPlaneNormalEcAndBatchId.w = batchId;
|
|
|
|
width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R
|
|
width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N
|
|
|
|
// Determine if this vertex is on the "left" or "right"
|
|
#ifdef COLUMBUS_VIEW_2D
|
|
normalEC *= sign(texcoordNormalization2D.x);
|
|
#else
|
|
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
|
|
#endif
|
|
|
|
positionEC.xyz += width * normalEC;
|
|
gl_Position = czm_depthClamp(czm_projection * positionEC);
|
|
|
|
#ifdef ANGLE_VARYING
|
|
// Approximate relative screen space direction of the line.
|
|
vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
|
|
approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
|
|
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
|
|
#endif
|
|
}
|
|
`;var cF=`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 $l=`void clipLineSegmentToNearPlane(
|
|
vec3 p0,
|
|
vec3 p1,
|
|
out vec4 positionWC,
|
|
out bool clipped,
|
|
out bool culledByNearPlane,
|
|
out vec4 clippedPositionEC)
|
|
{
|
|
culledByNearPlane = false;
|
|
clipped = false;
|
|
|
|
vec3 p0ToP1 = p1 - p0;
|
|
float magnitude = length(p0ToP1);
|
|
vec3 direction = normalize(p0ToP1);
|
|
|
|
// Distance that p0 is behind the near plane. Negative means p0 is
|
|
// in front of the near plane.
|
|
float endPoint0Distance = czm_currentFrustum.x + p0.z;
|
|
|
|
// Camera looks down -Z.
|
|
// When moving a point along +Z: LESS VISIBLE
|
|
// * Points in front of the camera move closer to the camera.
|
|
// * Points behind the camrea move farther away from the camera.
|
|
// When moving a point along -Z: MORE VISIBLE
|
|
// * Points in front of the camera move farther away from the camera.
|
|
// * Points behind the camera move closer to the camera.
|
|
|
|
// Positive denominator: -Z, becoming more visible
|
|
// Negative denominator: +Z, becoming less visible
|
|
// Nearly zero: parallel to near plane
|
|
float denominator = -direction.z;
|
|
|
|
if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
|
|
{
|
|
// p0 is behind the near plane and the line to p1 is nearly parallel to
|
|
// the near plane, so cull the segment completely.
|
|
culledByNearPlane = true;
|
|
}
|
|
else if (endPoint0Distance > 0.0)
|
|
{
|
|
// p0 is behind the near plane, and the line to p1 is moving distinctly
|
|
// toward or away from it.
|
|
|
|
// t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction)
|
|
float t = endPoint0Distance / denominator;
|
|
if (t < 0.0 || t > magnitude)
|
|
{
|
|
// Near plane intersection is not between the two points.
|
|
// We already confirmed p0 is behind the naer plane, so now
|
|
// we know the entire segment is behind it.
|
|
culledByNearPlane = true;
|
|
}
|
|
else
|
|
{
|
|
// Segment crosses the near plane, update p0 to lie exactly on it.
|
|
p0 = p0 + t * direction;
|
|
|
|
// Numerical noise might put us a bit on the wrong side of the near plane.
|
|
// Don't let that happen.
|
|
p0.z = min(p0.z, -czm_currentFrustum.x);
|
|
|
|
clipped = true;
|
|
}
|
|
}
|
|
|
|
clippedPositionEC = vec4(p0, 1.0);
|
|
positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
|
|
}
|
|
|
|
vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
|
|
{
|
|
// expandDirection +1 is to the _left_ when looking from positionEC toward nextEC.
|
|
|
|
#ifdef POLYLINE_DASH
|
|
// Compute the window coordinates of the points.
|
|
vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
|
|
vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
|
|
vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
|
|
|
|
// Determine the relative screen space direction of the line.
|
|
vec2 lineDir;
|
|
if (usePrevious) {
|
|
lineDir = normalize(positionWindow.xy - previousWindow.xy);
|
|
}
|
|
else {
|
|
lineDir = normalize(nextWindow.xy - positionWindow.xy);
|
|
}
|
|
angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0)
|
|
|
|
// Quantize the angle so it doesn't change rapidly between segments.
|
|
angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
|
|
#endif
|
|
|
|
vec4 clippedPrevWC, clippedPrevEC;
|
|
bool prevSegmentClipped, prevSegmentCulled;
|
|
clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);
|
|
|
|
vec4 clippedNextWC, clippedNextEC;
|
|
bool nextSegmentClipped, nextSegmentCulled;
|
|
clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);
|
|
|
|
bool segmentClipped, segmentCulled;
|
|
vec4 clippedPositionWC, clippedPositionEC;
|
|
clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);
|
|
|
|
if (segmentCulled)
|
|
{
|
|
return vec4(0.0, 0.0, 0.0, 1.0);
|
|
}
|
|
|
|
vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
|
|
vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);
|
|
|
|
// If a segment was culled, we can't use the corresponding direction
|
|
// computed above. We should never see both of these be true without
|
|
// \`segmentCulled\` above also being true.
|
|
if (prevSegmentCulled)
|
|
{
|
|
directionToPrevWC = -directionToNextWC;
|
|
}
|
|
else if (nextSegmentCulled)
|
|
{
|
|
directionToNextWC = -directionToPrevWC;
|
|
}
|
|
|
|
vec2 thisSegmentForwardWC, otherSegmentForwardWC;
|
|
if (usePrevious)
|
|
{
|
|
thisSegmentForwardWC = -directionToPrevWC;
|
|
otherSegmentForwardWC = directionToNextWC;
|
|
}
|
|
else
|
|
{
|
|
thisSegmentForwardWC = directionToNextWC;
|
|
otherSegmentForwardWC = -directionToPrevWC;
|
|
}
|
|
|
|
vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);
|
|
|
|
vec2 leftWC = thisSegmentLeftWC;
|
|
float expandWidth = width * 0.5;
|
|
|
|
// When lines are split at the anti-meridian, the position may be at the
|
|
// same location as the next or previous position, and we need to handle
|
|
// that to avoid producing NaNs.
|
|
if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
|
|
{
|
|
vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);
|
|
|
|
vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
|
|
float leftSumLength = length(leftSumWC);
|
|
leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);
|
|
|
|
// The sine of the angle between the two vectors is given by the formula
|
|
// |a x b| = |a||b|sin(theta)
|
|
// which is
|
|
// float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0)));
|
|
// Because the z components of both vectors are zero, the x and y coordinate will be zero.
|
|
// Therefore, the sine of the angle is just the z component of the cross product.
|
|
vec2 u = -thisSegmentForwardWC;
|
|
vec2 v = leftWC;
|
|
float sinAngle = abs(u.x * v.y - u.y * v.x);
|
|
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
|
|
}
|
|
|
|
vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
|
|
return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
|
|
}
|
|
|
|
vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
|
|
{
|
|
vec4 positionEC = czm_modelViewRelativeToEye * position;
|
|
vec4 prevEC = czm_modelViewRelativeToEye * previous;
|
|
vec4 nextEC = czm_modelViewRelativeToEye * next;
|
|
return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
|
|
}
|
|
`;var f3e=`#define CLIP_POLYLINE
|
|
${$l}
|
|
${cF}`,d3e=eb;function JC(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=JC.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??f3e,this._fragmentShaderSource=e.fragmentShaderSource??d3e,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(JC.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}}});JC.VERTEX_FORMAT=ke.POSITION_ONLY;JC.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;JC.prototype.isTranslucent=xo.prototype.isTranslucent;JC.prototype.getRenderState=xo.prototype.getRenderState;var Qa=JC;var lF=`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 cb=`#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 h3e=`#define CLIP_POLYLINE
|
|
${$l}
|
|
${lF}`,m3e=cb;function ZC(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=ZC.VERTEX_FORMAT;this.material=l(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??h3e,this._fragmentShaderSource=e.fragmentShaderSource??m3e,this._renderState=xo.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(ZC.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}}});ZC.VERTEX_FORMAT=ke.POSITION_AND_ST;ZC.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;ZC.prototype.isTranslucent=xo.prototype.isTranslucent;ZC.prototype.getRenderState=xo.prototype.getRenderState;var mc=ZC;function mA(e){e=e??V.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new mc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.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=_se(!1),this._renderState3DTiles=_se(!0),this._renderStateMorph=Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},depthTest:{enabled:!0},blending:sn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(mA.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}}});mA.initializeTerrainHeights=function(){return vi.initialize()};function p3e(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,a=o._batchTable.getVertexShaderCallback()(sF);a=Ln._appendShowToShader(o,a),a=Ln._appendDistanceDisplayConditionToShader(o,a),a=Ln._modifyShaderPosition(e,a,t.scene3DOnly);let s=o._batchTable.getVertexShaderCallback()(aF);s=Ln._appendShowToShader(o,s),s=Ln._appendDistanceDisplayConditionToShader(o,s),s=Ln._modifyShaderPosition(e,s,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(oF),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";l(n.material)?(h=l(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],A=new We({defines:u,sources:[a]}),m=new We({defines:p,sources:[h,c]});e._sp=$t.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:A,fragmentShaderSource:m,attributeLocations:r});let _=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(_)){let C=new We({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[a]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:C,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=_;let y=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(y)){let C=new We({defines:u.concat([`MAX_TERRAIN_HEIGHT ${vi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[s]});c=o._batchTable.getVertexShaderCallback()(rF);let E=new We({defines:p,sources:[h,c]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:C,fragmentShaderSource:E,attributeLocations:r})}e._spMorph=y}function _se(e){return Ve.fromCache({cull:{enabled:!0},blending:sn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function A3e(e,t,n,i,o,r){let a=e._primitive,s=a._va.length;o.length=s,r.length=s;let u=t instanceof Qa?{}:n._uniforms,f=a._batchTable.getUniformMapCallback()(u);for(let h=0;h<s;h++){let p=a._va[h],A=o[h];l(A)||(A=o[h]=new it({owner:e,primitiveType:a._primitiveType})),A.vertexArray=p,A.renderState=e._renderState,A.shaderProgram=e._sp,A.uniformMap=f,A.pass=Be.TERRAIN_CLASSIFICATION,A.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=it.shallowClone(A,A.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,A.derivedCommands.tileset=m;let _=it.shallowClone(A,A.derivedCommands.color2D);_.shaderProgram=e._sp2D,A.derivedCommands.color2D=_;let y=it.shallowClone(m,m.derivedCommands.color2D);y.shaderProgram=e._sp2D,m.derivedCommands.color2D=y;let C=it.shallowClone(A,A.derivedCommands.colorMorph);C.renderState=e._renderStateMorph,C.shaderProgram=e._spMorph,C.pickId="czm_batchTable_pickColor(v_batchId)",A.derivedCommands.colorMorph=C}}function yse(e,t,n,i,o,r,a){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=a,n.commandList.push(t)}function g3e(e,t,n,i,o,r,a){let s=e._primitive;Ln._updateBoundingVolumes(s,t,o);let c;t.mode===oe.SCENE3D?c=s._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?c=s._boundingSphereCV:t.mode===oe.SCENE2D&&l(s._boundingSphere2D)?c=s._boundingSphere2D:l(s._boundingSphereMorph)&&(c=s._boundingSphereMorph);let u=t.mode===oe.MORPHING,f=e.classificationType,h=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN&&!u,A,m=t.passes;if(m.render||m.pick&&s.allowPicking){let _=n.length;for(let y=0;y<_;++y){let C=c[y];h&&(A=n[y],yse(e,A,t,o,r,C,a)),p&&(A=n[y].derivedCommands.tileset,yse(e,A,t,o,r,C,a))}}}mA.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!vi.initialized){mA.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,a=new Array(r),s;for(t=0;t<r;++t)if(s=o[t].attributes,!l(s)||!l(s.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let c=o[t];s={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(s[f]=u[f]);l(s.width)||(s.width=new hl({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,sb.setProjectionAndEllipsoid(c.geometry,e.mapProjection),a[t]=new Lt({geometry:c.geometry,attributes:s,id:c.id,pickPrimitive:n})}i.geometryInstances=a,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){p3e(n,u,f)},i._createCommandsFunction=function(c,u,f,h,p,A,m){A3e(n,u,f,h,A,m)},i._updateAndQueueCommandsFunction=function(c,u,f,h,p,A,m,_){g3e(n,u,f,h,p,A,m)},this._primitive=new Ln(i)}if(this.appearance instanceof Qa&&!this._hasPerInstanceColors)throw new de("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};mA.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};mA.isSupported=function(e){return e.frameState.context.depthTexture};mA.prototype.isDestroyed=function(){return!1};mA.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,fe(this)};var Bm=mA;var _3e=new Q(1,1),y3e=!1,C3e=U.WHITE;function lb(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(lb.prototype,{isConstant:{get:function(){return q.isConstant(this._image)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:Ae("image"),repeat:Ae("repeat"),color:Ae("color"),transparent:Ae("transparent")});lb.prototype.getType=function(e){return"Image"};var E3e=new X;lb.prototype.getValue=function(e,t){return l(e)||(e=X.now(E3e)),l(t)||(t={}),t.image=q.getValueOrUndefined(this._image,e),t.repeat=q.getValueOrClonedDefault(this._repeat,e,_3e,t.repeat),t.color=q.getValueOrClonedDefault(this._color,e,C3e,t.color),q.getValueOrDefault(this._transparent,e,y3e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};lb.prototype.equals=function(e){return this===e||e instanceof lb&&q.equals(this._image,e._image)&&q.equals(this._repeat,e._repeat)&&q.equals(this._color,e._color)&&q.equals(this._transparent,e._transparent)};var $C=lb;function I3e(e){if(e instanceof U)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new $C;return t.image=e,t}}function b3e(e,t){return Ae(e,t,I3e)}var ar=b3e;function Zw(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(Zw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),dimensions:Ae("dimensions"),heightReference:Ae("heightReference"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});Zw.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Zw(this)};Zw.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var ub=Zw;var x3e={FIXED:0,INERTIAL:1},Oi=Object.freeze(x3e);function fb(){de.throwInstantiationError()}Object.defineProperties(fb.prototype,{isConstant:{get:de.throwInstantiationError},definitionChanged:{get:de.throwInstantiationError},referenceFrame:{get:de.throwInstantiationError}});fb.prototype.getValue=de.throwInstantiationError;fb.prototype.getValueInReferenceFrame=de.throwInstantiationError;fb.prototype.equals=de.throwInstantiationError;var Cse=new J;fb.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new d),n===i)return d.clone(t,o);let r=At.computeIcrfToCentralBodyFixedMatrix(e,Cse);if(n===Oi.INERTIAL)return J.multiplyByVector(r,t,o);if(n===Oi.FIXED)return J.multiplyByVector(J.transpose(r,Cse),t,o)};var Dm=fb;function eE(e,t){this._definitionChanged=new _e,this._value=d.clone(e),this._referenceFrame=t??Oi.FIXED}Object.defineProperties(eE.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Oi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var T3e=new X;eE.prototype.getValue=function(e,t){return l(e)||(e=X.now(T3e)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};eE.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};eE.prototype.getValueInReferenceFrame=function(e,t,n){return Dm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};eE.prototype.equals=function(e){return this===e||e instanceof eE&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var eu=eE;function $w(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties($w.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),width:Ae("width"),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),cornerType:Ae("cornerType"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});$w.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new $w(this)};$w.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var db=$w;function S3e(e){return e}function w3e(e,t){return Ae(e,t,S3e)}var tu=w3e;function eB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(eB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),length:Ae("length"),topRadius:Ae("topRadius"),bottomRadius:Ae("bottomRadius"),heightReference:Ae("heightReference"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),numberOfVerticalLines:Ae("numberOfVerticalLines"),slices:Ae("slices"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});eB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new eB(this)};eB.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var hb=eB;function tB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(tB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),semiMajorAxis:Ae("semiMajorAxis"),semiMinorAxis:Ae("semiMinorAxis"),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),rotation:Ae("rotation"),stRotation:Ae("stRotation"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),numberOfVerticalLines:Ae("numberOfVerticalLines"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});tB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new tB(this)};tB.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var mb=tB;function nB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(nB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),radii:Ae("radii"),innerRadii:Ae("innerRadii"),minimumClock:Ae("minimumClock"),maximumClock:Ae("maximumClock"),minimumCone:Ae("minimumCone"),maximumCone:Ae("maximumCone"),heightReference:Ae("heightReference"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),stackPartitions:Ae("stackPartitions"),slicePartitions:Ae("slicePartitions"),subdivisions:Ae("subdivisions"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});nB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new nB(this)};nB.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var pb=nB;function iB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(iB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),text:Ae("text"),font:Ae("font"),style:Ae("style"),scale:Ae("scale"),showBackground:Ae("showBackground"),backgroundColor:Ae("backgroundColor"),backgroundPadding:Ae("backgroundPadding"),pixelOffset:Ae("pixelOffset"),eyeOffset:Ae("eyeOffset"),horizontalOrigin:Ae("horizontalOrigin"),verticalOrigin:Ae("verticalOrigin"),heightReference:Ae("heightReference"),fillColor:Ae("fillColor"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),translucencyByDistance:Ae("translucencyByDistance"),pixelOffsetScaleByDistance:Ae("pixelOffsetScaleByDistance"),scaleByDistance:Ae("scaleByDistance"),distanceDisplayCondition:Ae("distanceDisplayCondition"),disableDepthTestDistance:Ae("disableDepthTestDistance")});iB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new iB(this)};iB.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var vm=iB;var B3e=new d(1,1,1),D3e=d.ZERO,v3e=Qe.IDENTITY;function Ese(e,t,n){this.translation=d.clone(e??D3e),this.rotation=Qe.clone(t??v3e),this.scale=d.clone(n??B3e)}Ese.prototype.equals=function(e){return this===e||l(e)&&d.equals(this.translation,e.translation)&&Qe.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var tE=Ese;var f6=new tE;function oB(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(oB.prototype,{isConstant:{get:function(){return q.isConstant(this._translation)&&q.isConstant(this._rotation)&&q.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:Ae("translation"),rotation:Ae("rotation"),scale:Ae("scale")});var P3e=new X;oB.prototype.getValue=function(e,t){return l(e)||(e=X.now(P3e)),l(t)||(t=new tE),t.translation=q.getValueOrClonedDefault(this._translation,e,f6.translation,t.translation),t.rotation=q.getValueOrClonedDefault(this._rotation,e,f6.rotation,t.rotation),t.scale=q.getValueOrClonedDefault(this._scale,e,f6.scale,t.scale),t};oB.prototype.equals=function(e){return this===e||e instanceof oB&&q.equals(this._translation,e._translation)&&q.equals(this._rotation,e._rotation)&&q.equals(this._scale,e._scale)};var Ab=oB;function pA(e,t){this._propertyNames=[],this._definitionChanged=new _e,l(e)&&this.merge(e,t)}Object.defineProperties(pA.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(!q.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});pA.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function R3e(e){return new hi(e)}pA.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,Ae(e,!0,n??R3e)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};pA.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var M3e=new X;pA.prototype.getValue=function(e,t){l(e)||(e=X.now(M3e)),l(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=q.getValueOrUndefined(this[r],e,t[r])}return t};pA.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let a=i[o],s=this[a],c=e[a];s===void 0&&n.indexOf(a)===-1&&this.addProperty(a,void 0,t),c!==void 0&&(s!==void 0?l(s)&&l(s.merge)&&s.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[a]=c.clone():this[a]=c)}};function N3e(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 a=n[r];if(i.indexOf(a)===-1||!q.equals(e[a],t[a]))return!1}return!0}pA.prototype.equals=function(e){return this===e||e instanceof pA&&N3e(this,e)};var nu=pA;function Ise(e){return new Ab(e)}function L3e(e){return new nu(e,Ise)}function O3e(e){return new nu(e)}function F3e(e){return new nu(e)}function rB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this._marsOptions=e&&e.marsOptions||{},this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(rB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),uri:Ae("uri"),scale:Ae("scale"),enableVerticalExaggeration:Ae("enableVerticalExaggeration"),minimumPixelSize:Ae("minimumPixelSize"),maximumScale:Ae("maximumScale"),incrementallyLoadTextures:Ae("incrementallyLoadTextures"),runAnimations:Ae("runAnimations"),clampAnimations:Ae("clampAnimations"),shadows:Ae("shadows"),heightReference:Ae("heightReference"),silhouetteColor:Ae("silhouetteColor"),silhouetteSize:Ae("silhouetteSize"),color:Ae("color"),colorBlendMode:Ae("colorBlendMode"),colorBlendAmount:Ae("colorBlendAmount"),imageBasedLightingFactor:Ae("imageBasedLightingFactor"),environmentMapOptions:Ae("environmentMapOptions",void 0,F3e),lightColor:Ae("lightColor"),distanceDisplayCondition:Ae("distanceDisplayCondition"),nodeTransformations:Ae("nodeTransformations",void 0,L3e),articulations:Ae("articulations",void 0,O3e),clippingPlanes:Ae("clippingPlanes"),customShader:Ae("customShader")});rB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new rB(this)};rB.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new nu(t,Ise)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new nu(n)}};var a_=rB;function aB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(aB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),uri:Ae("uri"),maximumScreenSpaceError:Ae("maximumScreenSpaceError")});aB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new aB(this)};aB.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var gb=aB;function sB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._relativeTo=void 0,this._relativeToSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(sB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),leadTime:Ae("leadTime"),trailTime:Ae("trailTime"),width:Ae("width"),resolution:Ae("resolution"),material:ar("material"),distanceDisplayCondition:Ae("distanceDisplayCondition"),relativeTo:Ae("relativeTo")});sB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e.relativeTo=this.relativeTo,e):new sB(this)};sB.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo};var s_=sB;function cB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(cB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),plane:Ae("plane"),dimensions:Ae("dimensions"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});cB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new cB(this)};cB.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var uF=cB;function lB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(lB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),pixelSize:Ae("pixelSize"),heightReference:Ae("heightReference"),color:Ae("color"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),scaleByDistance:Ae("scaleByDistance"),translucencyByDistance:Ae("translucencyByDistance"),distanceDisplayCondition:Ae("distanceDisplayCondition"),disableDepthTestDistance:Ae("disableDepthTestDistance"),splitDirection:Ae("splitDirection")});lB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new lB(this)};lB.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var _b=lB;function Q3e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Fc=Q3e;function k3e(e){return Array.isArray(e)&&(e=new Fc(e)),new hi(e)}function uB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(uB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),hierarchy:Ae("hierarchy",void 0,k3e),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),stRotation:Ae("stRotation"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),perPositionHeight:Ae("perPositionHeight"),closeTop:Ae("closeTop"),closeBottom:Ae("closeBottom"),arcType:Ae("arcType"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex"),textureCoordinates:Ae("textureCoordinates")});uB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new uB(this)};uB.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var Pm=uB;function fB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(fB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),width:Ae("width"),granularity:Ae("granularity"),material:ar("material"),depthFailMaterial:ar("depthFailMaterial"),arcType:Ae("arcType"),clampToGround:Ae("clampToGround"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});fB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new fB(this)};fB.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var pl=fB;function dB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(dB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),shape:Ae("shape"),cornerType:Ae("cornerType"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});dB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new dB(this)};dB.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var yb=dB;function hB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(hB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),coordinates:Ae("coordinates"),height:Ae("height"),heightReference:Ae("heightReference"),extrudedHeight:Ae("extrudedHeight"),extrudedHeightReference:Ae("extrudedHeightReference"),rotation:Ae("rotation"),stRotation:Ae("stRotation"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition"),classificationType:Ae("classificationType"),zIndex:Ae("zIndex")});hB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new hB(this)};hB.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Rm=hB;function mB(e){this._definitionChanged=new _e,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??V.EMPTY_OBJECT)}Object.defineProperties(mB.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Ae("show"),positions:Ae("positions"),minimumHeights:Ae("minimumHeights"),maximumHeights:Ae("maximumHeights"),granularity:Ae("granularity"),fill:Ae("fill"),material:ar("material"),outline:Ae("outline"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth"),shadows:Ae("shadows"),distanceDisplayCondition:Ae("distanceDisplayCondition")});mB.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new mB(this)};mB.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var c_=mB;var U3e=new me,d6=[];function z3e(e){return new eu(e)}function G3e(e){return Ae(e,void 0,z3e)}function Is(e,t){return Ae(e,void 0,function(n){return n instanceof t?n:new t(n)})}function qf(e){e=e??V.EMPTY_OBJECT;let t=e.id;l(t)||(t=Jn()),this._availability=void 0,this._id=t,this._definitionChanged=new _e,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??n_.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",...d6],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 h6(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],a=r._show;(!n&&a)!==(n&&a)&&h6(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(qf.prototype,{availability:tu("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:tu("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&h6(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:tu("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&h6(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Is("billboard",dl),box:Is("box",ub),corridor:Is("corridor",db),cylinder:Is("cylinder",hb),description:Ae("description"),ellipse:Is("ellipse",mb),ellipsoid:Is("ellipsoid",pb),label:Is("label",vm),model:Is("model",a_),tileset:Is("tileset",gb),orientation:Ae("orientation"),path:Is("path",s_),plane:Is("plane",uF),point:Is("point",_b),polygon:Is("polygon",Pm),polyline:Is("polyline",pl),polylineVolume:Is("polylineVolume",yb),properties:Is("properties",nu),position:G3e("position"),rectangle:Is("rectangle",Rm),viewFrom:Ae("viewFrom"),wall:Is("wall",c_)});qf.registerEntityType=function(e,t){Object.defineProperties(qf.prototype,{[e]:Is(e,t)}),d6.includes(e)||d6.push(e)};qf.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};qf.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,tu(e,!0))};qf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};qf.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let a=this[r],s=e[r];!l(a)&&t.indexOf(r)===-1&&this.addProperty(r),l(s)&&(l(a)?l(a.merge)&&a.merge(s):l(s.merge)&&l(s.clone)?this[r]=s.clone():this[r]=s)}};var bse=new J,xse=new d,Tse=new Qe;qf.prototype.computeModelMatrix=function(e,t){let n=q.getValueOrUndefined(this._position,e,xse);if(!l(n))return;let i=q.getValueOrUndefined(this._orientation,e,Tse);return l(i)?t=P.fromRotationTranslation(J.fromQuaternion(i,bse),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};qf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){let r=q.getValueOrDefault(t,e,ot.NONE),a=q.getValueOrUndefined(this._position,e,xse);if(r===ot.NONE||!l(a)||d.equalsEpsilon(a,d.ZERO,D.EPSILON8))return this.computeModelMatrix(e,o);let s=i.cartesianToCartographic(a,U3e);Hf(r)?s.height=n:s.height+=n,a=i.cartographicToCartesian(s,a);let c=q.getValueOrUndefined(this._orientation,e,Tse);return l(c)?o=P.fromRotationTranslation(J.fromQuaternion(c,bse),a,o):o=At.eastNorthUpToFixedFrame(a,void 0,o),o};qf.supportsMaterialsforEntitiesOnTerrain=function(e){return Zl.supportsMaterials(e)};qf.supportsPolylinesOnTerrain=function(e){return Bm.isSupported(e)};var $o=qf;var V3e=new Kt(U.WHITE),H3e=new hi(!0),W3e=new hi(!0),j3e=new hi(!1),Y3e=new hi(U.BLACK),q3e=new hi(Bn.DISABLED),K3e=new hi(new Gt),X3e=new hi(ei.BOTH);function Al(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=$o.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Al.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&q.isConstant(this._showProperty)&&q.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}}});Al.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Al.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Al.prototype.createFillGeometryInstance=de.throwInstantiationError;Al.prototype.createOutlineGeometryInstance=de.throwInstantiationError;Al.prototype.isDestroyed=function(){return!1};Al.prototype.destroy=function(){fe(this)};Al.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(Ze.MINIMUM_VALUE)};Al.prototype._isOnTerrain=function(e,t){return!1};Al.prototype._getIsClosed=function(e){return!0};Al.prototype._isDynamic=de.throwInstantiationError;Al.prototype._setStaticOptions=de.throwInstantiationError;Al.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,a=l(r)&&r.isConstant?r.getValue(Ze.MINIMUM_VALUE):!0,s=o.outline,c=l(s);if(c&&s.isConstant&&(c=s.getValue(Ze.MINIMUM_VALUE)),!a&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??V3e,this._fillProperty=r??W3e,this._showProperty=u??H3e,this._showOutlineProperty=o.outline??j3e,this._outlineColorProperty=c?o.outlineColor??Y3e:void 0,this._shadowsProperty=o.shadows??q3e,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??K3e,this._classificationTypeProperty=o.classificationType??X3e,this._fillEnabled=a;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(bt(bt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=l(h)?h.getValue(Ze.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Al.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Ti=Al;function Cb(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(Cb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var J3e=new X;Cb.prototype.getValue=function(e,t){return l(e)||(e=X.now(J3e)),this._callback(e,t)};Cb.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Cb.prototype.equals=function(e){return this===e||e instanceof Cb&&this._callback===e._callback&&this._isConstant===e._isConstant};var Mm=Cb;var Sse=new d;function Eb(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new me,this._normal=new d,this._definitionChanged=new _e,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ze.MINIMUM_VALUE,Sse);if(!l(r)||d.equals(r,d.ZERO)||!l(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(Eb.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Eb.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);l(o)?this._terrainHeight=o:this._terrainHeight=0;let r=a=>{this._terrainHeight=a.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var Z3e=new X;Eb.prototype.getValue=function(e,t){l(e)||(e=X.now(Z3e));let n=q.getValueOrDefault(this._heightReference,e,ot.NONE),i=q.getValueOrDefault(this._extrudedHeightReference,e,ot.NONE);if(n===ot.NONE&&!XI(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Sse);if(!l(r)||d.equals(r,d.ZERO)||!l(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,D.EPSILON10))return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let a=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);return d.multiplyByScalar(a,this._terrainHeight,t)};Eb.prototype.isDestroyed=function(){return!1};Eb.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),fe(this)};var Ib=Eb;function $3e(e,t,n,i){if(Ti.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let a=new Mm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ib(this._scene,a,r)}}var l_=$3e;var wse=d.ZERO,Bse=new d,eUe=new d,Dse=new U;function tUe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Hu(e,t){Ti.call(this,{entity:e,scene:t,geometryOptions:new tUe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Hu.prototype=Object.create(Ti.prototype),Hu.prototype.constructor=Hu);Object.defineProperties(Hu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Hu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=$n.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,Dse)),l(s)||(s=U.WHITE),a.color=Jt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,wse,Bse))),new Lt({id:t,geometry:Nc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:a})};Hu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Dse),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,wse,Bse))),new Lt({id:t,geometry:Sm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Hu.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Hu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Ti.prototype._isHidden.call(this,e,t)};Hu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};Hu.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ze.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==ot.NONE?mn.ALL:void 0};Hu.prototype._onEntityPropertyChanged=l_;Hu.DynamicGeometryUpdater=bb;function bb(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(bb.prototype=Object.create(xi.prototype),bb.prototype.constructor=bb);bb.prototype._isHidden=function(e,t,n){let i=q.getValueOrUndefined(e.position,n,eUe),o=this._options.dimensions;return!l(i)||!l(o)||xi.prototype._isHidden.call(this,e,t,n)};bb.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,ot.NONE),o=this._options;o.dimensions=q.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==ot.NONE?mn.ALL:void 0};var fF=Hu;function nE(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Oi.FIXED,this._definitionChanged=new _e,this.setCallback(e,t)}Object.defineProperties(nE.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var nUe=new X;nE.prototype.getValue=function(e,t){return l(e)||(e=X.now(nUe)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};nE.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};nE.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Dm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};nE.prototype.equals=function(e){return this===e||e instanceof nE&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var dF=nE;/*! @license DOMPurify 3.3.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.3.3/LICENSE */var{entries:Qse,setPrototypeOf:vse,isFrozen:iUe,getPrototypeOf:oUe,getOwnPropertyDescriptor:rUe}=Object,{freeze:_l,seal:Kf,create:pF}=Object,{apply:C6,construct:E6}=typeof Reflect<"u"&&Reflect;_l||(_l=function(t){return t});Kf||(Kf=function(t){return t});C6||(C6=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),r=2;r<i;r++)o[r-2]=arguments[r];return t.apply(n,o)});E6||(E6=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return new t(...i)});var hF=yl(Array.prototype.forEach),aUe=yl(Array.prototype.lastIndexOf),Pse=yl(Array.prototype.pop),pB=yl(Array.prototype.push),sUe=yl(Array.prototype.splice),AF=yl(String.prototype.toLowerCase),m6=yl(String.prototype.toString),p6=yl(String.prototype.match),AB=yl(String.prototype.replace),cUe=yl(String.prototype.indexOf),lUe=yl(String.prototype.trim),Wu=yl(Object.prototype.hasOwnProperty),gl=yl(RegExp.prototype.test),gB=uUe(TypeError);function yl(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return C6(e,t,i)}}function uUe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return E6(e,n)}}function Fi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:AF;vse&&vse(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(iUe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function fUe(e){for(let t=0;t<e.length;t++)Wu(e,t)||(e[t]=null);return e}function Nm(e){let t=pF(null);for(let[n,i]of Qse(e))Wu(e,n)&&(Array.isArray(i)?t[n]=fUe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=Nm(i):t[n]=i);return t}function _B(e,t){for(;e!==null;){let i=rUe(e,t);if(i){if(i.get)return yl(i.get);if(typeof i.value=="function")return yl(i.value)}e=oUe(e)}function n(){return null}return n}var Rse=_l(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),A6=_l(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),g6=_l(["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"]),dUe=_l(["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"]),_6=_l(["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"]),hUe=_l(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Mse=_l(["#text"]),Nse=_l(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),y6=_l(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Lse=_l(["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"]),mF=_l(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),mUe=Kf(/\{\{[\w\W]*|[\w\W]*\}\}/gm),pUe=Kf(/<%[\w\W]*|[\w\W]*%>/gm),AUe=Kf(/\$\{[\w\W]*/gm),gUe=Kf(/^data-[\-\w.\u00B7-\uFFFF]+$/),_Ue=Kf(/^aria-[\-\w]+$/),kse=Kf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),yUe=Kf(/^(?:\w+script|data):/i),CUe=Kf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Use=Kf(/^html$/i),EUe=Kf(/^[a-z][.\w]*(-[.\w]+)+$/i),Ose=Object.freeze({__proto__:null,ARIA_ATTR:_Ue,ATTR_WHITESPACE:CUe,CUSTOM_ELEMENT:EUe,DATA_ATTR:gUe,DOCTYPE_NAME:Use,ERB_EXPR:pUe,IS_ALLOWED_URI:kse,IS_SCRIPT_OR_DATA:yUe,MUSTACHE_EXPR:mUe,TMPLIT_EXPR:AUe}),yB={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},IUe=function(){return typeof window>"u"?null:window},bUe=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(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Fse=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function zse(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:IUe(),t=on=>zse(on);if(t.version="3.3.3",t.removed=[],!e||!e.document||e.document.nodeType!==yB.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:a,Node:s,Element:c,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:A}=e,m=c.prototype,_=_B(m,"cloneNode"),y=_B(m,"remove"),C=_B(m,"nextSibling"),E=_B(m,"childNodes"),I=_B(m,"parentNode");if(typeof a=="function"){let on=n.createElement("template");on.content&&on.content.ownerDocument&&(n=on.content.ownerDocument)}let x,S="",{implementation:w,createNodeIterator:v,createDocumentFragment:R,getElementsByTagName:N}=n,{importNode:L}=i,g=Fse();t.isSupported=typeof Qse=="function"&&typeof I=="function"&&w&&w.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:b,ERB_EXPR:T,TMPLIT_EXPR:B,DATA_ATTR:M,ARIA_ATTR:O,IS_SCRIPT_OR_DATA:G,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:z}=Ose,{IS_ALLOWED_URI:F}=Ose,H=null,Y=Fi({},[...Rse,...A6,...g6,..._6,...Mse]),$=null,W=Fi({},[...Nse,...y6,...Lse,...mF]),K=Object.seal(pF(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}})),Z=null,pe=null,ge=Object.seal(pF(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),re=!0,ye=!0,Ce=!1,ve=!0,Ne=!1,Le=!0,Oe=!1,nt=!1,Fe=!1,_t=!1,rt=!1,je=!1,st=!0,ft=!1,St="user-content-",be=!0,Se=!1,qt={},mt=null,Ut=Fi({},["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"]),Gn=null,Xe=Fi({},["audio","video","img","source","image","track"]),ro=null,Vt=Fi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Do="http://www.w3.org/1998/Math/MathML",ji="http://www.w3.org/2000/svg",Mi="http://www.w3.org/1999/xhtml",zo=Mi,ii=!1,qn=null,Yi=Fi({},[Do,ji,Mi],m6),vo=Fi({},["mi","mo","mn","ms","mtext"]),mo=Fi({},["annotation-xml"]),Xo=Fi({},["title","style","font","a","script"]),Go=null,yn=["application/xhtml+xml","text/html"],Ei="text/html",Nn=null,Vo=null,Ho=n.createElement("form"),Xa=function(we){return we instanceof RegExp||we instanceof Function},Ui=function(){let we=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Vo&&Vo===we)){if((!we||typeof we!="object")&&(we={}),we=Nm(we),Go=yn.indexOf(we.PARSER_MEDIA_TYPE)===-1?Ei:we.PARSER_MEDIA_TYPE,Nn=Go==="application/xhtml+xml"?m6:AF,H=Wu(we,"ALLOWED_TAGS")?Fi({},we.ALLOWED_TAGS,Nn):Y,$=Wu(we,"ALLOWED_ATTR")?Fi({},we.ALLOWED_ATTR,Nn):W,qn=Wu(we,"ALLOWED_NAMESPACES")?Fi({},we.ALLOWED_NAMESPACES,m6):Yi,ro=Wu(we,"ADD_URI_SAFE_ATTR")?Fi(Nm(Vt),we.ADD_URI_SAFE_ATTR,Nn):Vt,Gn=Wu(we,"ADD_DATA_URI_TAGS")?Fi(Nm(Xe),we.ADD_DATA_URI_TAGS,Nn):Xe,mt=Wu(we,"FORBID_CONTENTS")?Fi({},we.FORBID_CONTENTS,Nn):Ut,Z=Wu(we,"FORBID_TAGS")?Fi({},we.FORBID_TAGS,Nn):Nm({}),pe=Wu(we,"FORBID_ATTR")?Fi({},we.FORBID_ATTR,Nn):Nm({}),qt=Wu(we,"USE_PROFILES")?we.USE_PROFILES:!1,re=we.ALLOW_ARIA_ATTR!==!1,ye=we.ALLOW_DATA_ATTR!==!1,Ce=we.ALLOW_UNKNOWN_PROTOCOLS||!1,ve=we.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=we.SAFE_FOR_TEMPLATES||!1,Le=we.SAFE_FOR_XML!==!1,Oe=we.WHOLE_DOCUMENT||!1,_t=we.RETURN_DOM||!1,rt=we.RETURN_DOM_FRAGMENT||!1,je=we.RETURN_TRUSTED_TYPE||!1,Fe=we.FORCE_BODY||!1,st=we.SANITIZE_DOM!==!1,ft=we.SANITIZE_NAMED_PROPS||!1,be=we.KEEP_CONTENT!==!1,Se=we.IN_PLACE||!1,F=we.ALLOWED_URI_REGEXP||kse,zo=we.NAMESPACE||Mi,vo=we.MATHML_TEXT_INTEGRATION_POINTS||vo,mo=we.HTML_INTEGRATION_POINTS||mo,K=we.CUSTOM_ELEMENT_HANDLING||{},we.CUSTOM_ELEMENT_HANDLING&&Xa(we.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(K.tagNameCheck=we.CUSTOM_ELEMENT_HANDLING.tagNameCheck),we.CUSTOM_ELEMENT_HANDLING&&Xa(we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(K.attributeNameCheck=we.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),we.CUSTOM_ELEMENT_HANDLING&&typeof we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(K.allowCustomizedBuiltInElements=we.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ne&&(ye=!1),rt&&(_t=!0),qt&&(H=Fi({},Mse),$=pF(null),qt.html===!0&&(Fi(H,Rse),Fi($,Nse)),qt.svg===!0&&(Fi(H,A6),Fi($,y6),Fi($,mF)),qt.svgFilters===!0&&(Fi(H,g6),Fi($,y6),Fi($,mF)),qt.mathMl===!0&&(Fi(H,_6),Fi($,Lse),Fi($,mF))),Wu(we,"ADD_TAGS")||(ge.tagCheck=null),Wu(we,"ADD_ATTR")||(ge.attributeCheck=null),we.ADD_TAGS&&(typeof we.ADD_TAGS=="function"?ge.tagCheck=we.ADD_TAGS:(H===Y&&(H=Nm(H)),Fi(H,we.ADD_TAGS,Nn))),we.ADD_ATTR&&(typeof we.ADD_ATTR=="function"?ge.attributeCheck=we.ADD_ATTR:($===W&&($=Nm($)),Fi($,we.ADD_ATTR,Nn))),we.ADD_URI_SAFE_ATTR&&Fi(ro,we.ADD_URI_SAFE_ATTR,Nn),we.FORBID_CONTENTS&&(mt===Ut&&(mt=Nm(mt)),Fi(mt,we.FORBID_CONTENTS,Nn)),we.ADD_FORBID_CONTENTS&&(mt===Ut&&(mt=Nm(mt)),Fi(mt,we.ADD_FORBID_CONTENTS,Nn)),be&&(H["#text"]=!0),Oe&&Fi(H,["html","head","body"]),H.table&&(Fi(H,["tbody"]),delete Z.tbody),we.TRUSTED_TYPES_POLICY){if(typeof we.TRUSTED_TYPES_POLICY.createHTML!="function")throw gB('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof we.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw gB('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=we.TRUSTED_TYPES_POLICY,S=x.createHTML("")}else x===void 0&&(x=bUe(A,o)),x!==null&&typeof S=="string"&&(S=x.createHTML(""));_l&&_l(we),Vo=we}},Eo=Fi({},[...A6,...g6,...dUe]),ps=Fi({},[..._6,...hUe]),da=function(we){let lt=I(we);(!lt||!lt.tagName)&&(lt={namespaceURI:zo,tagName:"template"});let an=AF(we.tagName),fo=AF(lt.tagName);return qn[we.namespaceURI]?we.namespaceURI===ji?lt.namespaceURI===Mi?an==="svg":lt.namespaceURI===Do?an==="svg"&&(fo==="annotation-xml"||vo[fo]):!!Eo[an]:we.namespaceURI===Do?lt.namespaceURI===Mi?an==="math":lt.namespaceURI===ji?an==="math"&&mo[fo]:!!ps[an]:we.namespaceURI===Mi?lt.namespaceURI===ji&&!mo[fo]||lt.namespaceURI===Do&&!vo[fo]?!1:!ps[an]&&(Xo[an]||!Eo[an]):!!(Go==="application/xhtml+xml"&&qn[we.namespaceURI]):!1},wr=function(we){pB(t.removed,{element:we});try{I(we).removeChild(we)}catch{y(we)}},As=function(we,lt){try{pB(t.removed,{attribute:lt.getAttributeNode(we),from:lt})}catch{pB(t.removed,{attribute:null,from:lt})}if(lt.removeAttribute(we),we==="is")if(_t||rt)try{wr(lt)}catch{}else try{lt.setAttribute(we,"")}catch{}},Ru=function(we){let lt=null,an=null;if(Fe)we="<remove></remove>"+we;else{let ao=p6(we,/^[\r\n\t ]+/);an=ao&&ao[0]}Go==="application/xhtml+xml"&&zo===Mi&&(we='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+we+"</body></html>");let fo=x?x.createHTML(we):we;if(zo===Mi)try{lt=new p().parseFromString(fo,Go)}catch{}if(!lt||!lt.documentElement){lt=w.createDocument(zo,"template",null);try{lt.documentElement.innerHTML=ii?S:fo}catch{}}let Ma=lt.body||lt.documentElement;return we&&an&&Ma.insertBefore(n.createTextNode(an),Ma.childNodes[0]||null),zo===Mi?N.call(lt,Oe?"html":"body")[0]:Oe?lt.documentElement:Ma},Mu=function(we){return v.call(we.ownerDocument||we,we,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Nu=function(we){return we instanceof h&&(typeof we.nodeName!="string"||typeof we.textContent!="string"||typeof we.removeChild!="function"||!(we.attributes instanceof f)||typeof we.removeAttribute!="function"||typeof we.setAttribute!="function"||typeof we.namespaceURI!="string"||typeof we.insertBefore!="function"||typeof we.hasChildNodes!="function")},Kd=function(we){return typeof s=="function"&&we instanceof s};function Fs(on,we,lt){hF(on,an=>{an.call(t,we,lt,Vo)})}let Pg=function(we){let lt=null;if(Fs(g.beforeSanitizeElements,we,null),Nu(we))return wr(we),!0;let an=Nn(we.nodeName);if(Fs(g.uponSanitizeElement,we,{tagName:an,allowedTags:H}),Le&&we.hasChildNodes()&&!Kd(we.firstElementChild)&&gl(/<[/\w!]/g,we.innerHTML)&&gl(/<[/\w!]/g,we.textContent)||we.nodeType===yB.progressingInstruction||Le&&we.nodeType===yB.comment&&gl(/<[/\w]/g,we.data))return wr(we),!0;if(!(ge.tagCheck instanceof Function&&ge.tagCheck(an))&&(!H[an]||Z[an])){if(!Z[an]&&pr(an)&&(K.tagNameCheck instanceof RegExp&&gl(K.tagNameCheck,an)||K.tagNameCheck instanceof Function&&K.tagNameCheck(an)))return!1;if(be&&!mt[an]){let fo=I(we)||we.parentNode,Ma=E(we)||we.childNodes;if(Ma&&fo){let ao=Ma.length;for(let ha=ao-1;ha>=0;--ha){let il=_(Ma[ha],!0);il.__removalCount=(we.__removalCount||0)+1,fo.insertBefore(il,C(we))}}}return wr(we),!0}return we instanceof c&&!da(we)||(an==="noscript"||an==="noembed"||an==="noframes")&&gl(/<\/no(script|embed|frames)/i,we.innerHTML)?(wr(we),!0):(Ne&&we.nodeType===yB.text&&(lt=we.textContent,hF([b,T,B],fo=>{lt=AB(lt,fo," ")}),we.textContent!==lt&&(pB(t.removed,{element:we.cloneNode()}),we.textContent=lt)),Fs(g.afterSanitizeElements,we,null),!1)},dm=function(we,lt,an){if(pe[lt]||st&&(lt==="id"||lt==="name")&&(an in n||an in Ho))return!1;if(!(ye&&!pe[lt]&&gl(M,lt))){if(!(re&&gl(O,lt))){if(!(ge.attributeCheck instanceof Function&&ge.attributeCheck(lt,we))){if(!$[lt]||pe[lt]){if(!(pr(we)&&(K.tagNameCheck instanceof RegExp&&gl(K.tagNameCheck,we)||K.tagNameCheck instanceof Function&&K.tagNameCheck(we))&&(K.attributeNameCheck instanceof RegExp&&gl(K.attributeNameCheck,lt)||K.attributeNameCheck instanceof Function&&K.attributeNameCheck(lt,we))||lt==="is"&&K.allowCustomizedBuiltInElements&&(K.tagNameCheck instanceof RegExp&&gl(K.tagNameCheck,an)||K.tagNameCheck instanceof Function&&K.tagNameCheck(an))))return!1}else if(!ro[lt]){if(!gl(F,AB(an,k,""))){if(!((lt==="src"||lt==="xlink:href"||lt==="href")&&we!=="script"&&cUe(an,"data:")===0&&Gn[we])){if(!(Ce&&!gl(G,AB(an,k,"")))){if(an)return!1}}}}}}}return!0},pr=function(we){return we!=="annotation-xml"&&p6(we,z)},Ja=function(we){Fs(g.beforeSanitizeAttributes,we,null);let{attributes:lt}=we;if(!lt||Nu(we))return;let an={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:$,forceKeepAttr:void 0},fo=lt.length;for(;fo--;){let Ma=lt[fo],{name:ao,namespaceURI:ha,value:il}=Ma,Rg=Nn(ao),cw=il,gs=ao==="value"?cw:lUe(cw);if(an.attrName=Rg,an.attrValue=gs,an.keepAttr=!0,an.forceKeepAttr=void 0,Fs(g.uponSanitizeAttribute,we,an),gs=an.attrValue,ft&&(Rg==="id"||Rg==="name")&&(As(ao,we),gs=St+gs),Le&&gl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,gs)){As(ao,we);continue}if(Rg==="attributename"&&p6(gs,"href")){As(ao,we);continue}if(an.forceKeepAttr)continue;if(!an.keepAttr){As(ao,we);continue}if(!ve&&gl(/\/>/i,gs)){As(ao,we);continue}Ne&&hF([b,T,B],oM=>{gs=AB(gs,oM," ")});let iM=Nn(we.nodeName);if(!dm(iM,Rg,gs)){As(ao,we);continue}if(x&&typeof A=="object"&&typeof A.getAttributeType=="function"&&!ha)switch(A.getAttributeType(iM,Rg)){case"TrustedHTML":{gs=x.createHTML(gs);break}case"TrustedScriptURL":{gs=x.createScriptURL(gs);break}}if(gs!==cw)try{ha?we.setAttributeNS(ha,ao,gs):we.setAttribute(ao,gs),Nu(we)?wr(we):Pse(t.removed)}catch{As(ao,we)}}Fs(g.afterSanitizeAttributes,we,null)},Za=function on(we){let lt=null,an=Mu(we);for(Fs(g.beforeSanitizeShadowDOM,we,null);lt=an.nextNode();)Fs(g.uponSanitizeShadowNode,lt,null),Pg(lt),Ja(lt),lt.content instanceof r&&on(lt.content);Fs(g.afterSanitizeShadowDOM,we,null)};return t.sanitize=function(on){let we=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},lt=null,an=null,fo=null,Ma=null;if(ii=!on,ii&&(on="<!-->"),typeof on!="string"&&!Kd(on))if(typeof on.toString=="function"){if(on=on.toString(),typeof on!="string")throw gB("dirty is not a string, aborting")}else throw gB("toString is not a function");if(!t.isSupported)return on;if(nt||Ui(we),t.removed=[],typeof on=="string"&&(Se=!1),Se){if(on.nodeName){let il=Nn(on.nodeName);if(!H[il]||Z[il])throw gB("root node is forbidden and cannot be sanitized in-place")}}else if(on instanceof s)lt=Ru("<!---->"),an=lt.ownerDocument.importNode(on,!0),an.nodeType===yB.element&&an.nodeName==="BODY"||an.nodeName==="HTML"?lt=an:lt.appendChild(an);else{if(!_t&&!Ne&&!Oe&&on.indexOf("<")===-1)return x&&je?x.createHTML(on):on;if(lt=Ru(on),!lt)return _t?null:je?S:""}lt&&Fe&&wr(lt.firstChild);let ao=Mu(Se?on:lt);for(;fo=ao.nextNode();)Pg(fo),Ja(fo),fo.content instanceof r&&Za(fo.content);if(Se)return on;if(_t){if(rt)for(Ma=R.call(lt.ownerDocument);lt.firstChild;)Ma.appendChild(lt.firstChild);else Ma=lt;return($.shadowroot||$.shadowrootmode)&&(Ma=L.call(i,Ma,!0)),Ma}let ha=Oe?lt.outerHTML:lt.innerHTML;return Oe&&H["!doctype"]&<.ownerDocument&<.ownerDocument.doctype&<.ownerDocument.doctype.name&&gl(Use,lt.ownerDocument.doctype.name)&&(ha="<!DOCTYPE "+lt.ownerDocument.doctype.name+`>
|
|
`+ha),Ne&&hF([b,T,B],il=>{ha=AB(ha,il," ")}),x&&je?x.createHTML(ha):ha},t.setConfig=function(){let on=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ui(on),nt=!0},t.clearConfig=function(){Vo=null,nt=!1},t.isValidAttribute=function(on,we,lt){Vo||Ui({});let an=Nn(on),fo=Nn(we);return dm(an,fo,lt)},t.addHook=function(on,we){typeof we=="function"&&pB(g[on],we)},t.removeHook=function(on,we){if(we!==void 0){let lt=aUe(g[on],we);return lt===-1?void 0:sUe(g[on],lt,1)[0]}return Pse(g[on])},t.removeHooks=function(on){g[on]=[]},t.removeAllHooks=function(){g=Fse()},t}var Gse=zse();var xUe=0,I6={};function Lm(e,t){let n,i=e;l(I6[i])?n=I6[i]:(n=xUe++,I6[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(Lm.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!l(this._element)){let e=Gse.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}}});Lm.equals=function(e,t){return e===t||l(e)&&l(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};Lm.prototype.equals=function(e){return Lm.equals(this,e)};Lm.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};Lm.getIonCredit=function(e){let t=l(e.collapsible)&&!e.collapsible;return new Lm(e.html,t)};Lm.clone=function(e){if(l(e))return new Lm(e.html,e.showOnScreen)};var Et=Lm;function TUe(e,t){bt(e,t)}var Gs=TUe;function iE(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new _e}Object.defineProperties(iE.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}}});iE.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function b6(e){e._cubeMapBuffers=void 0}iE.prototype.update=function(e){let{context:t}=e;if(!iE.isSupported(t))return;if(l(this._texture)){b6(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(b6(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;ku(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT);let o=Ke.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let a=n[0].positiveX.width,s=Math.log2(a)+1;if(r!==s){let f={};Object.values(ta.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<s;h++)n.push(f)}let c=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ta({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};iE.prototype.isDestroyed=function(){return!1};iE.prototype.destroy=function(){return b6(this),this._texture=this._texture&&this._texture.destroy(),fe(this)};var Om=iE;function CB(e){e=e??V.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?Q.clone(e.imageBasedLightingFactor):new Q(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=Q.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(CB.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=Q.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=Q.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function SUe(e,t){if(Om.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Om(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}CB.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;Q.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=Q.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(SUe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,a=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,s=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||a||s,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};CB.prototype.isDestroyed=function(){return!1};CB.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),fe(this)};var xb=CB;var T6=Na(Fu(),1);var x6,Vse="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhMzVlNTU2ZC1lYmM1LTQ2OWEtODRhOS0wYTFkODZmZTQ0OTgiLCJpZCI6MjU5LCJpYXQiOjE3NzI0ODIxOTR9.1oVHvVA9yr1C3CbLjlzcQQUyBuUuNaNCcc9_Giy8t7U",gF={};gF.defaultAccessToken=Vse;gF.defaultServer=new De({url:"https://api.cesium.com/"});gF.getDefaultTokenCredit=function(e){if(e===Vse){if(!l(x6)){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>`;x6=new Et(t,!0)}return x6}};var Fm=gF;function Cl(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:wUe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ue("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new T6.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(Cl.prototype=Object.create(De.prototype),Cl.prototype.constructor=Cl);Cl.fromAssetId=function(e,t){let n=Cl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Cl(i,n)})};Object.defineProperties(Cl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Cl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Cl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Et.getIonCredit),i=Fm.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Et.clone(i)),n};Cl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=new Cl(t._ionEndpoint,t._ionEndpointResource)),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Cl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};Cl.prototype._makeRequest=function(e){return this._isExternal||new T6.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=Hse(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Cl._createEndpointResource=function(e,t){t=t??V.EMPTY_OBJECT;let n=t.server??Fm.defaultServer,i=t.accessToken??Fm.defaultAccessToken;n=De.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=Hse(o.headers),n.getDerivedResource(o)};function Hse(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}function wUe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){let a=e.refreshCallback??n.refreshCallback;return l(a)&&a(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var _a=Cl;function Qm(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Qm.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Qm.prototype.get=function(e){return this._array[e]};Qm.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Qm.prototype.peek=function(){return this._array[this._length-1]};Qm.prototype.push=function(e){let t=this.length++;this._array[t]=e};Qm.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Qm.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Qm.prototype.resize=function(e){this.length=e};Qm.prototype.trim=function(e){e=e??this._length,this._array.length=e};var iu=Qm;var AA={X:0,Y:1,Z:2};AA.Y_UP_TO_Z_UP=P.fromRotationTranslation(J.fromArray([1,0,0,0,0,1,0,-1,0]));AA.Z_UP_TO_Y_UP=P.fromRotationTranslation(J.fromArray([1,0,0,0,0,-1,0,1,0]));AA.X_UP_TO_Z_UP=P.fromRotationTranslation(J.fromArray([0,0,1,0,1,0,-1,0,0]));AA.Z_UP_TO_X_UP=P.fromRotationTranslation(J.fromArray([0,0,-1,0,1,0,1,0,0]));AA.X_UP_TO_Y_UP=P.fromRotationTranslation(J.fromArray([0,1,0,-1,0,0,0,0,1]));AA.Y_UP_TO_X_UP=P.fromRotationTranslation(J.fromArray([0,-1,0,1,0,0,0,0,1]));AA.fromName=function(e){return AA[e]};var so=Object.freeze(AA);function Wse(e){e=e??V.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Wse.prototype,{metadata:{get:function(){return this._metadata}}});var Tb=Wse;function u_(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),u_.decode(e)}u_.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};u_.decodeWithFromCharCode=function(e){let t="",n=BUe(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 EB(e,t,n){return t<=e&&e<=n}function BUe(e){let t=0,n=0,i=0,o=128,r=191,a=[],s=e.length;for(let c=0;c<s;++c){let u=e[c];if(i===0){if(EB(u,0,127)){a.push(u);continue}if(EB(u,194,223)){i=1,t=u&31;continue}if(EB(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(EB(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new ue("String decoding failed.")}if(!EB(u,o,r)){t=i=n=0,o=128,r=191,--c;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(a.push(t),t=i=n=0)}return a}typeof TextDecoder<"u"?u_.decode=u_.decodeWithTextDecoder:u_.decode=u_.decodeWithFromCharCode;var ju=u_;function DUe(e,t){return t=t??0,ju(e,t,Math.min(4,e.length))}var km=DUe;function Xf(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,l(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(Xf.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 IB=Uint32Array.BYTES_PER_ELEMENT;Xf.fromTileType=async function(e,t,n,i,o,r){o=o??0;let a=new Uint8Array(i),s=new DataView(i);o+=IB;let c=s.getUint32(o,!0);if(c!==1)throw new ue(`Only Composite Tile version 1 is supported. Version ${c} is not.`);o+=IB,o+=IB;let u=s.getUint32(o,!0);o+=IB;let f=n.queryParameters.compositeIndex;l(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let _=km(a,o),y=s.getUint32(o+IB*2,!0),C=r[_],E=`${f}${m}`,I=n.getDerivedResource({queryParameters:{compositeIndex:E}});if(l(C))h[m]=Promise.resolve(C(e,t,I,i,o));else throw new ue(`Unknown tile content type, ${_}, inside Composite tile`);o+=y}let p=await Promise.all(h);return new Xf(e,t,n,p)};Xf.prototype.hasProperty=function(e,t){return!1};Xf.prototype.getFeature=function(e){};Xf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Xf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Xf.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)};Xf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,a=r.length;for(let s=0;s<a;++s){let c=r[s].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Xf.prototype.isDestroyed=function(){return!1};Xf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var _F=Xf;function vUe(e,t,n){return JSON.parse(ju(e,t,n))}var Pr=vUe;function Qc(e){this._id=Jn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,Nt.maximumTextureSize),r=Math.ceil(t/Nt.maximumTextureSize),a=1/o,s=a*.5,c=1/r,u=c*.5;n=new Q(o,r),i=new ie(a,s,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(Qc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});Qc.DEFAULT_COLOR_VALUE=U.WHITE;Qc.DEFAULT_SHOW_VALUE=!0;function jse(e){let t=e._textureDimensions;return t.x*t.y*4}function Yse(e){if(!l(e._batchValues)){let t=jse(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function qse(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}Qc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=qse(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Yse(this),a=e*4+3;r[a]=t?n[i+1]:0,this._batchValuesDirty=!0}};Qc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};Qc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var PUe=new Array(4);Qc.prototype.setColor=function(e,t){if(U.equals(t,Qc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(PUe),i=n[3],o=Yse(this),r=e*4,a=qse(this),s=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||a[s+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let c=a[s+1]!==255,u=a[s]!==0;o[r+3]=u?i:0,a[s+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};Qc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};Qc.prototype.getColor=function(e,t){if(!l(this._batchValues))return U.clone(Qc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return U.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};Qc.prototype.getPickColor=function(e){return this._pickIds[e]};function Kse(e,t,n){let i=e._textureDimensions;return new vt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:jt.NEAREST})}function RUe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,o=jse(e),r=new Uint8Array(o),a=e._owner,s=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(a.getFeature(c));i.push(u);let f=u.color,h=c*4;r[h]=U.floatToByte(f.red),r[h+1]=U.floatToByte(f.green),r[h+2]=U.floatToByte(f.blue),r[h+3]=U.floatToByte(f.alpha)}e._pickTexture=Kse(e,t,r),l(s)&&(s.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function MUe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Qc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&RUe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Kse(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),MUe(this))};Qc.prototype.isDestroyed=function(){return!1};Qc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var ou=Qc;var NUe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},LUe={SCALAR:void 0,VEC2:Q,VEC3:d,VEC4:ie,MAT2:Ki,MAT3:J,MAT4:P};function OUe(e){let t=e.componentType,n;typeof t=="string"?n=j.fromName(t):n=t;let i=NUe[e.type],o=LUe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,a,s){return j.createArrayBufferView(n,r,a,i*s)}}}var ch=OUe;function gA(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,FUe(this,e.extension,e.binaryBody)}Object.defineProperties(gA.prototype,{byteLength:{get:function(){return this._byteLength}}});function FUe(e,t,n){let i,o,r,a=t.instancesLength,s=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,h=a,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??j.UNSIGNED_SHORT,c.type=zt.SCALAR,r=ch(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,a),p+=c.byteLength);let A;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??j.UNSIGNED_SHORT,u.type=zt.SCALAR,r=ch(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,a),p+=u.byteLength),A=new Uint16Array(a),h=0,i=0;i<a;++i)A[i]=h,h+=u[i];p+=A.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??j.UNSIGNED_SHORT,f.type=zt.SCALAR,r=ch(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=s.length;for(i=0;i<m;++i){let C=s[i].length,E=s[i].instances,I=Um.getBinaryProperties(C,E,n);p+=QUe(I),s[i].instances=Pt(I,E)}let _=new Array(m).fill(0),y=new Uint16Array(a);for(i=0;i<a;++i)o=c[i],y[i]=_[o],++_[o];p+=y.byteLength,e._classes=s,e._classIds=c,e._classIndexes=y,e._parentCounts=u,e._parentIndexes=A,e._parentIds=f,e._byteLength=p}function QUe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var kUe=[],UUe=[],zUe=0;function GUe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,a=e._parentIndexes,s=i.length,c=kUe;c.length=Math.max(c.length,s);let u=++zUe,f=UUe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let h=n(e,t);if(l(h))return h;let p=o[t],A=a[t];for(let m=0;m<p;++m){let _=r[A+m];_!==t&&f.push(_)}}}function VUe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(l(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function bB(e,t,n){let i=e._parentCounts,o=e._parentIds;if(l(o)){if(l(i))return GUe(e,t,n)}else return n(e,t);return VUe(e,t,n)}gA.prototype.hasProperty=function(e,t){let n=bB(this,e,function(i,o){let r=i._classIds[o],a=i._classes[r].instances;if(l(a[t]))return!0});return l(n)};gA.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(l(o[e]))return!0}return!1};gA.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,bB(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let a in r)r.hasOwnProperty(a)&&t.indexOf(a)===-1&&t.push(a)}),t};gA.prototype.getProperty=function(e,t){return bB(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],a=n._classIndexes[i],s=r.instances[t];if(l(s))return l(s.typedArray)?HUe(s,a):Ye(s[a],!0)})};function HUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}gA.prototype.setProperty=function(e,t,n){let i=bB(this,e,function(o,r){let a=o._classIds[r],s=o._classes[a],c=o._classIndexes[r],u=s.instances[t];if(l(u))return l(u.typedArray)?WUe(u,c,n):u[c]=Ye(n,!0),!0});return l(i)};function WUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}gA.prototype.isClass=function(e,t){let n=bB(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return l(n)};gA.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Sb=gA;var jUe={HIGHLIGHT:0,REPLACE:1,MIX:2},Yu=Object.freeze(jUe);var S6=ou.DEFAULT_COLOR_VALUE,w6=ou.DEFAULT_SHOW_VALUE;function Fo(e,t,n,i,o){this.featuresLength=t;let r;l(n)&&(r=n.extensions),this._extensions=r??{};let a=YUe(n);this._properties=a,this._batchTableHierarchy=qUe(this,n,i);let s=Jse(t,a,i);this._binaryPropertiesByteLength=KUe(s),this._batchTableBinaryProperties=s,this._content=e,this._batchTexture=new ou({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}Fo._deprecationWarning=Gs;Object.defineProperties(Fo.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function YUe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ye(e[n],!0));return t}function qUe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(l(o)&&(Fo._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!l(i))return new Sb({extension:i,binaryBody:n})}function Jse(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],a=r.byteOffset;if(l(a)){let s=r.componentType,c=r.type;if(!l(s))throw new ue("componentType is required.");if(!l(c))throw new ue("type is required.");if(!l(n))throw new ue(`Property ${o} requires a batch table binary.`);let u=ch(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+a,e);l(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function KUe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Fo.getBinaryProperties=function(e,t,n){return Jse(e,t,n)};Fo.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Fo.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Fo.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Fo.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Fo.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Fo.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Fo.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var XUe=new U;Fo.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(S6),this.setAllShow(w6);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=l(e.color)?e.color.evaluateColor(o,XUe)??S6:S6,a=l(e.show)?e.show.evaluate(o)??w6:w6;this.setColor(i,r),this.setShow(i,a)}};function JUe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function ZUe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Fo.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Fo.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Fo.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Fo.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Fo.prototype.hasPropertyBySemantic=function(){return!1};Fo.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(oi(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);oi(t,i)}return t};Fo.prototype.getPropertyBySemantic=function(e,t){};Fo.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return JUe(i,e)}let n=this._properties[t];if(l(n))return Ye(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Fo.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(l(r)){ZUe(r,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];l(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=Ye(n,!0)};function $Ue(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));
|
|
}
|
|
`}Fo.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=Zse(o,n,!1),a;return Nt.maximumVertexTextureImageUnits>0?(a="",e&&(a+=`uniform bool tile_translucentCommand;
|
|
`),a+=`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&&(a+=` 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;
|
|
}
|
|
}
|
|
`),a+=` tile_featureColor = featureProperties;
|
|
tile_featureSt = st;
|
|
}`):a=`out vec2 tile_featureSt;
|
|
void main()
|
|
{
|
|
tile_color(vec4(1.0));
|
|
tile_featureSt = computeSt(${t});
|
|
}`,`${r}
|
|
${$Ue(i)}${a}`}};function Xse(e,t){return e=We.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend;
|
|
void tile_color(vec4 tile_featureColor)
|
|
{
|
|
tile_main();
|
|
tile_featureColor = czm_gammaCorrect(tile_featureColor);
|
|
out_FragColor.a *= tile_featureColor.a;
|
|
float highlight = ceil(tile_colorBlend);
|
|
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
|
|
}
|
|
`:`${e}void tile_color(vec4 tile_featureColor)
|
|
{
|
|
tile_main();
|
|
}
|
|
`}function eze(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let a=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++a;else if(f===")"&&(--a,a===0)){r=u+1;break}}let c=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+c+e.slice(r),i=o+c.length,o=e.indexOf(n,i)}return e}function Zse(e,t,n){if(!l(t))return Xse(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!l(o))return Xse(e,n);let r=o[0],a=o[2];e=We.replaceMain(e,"tile_main"),e=e.replace(r,"");let s=`bool isWhite(vec3 color)
|
|
{
|
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
|
}
|
|
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
|
|
{
|
|
vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
|
|
vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
|
|
return vec4(diffuse.rgb, sourceDiffuse.a);
|
|
}
|
|
`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
|
|
out_FragColor.a *= tile_featureColor.a;
|
|
float highlight = ceil(tile_colorBlend);
|
|
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
|
|
`,u;if(a==="vec3"||a==="vec4"){let f=a==="vec3"?`vec4(${t}, 1.0)`:t,h=a==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),u=` vec4 source = ${f};
|
|
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
|
|
tile_main();
|
|
`}else a==="sampler2D"&&(e=eze(e,t),u=` tile_diffuse = tile_featureColor;
|
|
tile_main();
|
|
`);return e=`uniform float tile_colorBlend;
|
|
vec4 tile_diffuse = vec4(1.0);
|
|
${s}${r}
|
|
${e}
|
|
void tile_color(vec4 tile_featureColor)
|
|
{
|
|
${u}`,n&&(e+=c),e+=`}
|
|
`,e}Fo.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Zse(i,t,!0),Nt.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 tze(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Yu.HIGHLIGHT)return 0;if(n===Yu.REPLACE)return 1;if(n===Yu.MIX)return D.clamp(i,D.EPSILON4,1)}Fo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Pt(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 tze(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Fo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var f_={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Fo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,a=o.tileset,s=a.isSkippingLevelOfDetail&&a.hasMixedContent&&e.context.stencilBuffer,c=nze(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Be.COMPUTE)continue;let h=f.derivedCommands.tileset;(!l(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=ize(f),f.dirty=!1);let p=h.originalCommand;c!==f_.ALL_OPAQUE&&f.pass!==Be.TRANSLUCENT&&(l(h.translucent)||(h.translucent=oze(p))),c!==f_.ALL_TRANSLUCENT&&f.pass!==Be.TRANSLUCENT&&(l(h.opaque)||(h.opaque=rze(p)),s&&(r||(l(h.zback)||(h.zback=sze(e.context,p)),a._backfaceCommands.push(h.zback)),(!l(h.stencil)||o._selectionDepth!==lze(h.stencil))&&(f.renderState.depthMask?h.stencil=cze(p,o._selectionDepth):h.stencil=h.opaque)));let A=s?h.stencil:h.opaque,m=h.translucent;f.pass!==Be.TRANSLUCENT?(c===f_.ALL_OPAQUE&&(n[u]=A),c===f_.ALL_TRANSLUCENT&&(n[u]=m),c===f_.OPAQUE_AND_TRANSLUCENT&&(n[u]=A,n.push(m))):n[u]=p}};function nze(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?f_.ALL_OPAQUE:t===e.featuresLength?f_.ALL_TRANSLUCENT:f_.OPAQUE_AND_TRANSLUCENT}function ize(e){let t=it.shallowClone(e),n=t.pass===Be.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function oze(e){let t=it.shallowClone(e);return t.pass=Be.TRANSLUCENT,t.renderState=uze(e.renderState),t}function rze(e){let t=it.shallowClone(e);return t.renderState=fze(e.renderState),t}function aze(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function sze(e,t){let n=it.shallowClone(t),i=Ye(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Li.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK,n.renderState=Ve.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ye(t.uniformMap);let o=new Q(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=aze(e,t.shaderProgram),n}function cze(e,t){let n=it.shallowClone(e),i=Ye(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Yt.SKIP_LOD_MASK,i.stencilTest.reference=Yt.CESIUM_3D_TILE_MASK|t<<Yt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ti.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=wt.REPLACE,i.stencilTest.backFunction=ti.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=wt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=Ve.fromCache(i),n}function lze(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function uze(e){let t=Ye(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=sn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}function fze(e){let t=Ye(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ve.fromCache(t)}Fo.prototype.update=function(e,t){this._batchTexture.update(e,t)};Fo.prototype.isDestroyed=function(){return!1};Fo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var Um=Fo;function dze(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var _A=dze;var xB=`in vec3 position;
|
|
in float a_batchId;
|
|
|
|
uniform mat4 u_modifiedModelViewProjection;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
|
|
}
|
|
`;var B6=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new U),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i){let o=t.batchTable;if(l(o)){if(o.hasPropertyBySemantic(n,i))return o.getPropertyBySemantic(n,i);if(o.hasProperty(n,i))return o.getProperty(n,i)}let r=t.metadata;if(l(r)){if(r.hasPropertyBySemantic(i))return r.getPropertyBySemantic(i);if(r.hasProperty(i))return r.getProperty(i)}let a=t.tile,s=a.metadata;if(l(s)){if(s.hasPropertyBySemantic(i))return s.getPropertyBySemantic(i);if(s.hasProperty(i))return s.getProperty(i)}let c;if(l(a.implicitSubtree)&&(c=a.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},Vs=B6;var D6=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)})}},v6=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)})}},ru=class e{static get version(){return"1.3.8"}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,a,s,c,u;if(a=this.gobbleToken(),!a||(n=this.gobbleBinaryOp(),!n))return a;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},s=this.gobbleToken(),s||this.throwError("Expected expression after "+n),o=[a,r,s];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(o[o.length-2]);)s=o.pop(),n=o.pop().value,a=o.pop(),t={type:e.BINARY_EXP,operator:n,left:a,right:s},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},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 a=n.length;a<o;a++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let a=this.gobbleExpression();(!a||a.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(a)}}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)}}},hze=new D6;Object.assign(ru,{hooks:hze,plugins:new v6(ru),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,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});ru.max_unop_len=ru.getMaxKeyLen(ru.unary_ops);ru.max_binop_len=ru.getMaxKeyLen(ru.binary_ops);var d_=e=>new ru(e).parse(),mze=Object.getOwnPropertyNames(ru);mze.forEach(e=>{d_[e]===void 0&&e!=="prototype"&&(d_[e]=ru[e])});d_.Jsep=ru;var pze="ConditionalExpression",Aze={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:pze,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let a=i;for(;a.right.operator&&e.binary_ops[a.right.operator]<=.9;)a=a.right;n.node.test=a.right,a.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};d_.plugins.register(Aze);var gze={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},Bt=Object.freeze(gze);function lh(e,t){this._expression=e,e=vze(e,t),e=Rze(Pze(e)),d_.addBinaryOp("=~",0),d_.addBinaryOp("!~",0);let n;try{n=d_(e)}catch(i){throw new ue(i)}this._runtimeAst=Qi(this,n)}Object.defineProperties(lh.prototype,{expression:{get:function(){return this._expression}}});var Un={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Q],cartesian3Array:[new d],cartesian4Array:[new ie],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 Q),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ie),this.cartesian4Array[this.cartesian4Index++]}};lh.prototype.evaluate=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof ie?U.fromCartesian4(n,t):n instanceof Q||n instanceof d||n instanceof ie?n.clone(t):n};lh.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};lh.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
|
|
{
|
|
return ${o};
|
|
}
|
|
`,o};lh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};lh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var _ze=["!","-","+"],$se=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],TB=/\${(.*?)}/g,yze=/\\/g,Cze="@#%",Eze=/@#%/g,EF=new U,IF={abs:bs(Math.abs),sqrt:bs(Math.sqrt),cos:bs(Math.cos),sin:bs(Math.sin),tan:bs(Math.tan),acos:bs(Math.acos),asin:bs(Math.asin),atan:bs(Math.atan),radians:bs(D.toRadians),degrees:bs(D.toDegrees),sign:bs(D.sign),floor:bs(Math.floor),ceil:bs(Math.ceil),round:bs(Math.round),exp:bs(Math.exp),exp2:bs(bze),log:bs(Math.log),log2:bs(xze),fract:bs(Ize),length:Tze,normalize:Sze},bF={atan2:yF(Math.atan2,!1),pow:yF(Math.pow,!1),min:yF(Math.min,!0),max:yF(Math.max,!0),distance:wze,dot:Bze,cross:Dze},M6={clamp:ece(D.clamp,!0),mix:ece(D.lerp,!0)};function Ize(e){return e-Math.floor(e)}function bze(e){return Math.pow(2,e)}function xze(e){return D.log2(e)}function bs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof Q)return Q.fromElements(e(n.x),e(n.y),Un.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),Un.getCartesian3());if(n instanceof ie)return ie.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Un.getCartesian4());throw new ue(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function yF(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof Q)return Q.fromElements(e(i.x,o),e(i.y,o),Un.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),Un.getCartesian3());if(i instanceof ie)return ie.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),Un.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof Q&&o instanceof Q)return Q.fromElements(e(i.x,o.x),e(i.y,o.y),Un.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),Un.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),Un.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function ece(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 Q&&o instanceof Q)return Q.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),Un.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),Un.getCartesian3());if(i instanceof ie&&o instanceof ie)return ie.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),Un.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof Q&&o instanceof Q&&r instanceof Q)return Q.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),Un.getCartesian2());if(i instanceof d&&o instanceof d&&r instanceof d)return d.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),Un.getCartesian3());if(i instanceof ie&&o instanceof ie&&r instanceof ie)return ie.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),Un.getCartesian4());throw new ue(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function Tze(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof Q)return Q.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof ie)return ie.magnitude(t);throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Sze(e,t){if(typeof t=="number")return 1;if(t instanceof Q)return Q.normalize(t,Un.getCartesian2());if(t instanceof d)return d.normalize(t,Un.getCartesian3());if(t instanceof ie)return ie.normalize(t,Un.getCartesian4());throw new ue(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function wze(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof Q&&n instanceof Q)return Q.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof ie&&n instanceof ie)return ie.distance(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Bze(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof Q&&n instanceof Q)return Q.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof ie&&n instanceof ie)return ie.dot(t,n);throw new ue(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Dze(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,Un.getCartesian3());throw new ue(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Rt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,Gze(this)}function vze(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Pze(e){return e.replace(yze,Cze)}function R6(e){return e.replace(Eze,"\\")}function Rze(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),a;if(o>=0&&o<i)a=t.indexOf("'",o+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else if(r>=0&&r<i)a=t.indexOf('"',r+1),n+=t.substr(0,a+1),t=t.substr(a+1),i=t.indexOf("${");else{n+=t.substr(0,i);let s=t.indexOf("}");if(s<0)throw new ue("Unmatched {.");n+=`czm_${t.substr(i+2,s-(i+2))}`,t=t.substr(s+1),i=t.indexOf("${")}}return n+=t,n}function Mze(e){let t=typeof e.value;if(e.value===null)return new Rt(Bt.LITERAL_NULL,null);if(t==="boolean")return new Rt(Bt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Rt(Bt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Rt(Bt.VARIABLE_IN_STRING,e.value):new Rt(Bt.LITERAL_STRING,R6(e.value))}function Nze(e,t){let n=t.arguments,i=n.length,o,r,a,s;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ue(`${o} is not a function.`);return i===0?o==="test"?new Rt(Bt.LITERAL_BOOLEAN,!1):new Rt(Bt.LITERAL_NULL,null):(a=Qi(e,c),s=Qi(e,n[0]),new Rt(Bt.FUNCTION_CALL,o,a,s))}else if(o==="toString")return r=Qi(e,c),new Rt(Bt.FUNCTION_CALL,o,r);throw new ue(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Rt(Bt.LITERAL_COLOR,o);if(r=Qi(e,n[0]),l(n[1])){let c=Qi(e,n[1]);return new Rt(Bt.LITERAL_COLOR,o,[r,c])}return new Rt(Bt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ue(`${o} requires three arguments.`);return r=[Qi(e,n[0]),Qi(e,n[1]),Qi(e,n[2])],new Rt(Bt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ue(`${o} requires four arguments.`);return r=[Qi(e,n[0]),Qi(e,n[1]),Qi(e,n[2]),Qi(e,n[3])],new Rt(Bt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=Qi(e,n[c]);return new Rt(Bt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Rt(Bt.LITERAL_BOOLEAN,!0):new Rt(Bt.LITERAL_BOOLEAN,!1):(r=Qi(e,n[0]),new Rt(Bt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ue(`${o} requires exactly one argument.`);return r=Qi(e,n[0]),new Rt(Bt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ue(`${o} does not take any argument.`);return new Rt(Bt.UNARY,o)}else if(l(IF[o])){if(i!==1)throw new ue(`${o} requires exactly one argument.`);return r=Qi(e,n[0]),new Rt(Bt.UNARY,o,r)}else if(l(bF[o])){if(i!==2)throw new ue(`${o} requires exactly two arguments.`);return a=Qi(e,n[0]),s=Qi(e,n[1]),new Rt(Bt.BINARY,o,a,s)}else if(l(M6[o])){if(i!==3)throw new ue(`${o} requires exactly three arguments.`);a=Qi(e,n[0]),s=Qi(e,n[1]);let c=Qi(e,n[2]);return new Rt(Bt.TERNARY,o,a,s,c)}else{if(o==="Boolean")return i===0?new Rt(Bt.LITERAL_BOOLEAN,!1):(r=Qi(e,n[0]),new Rt(Bt.UNARY,o,r));if(o==="Number")return i===0?new Rt(Bt.LITERAL_NUMBER,0):(r=Qi(e,n[0]),new Rt(Bt.UNARY,o,r));if(o==="String")return i===0?new Rt(Bt.LITERAL_STRING,""):(r=Qi(e,n[0]),new Rt(Bt.UNARY,o,r));if(o==="regExp")return Lze(e,t)}}throw new ue(`Unexpected function call "${o}".`)}function Lze(e,t){let n=t.arguments;if(n.length===0)return new Rt(Bt.LITERAL_REGEX,new RegExp);let i=Qi(e,n[0]),o;if(n.length>1){let r=Qi(e,n[1]);if(P6(i)&&P6(r)){try{o=new RegExp(R6(String(i._value)),r._value)}catch(a){throw new ue(a)}return new Rt(Bt.LITERAL_REGEX,o)}return new Rt(Bt.REGEX,i,r)}if(P6(i)){try{o=new RegExp(R6(String(i._value)))}catch(r){throw new ue(r)}return new Rt(Bt.LITERAL_REGEX,o)}return new Rt(Bt.REGEX,i)}function Oze(e){if(Uze(e.name)){let t=zze(e.name);return t.substr(0,8)==="tiles3d_"?new Rt(Bt.BUILTIN_VARIABLE,t):new Rt(Bt.VARIABLE,t)}else{if(e.name==="NaN")return new Rt(Bt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Rt(Bt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Rt(Bt.LITERAL_UNDEFINED,void 0)}throw new ue(`${e.name} is not defined.`)}function Fze(e){let t=e.property.name;if(t==="PI")return new Rt(Bt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Rt(Bt.LITERAL_NUMBER,Math.E)}function Qze(e){if(e.property.name==="POSITIVE_INFINITY")return new Rt(Bt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function kze(e,t){if(t.object.name==="Math")return Fze(t);if(t.object.name==="Number")return Qze(t);let n,i=Qi(e,t.object);return t.computed?(n=Qi(e,t.property),new Rt(Bt.MEMBER,"brackets",i,n)):(n=new Rt(Bt.LITERAL_STRING,t.property.name),new Rt(Bt.MEMBER,"dot",i,n))}function P6(e){return e._type>=Bt.LITERAL_NULL}function Uze(e){return e.substr(0,4)==="czm_"}function zze(e){return e.substr(4)}function Qi(e,t){let n,i,o,r;if(t.type==="Literal")n=Mze(t);else if(t.type==="CallExpression")n=Nze(e,t);else if(t.type==="Identifier")n=Oze(t);else if(t.type==="UnaryExpression"){i=t.operator;let a=Qi(e,t.argument);if(_ze.indexOf(i)>-1)n=new Rt(Bt.UNARY,i,a);else throw new ue(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Qi(e,t.left),r=Qi(e,t.right),$se.indexOf(i)>-1)n=new Rt(Bt.BINARY,i,o,r);else throw new ue(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Qi(e,t.left),r=Qi(e,t.right),$se.indexOf(i)>-1&&(n=new Rt(Bt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let a=Qi(e,t.test);o=Qi(e,t.consequent),r=Qi(e,t.alternate),n=new Rt(Bt.CONDITIONAL,"?",o,r,a)}else if(t.type==="MemberExpression")n=kze(e,t);else if(t.type==="ArrayExpression"){let a=[];for(let s=0;s<t.elements.length;s++)a[s]=Qi(e,t.elements[s]);n=new Rt(Bt.ARRAY,a)}else throw t.type==="Compound"?new ue("Provide exactly one expression."):new ue("Cannot parse expression.");return n}function Gze(e){e._type===Bt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Bt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Bt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(IF[e._value])&&(e.evaluate=Hze(e._value)):e._type===Bt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(bF[e._value])&&(e.evaluate=Wze(e._value)):e._type===Bt.TERNARY?e.evaluate=jze(e._value):e._type===Bt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Bt.ARRAY?e.evaluate=e._evaluateArray:e._type===Bt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Bt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Bt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Bt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Bt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Bt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Bt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Vze):e.evaluate=e._evaluateLiteral}function Vze(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Hze(e){let t=IF[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Wze(e){let t=bF[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function jze(e){let t=M6[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 xF(e,t){if(l(e))return e.getPropertyInherited(t)}Rt.prototype._evaluateLiteral=function(){return this._value};Rt.prototype._evaluateLiteralColor=function(e){let t=EF,n=this._left;if(this._value==="color")l(n)?n.length>1?(U.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):U.fromCssColorString(n[0].evaluate(e),t):U.fromBytes(255,255,255,255,t);else if(this._value==="rgb")U.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;U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ie.fromColor(t,Un.getCartesian4())};Rt.prototype._evaluateLiteralVector=function(e){let t=Un.getArray(),n=this._value,i=this._left,o=i.length;for(let s=0;s<o;++s){let c=i[s].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof Q)t.push(c.x,c.y);else if(c instanceof d)t.push(c.x,c.y,c.z);else if(c instanceof ie)t.push(c.x,c.y,c.z,c.w);else throw new ue(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,a=parseInt(n.charAt(3));if(r===0)throw new ue(`Invalid ${n} constructor. No valid arguments.`);if(r<a&&r>1)throw new ue(`Invalid ${n} constructor. Not enough arguments.`);if(r>a&&o>1)throw new ue(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let s=t[0];t.push(s,s,s)}if(n==="vec2")return Q.fromArray(t,0,Un.getCartesian2());if(n==="vec3")return d.fromArray(t,0,Un.getCartesian3());if(n==="vec4")return ie.fromArray(t,0,Un.getCartesian4())};Rt.prototype._evaluateLiteralString=function(){return this._value};Rt.prototype._evaluateVariableString=function(e){let t=this._value,n=TB.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=xF(e,o);l(r)||(r=""),t=t.replace(i,r),TB.lastIndex+=r.length-i.length,n=TB.exec(t)}return t};Rt.prototype._evaluateVariable=function(e){return xF(e,this._value)};function oE(e){return e._value==="feature"}Rt.prototype._evaluateMemberDot=function(e){if(oE(this._left))return xF(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof Q||t instanceof d||t instanceof ie){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]};Rt.prototype._evaluateMemberBrackets=function(e){if(oE(this._left))return xF(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof Q||t instanceof d||t instanceof ie){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]};Rt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Rt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Rt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof Q)return Q.negate(t,Un.getCartesian2());if(t instanceof d)return d.negate(t,Un.getCartesian3());if(t instanceof ie)return ie.negate(t,Un.getCartesian4());if(typeof t=="number")return-t;throw new ue(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Rt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof Q||t instanceof d||t instanceof ie||typeof t=="number"))throw new ue(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Rt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Rt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Rt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Rt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ue(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Rt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Rt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ue(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ue(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Rt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Q&&t instanceof Q)return Q.add(t,n,Un.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,Un.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.add(t,n,Un.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ue(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Q&&t instanceof Q)return Q.subtract(t,n,Un.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,Un.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.subtract(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ue(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Q&&t instanceof Q)return Q.multiplyComponents(t,n,Un.getCartesian2());if(n instanceof Q&&typeof t=="number")return Q.multiplyByScalar(n,t,Un.getCartesian2());if(t instanceof Q&&typeof n=="number")return Q.multiplyByScalar(t,n,Un.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,Un.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,Un.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,Un.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.multiplyComponents(t,n,Un.getCartesian4());if(n instanceof ie&&typeof t=="number")return ie.multiplyByScalar(n,t,Un.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.multiplyByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ue(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Q&&t instanceof Q)return Q.divideComponents(t,n,Un.getCartesian2());if(t instanceof Q&&typeof n=="number")return Q.divideByScalar(t,n,Un.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,Un.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,Un.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.divideComponents(t,n,Un.getCartesian4());if(t instanceof ie&&typeof n=="number")return ie.divideByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ue(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof Q&&t instanceof Q)return Q.fromElements(t.x%n.x,t.y%n.y,Un.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Un.getCartesian3());if(n instanceof ie&&t instanceof ie)return ie.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ue(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof Q&&t instanceof Q||n instanceof d&&t instanceof d||n instanceof ie&&t instanceof ie?t.equals(n):t===n};Rt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof Q&&t instanceof Q||n instanceof d&&t instanceof d||n instanceof ie&&t instanceof ie?!t.equals(n):t!==n};Rt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ue(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Rt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Rt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Rt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Rt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Rt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Rt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Rt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Rt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Rt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ue(o)}return i};Rt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Rt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ue(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ue(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Rt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ue(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Rt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof Q||t instanceof d||t instanceof ie)return String(t);throw new ue(`Unexpected function call "${this._value}".`)};function tce(e){let t=e._left,n=t.length;for(let s=0;s<n;++s)if(t[s]._type!==Bt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,a=n===4?t[3]._value:1;return U.fromHsl(i,o,r,a,EF)}function nce(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==Bt.LITERAL_NUMBER)return;let i=EF;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 h_(e){return e%1===0?e.toFixed(1):e.toString()}function Yze(e){let t=h_(e.red),n=h_(e.green),i=h_(e.blue);return`vec3(${t}, ${n}, ${i})`}function CF(e){let t=h_(e.red),n=h_(e.green),i=h_(e.blue),o=h_(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function ice(e,t,n,i){let o=e.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=e[a].getShaderExpression(t,n,i);return r}function oce(e,t){return l(t[e])?t[e]:lh.NULL_SENTINEL}lh.NULL_SENTINEL="czm_infinity";Rt.prototype.getShaderExpression=function(e,t,n){let i,o,r,a,s=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=ice(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(a=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=ice(this._value,e,t,this));let u,f,h;switch(s){case Bt.VARIABLE:return oE(this)?void 0:oce(c,e);case Bt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(IF[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new ue(`Error generating style shader: "${c}" is not supported.`);return c+o;case Bt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(bF[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case Bt.TERNARY:if(l(M6[c]))return`${c}(${o}, ${r}, ${a})`;break;case Bt.CONDITIONAL:return`(${a} ? ${o} : ${r})`;case Bt.MEMBER:return oE(this._left)?oce(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case Bt.FUNCTION_CALL:throw new ue(`Error generating style shader: "${c}" is not supported.`);case Bt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new ue("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Bt.REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case Bt.VARIABLE_IN_STRING:throw new ue("Error generating style shader: Converting a variable to a string is not supported.");case Bt.LITERAL_NULL:return lh.NULL_SENTINEL;case Bt.LITERAL_BOOLEAN:return c?"true":"false";case Bt.LITERAL_NUMBER:return h_(c);case Bt.LITERAL_STRING:if(l(n)&&n._type===Bt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||oE(n._left)))return c;if(i=U.fromCssColorString(c,EF),l(i))return Yze(i);throw new ue("Error generating style shader: String literals are not supported.");case Bt.LITERAL_COLOR:if(u=o,c==="color"){if(l(u)){if(u.length>1){let p=u[0],A=u[1];return A!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${A})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=nce(this),l(i)?CF(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=nce(this),l(i)?CF(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=tce(this),l(i)?CF(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=tce(this),l(i)?(i.alpha!==1&&(t.translucent=!0),CF(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Bt.LITERAL_VECTOR:f=o.length,h=`${c}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case Bt.LITERAL_REGEX:throw new ue("Error generating style shader: Regular expressions are not supported.");case Bt.LITERAL_UNDEFINED:return lh.NULL_SENTINEL;case Bt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Rt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,a=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let s;switch(r){case Bt.VARIABLE:oE(this)||e.push(a);break;case Bt.VARIABLE_IN_STRING:for(s=TB.exec(a);s!==null;)e.push(s[1]),s=TB.exec(a);break;case Bt.LITERAL_STRING:l(t)&&t._type===Bt.MEMBER&&oE(t._left)&&e.push(a);break}};var uh=lh;function yA(e){e=e??V.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??d.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=U.clone(U.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??ei.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(yA.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var qze={position:0,a_batchId:1};function Kze(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Re.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Re.STATIC_DRAW}),o=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Re.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:j.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:j.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new Vn({context:t,attributes:r,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Re.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Xze(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??qze,o=e._pickId,r=e._vertexShaderSource,a=e._fragmentShaderSource;if(l(r)){e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:i}),e._spStencil=e._sp,a=We.replaceMain(a,"czm_non_pick_main"),a=`${a}void main()
|
|
{
|
|
czm_non_pick_main();
|
|
out_FragColor = ${o};
|
|
}
|
|
`,e._spPick=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:i});return}let s=n.getVertexShaderCallback(!1,"a_batchId",void 0)(xB),c=n.getFragmentShaderCallback(!1,void 0,!0)(qC);o=n.getPickId();let u=new We({sources:[s]}),f=new We({defines:["VECTOR_TILE"],sources:[c]});e._sp=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new We({sources:[xB]}),f=new We({defines:["VECTOR_TILE"],sources:[qC]}),e._spStencil=$t.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=We.replaceMain(c,"czm_non_pick_main"),c=`${c}
|
|
void main()
|
|
{
|
|
czm_non_pick_main();
|
|
out_FragColor = ${o};
|
|
}
|
|
`;let h=new We({sources:[s]}),p=new We({defines:["VECTOR_TILE"],sources:[c]});e._spPick=$t.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function rce(e){let t=e?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:wt.KEEP,zFail:wt.DECREMENT_WRAP,zPass:wt.KEEP},backFunction:t,backOperation:{fail:wt.KEEP,zFail:wt.INCREMENT_WRAP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}var Jze={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND},Zze={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function $ze(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ve.fromCache(rce(!1)),e._rsStencilDepthPass3DTiles=Ve.fromCache(rce(!0)),e._rsColorPass=Ve.fromCache(Jze),e._rsPickPass=Ve.fromCache(Zze))}var rE=new P,ace=new d;function eGe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return P.clone(i,rE),P.multiplyByPoint(rE,e._center,ace),P.setTranslation(rE,ace,rE),P.multiply(o,rE,rE),rE},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function N6(e,t,n,i,o,r,a){let s=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=a[f],p=i[h],A=o[h],m=new e.constructor(e.buffer,s*p,A);t.set(m,n),i[h]=n,n+=A}return n}function tGe(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,a=new n.constructor(n.length),s=t.pop(),c=[s],u=N6(n,a,0,i,o,s.batchIds,r);for(s.offset=0,s.count=u;t.length>0;){let f=t.pop();if(U.equals(f.color,s.color))u=N6(n,a,u,i,o,f.batchIds,r),s.batchIds=s.batchIds.concat(f.batchIds),s.count=u-s.offset;else{let h=u;u=N6(n,a,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,c.push(f),s=f}}e._va.indexBuffer.copyFromArrayView(a),e._indices=a,e._batchedIndices=c}function L6(e,t,n,i,o,r,a){let s=e.bytesPerIndex,c=r.length;for(let u=0;u<c;++u){let f=r[u],h=a[f],p=i[h],A=o[h];t.copyFromBuffer(e,p*s,n*s,A*s),i[h]=n,n+=A}return n}function nGe(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),a=[r],s=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=L6(s,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(U.equals(h.color,r.color))u=L6(s,c,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=L6(s,c,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,a.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=a}function iGe(e,t){return t.color.toRgba()-e.color.toRgba()}function oGe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let a=0;a<i;++a){let c=n[a].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(iGe),t.webgl2?nGe(e,n):tGe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function rGe(e,t){let n=oGe(e,t),i=e._commands,o=e._batchedIndices,r=o.length,a=r*2;if(l(i)&&!n&&i.length===a)return;i.length=a;let s=e._va,c=e._sp,u=e._modelMatrix??P.IDENTITY,f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let A=o[p].offset,m=o[p].count,_=i[p*2];l(_)||(_=i[p*2]=new it({owner:e})),_.vertexArray=s,_.modelMatrix=u,_.offset=A,_.count=m,_.renderState=e._rsStencilDepthPass,_.shaderProgram=c,_.uniformMap=f,_.boundingVolume=h,_.cull=!1,_.pass=Be.TERRAIN_CLASSIFICATION;let y=it.shallowClone(_,_.derivedCommands.tileset);y.renderState=e._rsStencilDepthPass3DTiles,y.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,_.derivedCommands.tileset=y;let C=i[p*2+1];l(C)||(C=i[p*2+1]=new it({owner:e})),C.vertexArray=s,C.modelMatrix=u,C.offset=A,C.count=m,C.renderState=e._rsColorPass,C.shaderProgram=c,C.uniformMap=f,C.boundingVolume=h,C.cull=!1,C.pass=Be.TERRAIN_CLASSIFICATION;let E=it.shallowClone(C,C.derivedCommands.tileset);E.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,C.derivedCommands.tileset=E}e._commandsDirty=!0}function aGe(e,t){if(e.classificationType===ei.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,a=i.length=r/2,s=0;for(let c=0;c<a;++c){let u=i[c]=it.shallowClone(n[s],i[c]);u.shaderProgram=o,u.pass=Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,s+=2}e._commandsDirty=!1}function sGe(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,a=e._modelMatrix??P.IDENTITY,s=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],h=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new it({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=a,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=s,p.boundingVolume=h,p.pass=Be.TERRAIN_CLASSIFICATION;let A=it.shallowClone(p,p.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=A;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new it({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=a,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=s,m.boundingVolume=h,m.pass=Be.TERRAIN_CLASSIFICATION;let _=it.shallowClone(m,m.derivedCommands.tileset);_.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=_}e._pickCommandsDirty=!1}yA.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 Vs(e,r)}};yA.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function cGe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let a=n[o],s=t[a];s.show=!0,s.color=U.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=U.clone(U.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var lGe=new U,uGe=U.WHITE,fGe=!0,dGe=/\$/;yA.prototype.applyStyle=function(e,t){if(!l(e)){cGe(this,t);return}let n=e.color,i=n instanceof uh&&!dGe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,a;for(a=0;a<r;++a){let s=o[a],c=t[s];c.color=l(e.color)?e.color.evaluateColor(c,lGe):uGe,c.show=l(e.show)?e.show.evaluate(c):fGe}if(i){let s=this._batchedIndices;for(r=s.length,a=0;a<r;++a)s[a].color=U.clone(U.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};yA.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,a=o[i],s=r[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let _=c[f].offset,y=c[f].count;if(a>=_&&a<_+y)break}c.push(new _A({color:U.clone(t),offset:a,count:s,batchIds:[e]}));let h=[],p=[],A=c[f].batchIds,m=A.length;for(let _=0;_<m;++_){let y=A[_];if(y===e)continue;let C=n[y];o[C]<a?h.push(y):p.push(y)}p.length!==0&&c.push(new _A({color:U.clone(c[f].color),offset:a+s,count:c[f].offset+c[f].count-(a+s),batchIds:p})),h.length!==0?(c[f].count=a-c[f].offset,c[f].batchIds=h):c.splice(f,1),this._batchDirty=!0};function sce(e,t,n,i){let o=e.classificationType,r=o!==ei.CESIUM_3D_TILE,a=o!==ei.TERRAIN,s=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)r&&(u=n[f],u.pass=Be.TERRAIN_CLASSIFICATION,s.push(u)),a&&(u=n[f].derivedCommands.tileset,u.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,s.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)s.push(i[f])}function hGe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Be.OPAQUE,n.push(r)}}function mGe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ve.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Pe.LINES):(n=e._rsColorPass,i=Pe.TRIANGLES);let o=e._commands,r=o.length;for(let a=0;a<r;a+=2){let s=o[a+1];s.renderState=n,s.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}yA.prototype.update=function(e){let t=e.context;Kze(this,t),Xze(this,t),$ze(this),eGe(this,t);let n=e.passes;n.render&&(rGe(this,t),aGe(this,e),mGe(this),this._debugWireframe?hGe(e,this._commands):sce(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(sGe(this),sce(this,e,this._pickCommands))};yA.prototype.isDestroyed=function(){return!1};yA.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),fe(this)};var wb=yA;function qu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=d.clone(this._boundingVolume.center):this._center=d.clone(d.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ei.BOTH}Object.defineProperties(qu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});qu.packedBoxLength=P.packedLength+d.packedLength;qu.packedCylinderLength=P.packedLength+2;qu.packedEllipsoidLength=P.packedLength+d.packedLength;qu.packedSphereLength=d.packedLength+1;function pGe(e){let t=new Float64Array(P.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,P.pack(e._modelMatrix,t,n),t}function AGe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=le.unpack(t,n),n+=le.packedLength;let a=t[n++],s=e._batchedIndices=new Array(a);for(let c=0;c<a;++c){let u=U.unpack(t,n);n+=U.packedLength;let f=t[n++],h=t[n++],p=t[n++],A=new Array(p);for(let m=0;m<p;++m)A[m]=t[n++];s[c]=new _A({color:u,offset:f,count:h,batchIds:A})}return i}var gGe=new Zn("createVectorTileGeometries",5),_Ge=new U;function yGe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,a=e._ellipsoidBatchIds,s=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),a=e._ellipsoidBatchIds=a.slice(),m+=a.length),l(e._spheres)&&(s=e._sphere=s.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let _=e._batchTable;for(let y=0;y<m;++y){let C=_.getColor(y,_Ge);u[y]=C.toRgba()}f=e._packedBuffer=pGe(e)}let h=[];l(t)&&h.push(t.buffer,n.buffer),l(i)&&h.push(i.buffer,o.buffer),l(r)&&h.push(r.buffer,a.buffer),l(s)&&h.push(s.buffer,c.buffer),h.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?a.buffer:void 0,spheres:l(s)?s.buffer:void 0,sphereBatchIds:l(s)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},A=e._verticesPromise=gGe.scheduleTask(p,h);return l(A)?A.then(function(m){if(e.isDestroyed())return;let _=new Float64Array(m.packedBuffer);AGe(e,_)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),CGe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function CGe(e){l(e._primitive)||(e._primitive=new wb({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)}qu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};qu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};qu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};qu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};qu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=yGe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};qu.prototype.isDestroyed=function(){return!1};qu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var m_=qu;function zm(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,bGe(this,i,o)}Object.defineProperties(zm.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return l(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function EGe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function IGe(e,t){let n,i,o,r,a,s=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(s>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,s)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=l(n)||l(i)||l(o)||l(r),p=s>0&&!l(n)||c>0&&!l(i)||u>0&&!l(o)||f>0&&!l(r);if(h&&p)throw new ue("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let m=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),a=0;a<s;++a)n[a]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),a=0;a<c;++a)i[a]=m++;if(!l(o)&&u>0)for(o=new Uint16Array(u),a=0;a<u;++a)o[a]=m++;if(!l(r)&&f>0)for(r=new Uint16Array(f),a=0;a<f;++a)r[a]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var aE=Uint32Array.BYTES_PER_ELEMENT;function bGe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=aE;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=aE;let a=o.getUint32(n,!0);if(n+=aE,a===0){e._ready=!0;return}let s=o.getUint32(n,!0);if(n+=aE,s===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=aE;let u=o.getUint32(n,!0);n+=aE;let f=o.getUint32(n,!0);n+=aE;let h=Pr(i,n,s);n+=s;let p=new Uint8Array(t,n,c);n+=c;let A,m;u>0&&(A=Pr(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let _=h.BOXES_LENGTH??0,y=h.CYLINDERS_LENGTH??0,C=h.ELLIPSOIDS_LENGTH??0,E=h.SPHERES_LENGTH??0,I=_+y+C+E,x=new Um(e,I,A,m,EGe(e));if(e._batchTable=x,I===0)return;let S=e.tile.computedTransform,w;l(h.RTC_CENTER)&&(w=d.unpack(h.RTC_CENTER),P.multiplyByPoint(S,w,w));let v=IGe(h,p);if(_>0||y>0||C>0||E>0){let R,N,L,g;if(_>0){let b=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,b,m_.packedBoxLength*_)}if(y>0){let b=p.byteOffset+h.CYLINDERS.byteOffset;N=new Float32Array(p.buffer,b,m_.packedCylinderLength*y)}if(C>0){let b=p.byteOffset+h.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,b,m_.packedEllipsoidLength*C)}if(E>0){let b=p.byteOffset+h.SPHERES.byteOffset;g=new Float32Array(p.buffer,b,m_.packedSphereLength*E)}return e._geometries=new m_({boxes:R,boxBatchIds:v.boxes,cylinders:N,cylinderBatchIds:v.cylinders,ellipsoids:L,ellipsoidBatchIds:v.ellipsoids,spheres:g,sphereBatchIds:v.spheres,center:w,modelMatrix:S,batchTable:x,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function cce(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}zm.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};zm.prototype.getFeature=function(e){return cce(this),this._features[e]};zm.prototype.applyDebugSettings=function(e,t){l(this._geometries)&&this._geometries.applyDebugSettings(e,t)};zm.prototype.applyStyle=function(e){cce(this),l(this._geometries)&&this._geometries.applyStyle(e,this._features)};zm.prototype.update=function(e,t){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};zm.prototype.pick=function(e,t,n){};zm.prototype.isDestroyed=function(){return!1};zm.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};var TF=zm;var O6={};O6.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,a,s,c=BigInt(0);for(s=i/2;s>0;s/=2)r=(o.x&s)>0?1:0,a=(o.y&s)>0?1:0,c+=BigInt((3*r^a)*s*s),lce(i,o,r,a);return c};O6.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,a,s;for(a=1,s=t;a<n;a*=2)o=1&Number(s/BigInt(2)),r=1&Number(s^BigInt(o)),lce(a,i,o,r),i.x+=a*o,i.y+=a*r,s/=BigInt(4);return[i.x,i.y]};function lce(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 SB=O6;var sE=30,xGe=1<<sE,TGe=1<<sE+1>>>0,F6=2*sE+1,p_=4,dce=[],hce=[],SGe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],A_=1,Bb=2,SF=[A_,0,0,A_|Bb];function ya(e){if(!hn.supportsBigInt())throw new ue("S2 required BigInt support");this._cellId=e,this._level=ya.getLevel(e)}ya.fromToken=function(e){return new ya(ya.getIdFromToken(e))};ya.isValidId=function(e){return!(e<=0||e>>BigInt(F6)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ya.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ya.isValidId(ya.getIdFromToken(e)):!1};ya.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ya.getTokenFromId=function(e){let t=Math.floor(OGe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ya.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return sE-(t>>1)};ya.prototype.getChild=function(e){let t=Ace(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ya(n)};ya.prototype.getParent=function(){let e=Ace(this._cellId)<<BigInt(2);return new ya(this._cellId&~e+BigInt(1)|e)};ya.prototype.getParentAtLevel=function(e){let t=NGe(e);return new ya(this._cellId&-t|t)};ya.prototype.getCenter=function(e){e=e??te.WGS84;let t=wGe(this._cellId,this._level);t=d.normalize(t,t);let n=me.fromCartesian(t,te.UNIT_SPHERE);return me.toCartesian(n,e,new d)};ya.prototype.getVertex=function(e,t){t=t??te.WGS84;let n=BGe(this._cellId,this._level,e);n=d.normalize(n,n);let i=me.fromCartesian(n,te.UNIT_SPHERE);return me.toCartesian(i,t,new d)};ya.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),a=Array(F6-2*n).join("0"),s=BigInt(`0b${i}${r}${o}1${a}`);return new ya(s)};function wGe(e,t){let n=DGe(e,t);return vGe(n[0],n[1],n[2])}function BGe(e,t,n){let i=mce(e,t),o=PGe([i[1],i[2]],t),r=n>>1&1;return pce(i[0],o[0][r^n&1],o[1][r])}function DGe(e,t){let n=mce(e),i=n[0],o=n[1],r=n[2],a=t===30,s=!a&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=a?1:s?2:0,u=(o<<1)+c,f=(r<<1)+c;return[i,u,f]}function mce(e){dce.length===0&&MGe();let t=Number(e>>BigInt(F6)),n=t&A_,i=(1<<p_)-1,o=0,r=0;for(let a=7;a>=0;a--){let c=(1<<2*(a===7?sE-7*p_:p_))-1;n+=Number(e>>BigInt(a*2*p_+1)&BigInt(c))<<2,n=hce[n];let u=a*p_;o+=n>>p_+2<<u,r+=(n>>2&i)<<u,n&=A_|Bb}return[t,o,r]}function vGe(e,t,n){let i=uce(t),o=uce(n),r=wF(i),a=wF(o);return pce(e,r,a)}function pce(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function wF(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function uce(e){return 1/TGe*e}function PGe(e,t){let n=[[],[]],i=RGe(t);for(let o=0;o<2;++o){let r=e[o]&-i,a=r+i;n[o][0]=wF(fce(r)),n[o][1]=wF(fce(a))}return n}function RGe(e){return 1<<sE-e>>>0}function fce(e){return 1/xGe*e}function g_(e,t,n,i,o,r){if(e===p_){let a=(t<<p_)+n;dce[(a<<2)+i]=(o<<2)+r,hce[(o<<2)+i]=(a<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let a=SGe[r];g_(e,t+(a[0]>>1),n+(a[0]&1),i,o,r^SF[0]),g_(e,t+(a[1]>>1),n+(a[1]&1),i,o+1,r^SF[1]),g_(e,t+(a[2]>>1),n+(a[2]&1),i,o+2,r^SF[2]),g_(e,t+(a[3]>>1),n+(a[3]&1),i,o+3,r^SF[3])}}function MGe(){g_(0,0,0,0,0,0),g_(0,0,0,A_,0,A_),g_(0,0,0,Bb,0,Bb),g_(0,0,0,A_|Bb,0,A_|Bb)}function Ace(e){return e&~e+BigInt(1)}function NGe(e){return BigInt(1)<<BigInt(2*(sE-e))}var LGe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function OGe(e){return LGe[(-e&e)%BigInt(67)]}var __=ya;function FGe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var Si=FGe;function Q6(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new ue(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let a=e.computeAvailableCountEnabled??!1;!l(n)&&a&&(n=QGe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function QGe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(Q6.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Q6.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var wB=Q6;function CA(e){e=e??V.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(CA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});CA.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};CA.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};CA.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};CA.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};CA.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};CA.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};CA.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var BB=CA;var BF={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};BF.getBranchingFactor=function(e){switch(e){case BF.OCTREE:return 8;case BF.QUADTREE:return 4}};var ka=Object.freeze(BF);function Hs(){}Object.defineProperties(Hs.prototype,{class:{get:function(){de.throwInstantiationError()}}});Hs.prototype.hasProperty=function(e){de.throwInstantiationError()};Hs.prototype.hasPropertyBySemantic=function(e){de.throwInstantiationError()};Hs.prototype.getPropertyIds=function(e){de.throwInstantiationError()};Hs.prototype.getProperty=function(e){de.throwInstantiationError()};Hs.prototype.setProperty=function(e,t){de.throwInstantiationError()};Hs.prototype.getPropertyBySemantic=function(e){de.throwInstantiationError()};Hs.prototype.setPropertyBySemantic=function(e,t){de.throwInstantiationError()};Hs.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};Hs.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};Hs.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};Hs.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=Ye(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};Hs.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};Hs.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return Hs.getProperty(o.id,t,n)};Hs.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?Hs.setProperty(r.id,t,n,i):!1};var Kn=Hs;function EA(e){e=e??V.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(EA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});EA.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,this._class)};EA.prototype.hasPropertyBySemantic=function(e){return Kn.hasPropertyBySemantic(e,this._properties,this._class)};EA.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,this._class,e)};EA.prototype.getProperty=function(e){return Kn.getProperty(e,this._properties,this._class)};EA.prototype.setProperty=function(e,t){return Kn.setProperty(e,t,this._properties,this._class)};EA.prototype.getPropertyBySemantic=function(e){return Kn.getPropertyBySemantic(e,this._properties,this._class)};EA.prototype.setPropertyBySemantic=function(e,t){return Kn.setPropertyBySemantic(e,t,this._properties,this._class)};var DF=EA;var fn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},kc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};fn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:kc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:kc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:kc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:kc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:kc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:kc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:kc.INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:kc.UNSIGNED_INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:kc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:kc.FLOAT,downcastFunction:e=>Math.fround(e)}};fn.getMinimum=function(e){return fn.typeInfo[e].minimumValue};fn.getMaximum=function(e){return fn.typeInfo[e].maximumValue};fn.isIntegerType=function(e){return fn.typeInfo[e].category!==kc.FLOAT};fn.isUnsignedIntegerType=function(e){return fn.typeInfo[e].category===kc.UNSIGNED_INTEGER};fn.isVectorCompatible=function(e){return fn.typeInfo[e].vectorCompatible};fn.category=function(e){return fn.typeInfo[e].category};fn.gpuComponentType=function(e){switch(e){case fn.INT64:return"INT32";case fn.UINT64:return"UINT32";case fn.FLOAT64:return"FLOAT32";default:return e}};fn.normalize=function(e,t){return Math.max(Number(e)/Number(fn.getMaximum(t)),-1)};fn.unnormalize=function(e,t){let n=fn.getMaximum(t),i=fn.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===fn.INT64||t===fn.UINT64)&&hn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};fn.applyValueTransform=function(e,t,n){return n*e+t};fn.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};fn.getSizeInBytes=function(e){return fn.typeInfo[e].size};fn.clampToLimits=function(e,t){let n=fn.getMinimum(t),i=fn.getMaximum(t);if(typeof e=="bigint"){let o=BigInt(n),r=BigInt(i);return e<o?n:e>r?i:Number(e)}return Math.max(n,Math.min(i,e))};fn.downcastFunction=function(e){let n=fn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};fn.fromComponentDatatype=function(e){switch(e){case j.BYTE:return fn.INT8;case j.UNSIGNED_BYTE:return fn.UINT8;case j.SHORT:return fn.INT16;case j.UNSIGNED_SHORT:return fn.UINT16;case j.INT:return fn.INT32;case j.UNSIGNED_INT:return fn.UINT32;case j.FLOAT:return fn.FLOAT32;case j.DOUBLE:return fn.FLOAT64}};fn.toComponentDatatype=function(e){switch(e){case fn.INT8:return j.BYTE;case fn.UINT8:return j.UNSIGNED_BYTE;case fn.INT16:return j.SHORT;case fn.UINT16:return j.UNSIGNED_SHORT;case fn.INT32:return j.INT;case fn.UINT32:return j.UNSIGNED_INT;case fn.FLOAT32:return j.FLOAT;case fn.FLOAT64:return j.DOUBLE}};fn.getDataViewAccessors=function(e,t){return{[fn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[fn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[fn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,o)=>e.setUint16(i,o,!0)},[fn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,o)=>e.setInt16(i,o,!0)},[fn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,o)=>e.setUint32(i,o,!0)},[fn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,o)=>e.setInt32(i,o,!0)},[fn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,o)=>e.setFloat32(i,o,!0)},[fn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,o)=>e.setFloat64(i,o,!0)},[fn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,o)=>e.setBigUint64(i,BigInt(o),!0)},[fn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,o)=>e.setBigInt64(i,BigInt(o),!0)}}[t]};var Qt=Object.freeze(fn);var sr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};sr.isVectorType=function(e){switch(e){case sr.VEC2:case sr.VEC3:case sr.VEC4:return!0;default:return!1}};sr.isMatrixType=function(e){switch(e){case sr.MAT2:case sr.MAT3:case sr.MAT4:return!0;default:return!1}};sr.getComponentCount=function(e){switch(e){case sr.SCALAR:case sr.STRING:case sr.ENUM:case sr.BOOLEAN:return 1;case sr.VEC2:return 2;case sr.VEC3:return 3;case sr.VEC4:return 4;case sr.MAT2:return 4;case sr.MAT3:return 9;case sr.MAT4:return 16}};sr.getMathType=function(e){switch(e){case sr.VEC2:return Q;case sr.VEC3:return d;case sr.VEC4:return ie;case sr.MAT2:return Ki;case sr.MAT3:return J;case sr.MAT4:return P;default:return}};var It=Object.freeze(sr);function Ur(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&(e.normalized??!1)&&Qt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Ye(e.min,!0),this._max=Ye(e.max,!0),this._normalized=r;let a=Ye(e.offset,!0),s=Ye(e.scale,!0),c=l(a)||l(s),u=!0;l(a)||(a=this.expandConstant(0,u)),l(s)||(s=this.expandConstant(1,u)),this._offset=a,this._scale=s,this._hasValueTransform=c,this._noData=Ye(e.noData,!0),this._default=Ye(e.default,!0),this._required=e.required??!0,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}Ur.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.property,i=kGe(n),o=UGe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Ur({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(Ur.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function kGe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===It.SCALAR||It.isMatrixType(t)||It.isVectorType(t))return!1;if(l(Qt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function UGe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,a,s;o?(r=!0,a=e.componentCount,s=!l(a)):e.array?(r=!0,a=e.count,s=!l(e.count)):(r=!1,a=void 0,s=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===It.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:s,arrayLength:a};if(o&&i===It.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:s,arrayLength:a};if(n===It.SCALAR||It.isMatrixType(n)||It.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:s,arrayLength:a};if(n===It.BOOLEAN||n===It.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:s,arrayLength:a};if(o&&(i===It.BOOLEAN||i===It.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:s,arrayLength:a};if(l(i)&&l(Qt[i]))return{type:It.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:s,arrayLength:a};if(l(Qt[n]))return{type:It.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:s,arrayLength:a}}Ur.prototype.normalize=function(e){return this._normalized?k6(e,this._valueType,Qt.normalize):e};Ur.prototype.unnormalize=function(e){return this._normalized?k6(e,this._valueType,Qt.unnormalize):e};Ur.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ur.valueTransformInPlace(e,this._offset,this._scale,Qt.applyValueTransform)};Ur.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Ur.valueTransformInPlace(e,this._offset,this._scale,Qt.unapplyValueTransform)};Ur.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=It.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 a=new Array(o).fill(e);return new Array(this._arrayLength).fill(a)};Ur.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Cce(e,t))return e};function Cce(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(!Cce(e[n],t[n]))return!1;return!0}Ur.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=It.getMathType(this._type),i=this._isArray,o=It.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(a){return n.unpack(a)}):i?n.unpackArray(e):n.unpack(e):e};Ur.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=It.getMathType(this._type),i=this._isArray,o=It.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(a){return n.pack(a,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Ur.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?zGe(this,e):Ece(this,e)};function zGe(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=Ece(e,t[i]);if(l(o))return o}}function Ece(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return It.isVectorType(n)?GGe(t,n,i):It.isMatrixType(n)?VGe(t,n,i):n===It.STRING?HGe(t):n===It.BOOLEAN?WGe(t):n===It.ENUM?jGe(t,o):YGe(t,i,r)}function GGe(e,t,n){if(!Qt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===It.VEC2&&!(e instanceof Q))return`vector value ${e} must be a Cartesian2`;if(t===It.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===It.VEC4&&!(e instanceof ie))return`vector value ${e} must be a Cartesian4`}function VGe(e,t,n){if(!Qt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===It.MAT2&&!(e instanceof Ki))return`matrix value ${e} must be a Matrix2`;if(t===It.MAT3&&!(e instanceof J))return`matrix value ${e} must be a Matrix3`;if(t===It.MAT4&&!(e instanceof P))return`matrix value ${e} must be a Matrix4`}function HGe(e){if(typeof e!="string")return vF(e,It.STRING)}function WGe(e){if(typeof e!="boolean")return vF(e,It.BOOLEAN)}function jGe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function YGe(e,t,n){let i=typeof e;switch(t){case Qt.INT8:case Qt.UINT8:case Qt.INT16:case Qt.UINT16:case Qt.INT32:case Qt.UINT32:case Qt.FLOAT32:case Qt.FLOAT64:return i!=="number"?vF(e,t):isFinite(e)?_ce(e,t,n):yce(e,t);case Qt.INT64:case Qt.UINT64:return i!=="number"&&i!=="bigint"?vF(e,t):i==="number"&&!isFinite(e)?yce(e,t):_ce(e,t,n)}}function vF(e,t){return`value ${e} does not match type ${t}`}function gce(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function _ce(e,t,n){if(n){let i=Qt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?gce(e,t,n):void 0}if(e<Qt.getMinimum(t)||e>Qt.getMaximum(t))return gce(e,t,n)}function yce(e,t){return`value ${e} of type ${t} must be finite`}function k6(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=k6(e[i],t,n);return e}Ur.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]=Ur.valueTransformInPlace(e[o],t[o],n[o],i);return e};Ur.prototype.cpuBytesPerElement=function(){return Ice(this,this.valueType)};Ur.prototype.gpuBytesPerElement=function(){let e=Qt.gpuComponentType(this.valueType);return Ice(this,e)};function Ice(e,t){let n=e.type,i=It.getComponentCount(n),o=e.isArray?e.arrayLength:1,r=Qt.getSizeInBytes(t);return i*o*r}Ur.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===It.STRING||t===It.BOOLEAN||this.gpuBytesPerElement()>e)};var U6=[void 0,"float","vec2","vec3","vec4"],bce=[void 0,"int","ivec2","ivec3","ivec4"],qGe=[void 0,"uint","uvec2","uvec3","uvec4"],KGe={[kc.FLOAT]:"uintBitsToFloat",[kc.INTEGER]:"int",[kc.UNSIGNED_INTEGER]:""};Ur.prototype.getGlslTypeWebGL1=function(){let e=It.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?U6[e]:bce[e]};Ur.prototype.getGlslType=function(){let e=this.valueType,t=It.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Qt.isIntegerType(e)||this.normalized?U6[t]:Qt.isUnsignedIntegerType(e)?qGe[t]:bce[t]};Ur.prototype.unpackTextureInShader=function(e,t,n,i){let o=this.getGlslType(),r=Qt.gpuComponentType(this.valueType),a=t.length,s=this.type,c=It.getComponentCount(s)*(this.isArray?this.arrayLength:1),u=Math.floor(a/c),f=`${n}_rawChannels`,h=`${n}_rawBits`,p=`${n}_unpackedValue`,A=`${o} ${p};`,m=`uint ${h};`;i.push(A),i.push(m);let _=`${U6[a]} ${f} = ${e};`;i.push(_);let y=KGe[Qt.category(r)],C=c>1;for(let E=0;E<c;E++){let I="rgba".slice(E*u,(E+1)*u),x=a>1?`.${I}`:"",S=`${h} = czm_unpackTexture(${f}${x});`,w="";C&&(w=`[${E}]`);let v="",R="";if(this.normalized){let L=Qt.getMaximum(r);v=` * ${1/Number(L)}`,R="float"}let N=`${p}${w} = ${R}(${y}(${h}))${v};`;i.push(S),i.push(N)}return p};Ur.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var IA=Ur;function DB(e){e=e??V.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,a=i.isArray,s=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=r===It.STRING,h=r===It.BOOLEAN,p=0,A;if(s){let g=n.arrayOffsetType??n.offsetType;g=Qt[g]??Qt.UINT32;let b=n.arrayOffsets??n.arrayOffsetBufferView;A=new z6(o[b],g,t+1),p+=A.typedArray.byteLength}let m=It.getComponentCount(r),_;s?_=A.get(t)-A.get(0):a?_=t*i.arrayLength:_=t;let y=m*_,C;if(f){let g=n.stringOffsetType??n.offsetType;g=Qt[g]??Qt.UINT32;let b=n.stringOffsets??n.stringOffsetBufferView;C=new z6(o[b],g,y+1),p+=C.typedArray.byteLength}(f||h)&&(c=Qt.UINT8);let E;f?E=C.get(y)-C.get(0):h?E=Math.ceil(y/8):E=y;let I=n.values??n.bufferView,x=new z6(o[I],c,E);p+=x.typedArray.byteLength;let S=n.offset,w=n.scale,v=i.hasValueTransform||l(S)||l(w);S=S??i.offset,w=w??i.scale,S=xce(S),w=xce(w);let R,N,L=this;f?R=function(g){return ZGe(g,L._values,L._stringOffsets)}:h?(R=function(g){return $Ge(g,L._values)},N=function(g,b){eVe(g,L._values,b)}):l(u)?(R=function(g){let b=L._values.get(g);return u.namesByValue[b]},N=function(g,b){let T=u.valuesByName[b];L._values.set(g,T)}):(R=function(g){return L._values.get(g)},N=function(g,b){L._values.set(g,b)}),this._arrayOffsets=A,this._stringOffsets=C,this._values=x,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=S,this._scale=w,this._hasValueTransform=v,this._getValue=R,this._setValue=N,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(DB.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}},classProperty:{get:function(){return this._classProperty}}});DB.prototype.get=function(e){let t=XGe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=cVe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};DB.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=lVe(this,t),t=n.unnormalize(t),JGe(this,e,t)};DB.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function xce(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?oi(t,i):t.push(i)}return t}function XGe(e,t){Sce(e)&&wce(e);let n=e._classProperty,i=n.isArray,o=n.type,r=It.getComponentCount(o);if(l(e._unpackedValues)){let a=e._unpackedValues[t];return i?Ye(a,!0):a}return!i&&r===1?e._getValue(t):Tce(e,n,t)}function Tce(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let a=It.getComponentCount(t.type);i*=a,o*=a}else{let s=(t.arrayLength??1)*e._vectorComponentCount;i=n*s,o=s}let r=new Array(o);for(let a=0;a<o;a++)r[a]=e._getValue(i+a);return r}function JGe(e,t,n){aVe(e,t,n)&&wce(e);let i=e._classProperty,o=i.isArray,r=i.type,a=It.getComponentCount(r);if(l(e._unpackedValues)){i.isArray&&(n=Ye(n,!0)),e._unpackedValues[t]=n;return}if(!o&&a===1){e._setValue(t,n);return}let s,c;if(i.isVariableLengthArray)s=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-s;else{let f=(i.arrayLength??1)*e._vectorComponentCount;s=t*f,c=f}for(let u=0;u<c;++u)e._setValue(s+u,n[u])}function ZGe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return ju(t.typedArray,i,o)}function $Ge(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function eVe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function tVe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);r&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),o+=c*Math.pow(256,s)}return r&&(o=-o),o}function nVe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,a=!0;for(let s=0;s<8;++s){let c=n.getUint8(i+s);r&&(a?c!==0&&(c=~(c-1)&255,a=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<<BigInt(s*8))}return r&&(o=-o),o}function iVe(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 oVe(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 rVe(e){switch(e){case Qt.INT8:return j.BYTE;case Qt.UINT8:return j.UNSIGNED_BYTE;case Qt.INT16:return j.SHORT;case Qt.UINT16:return j.UNSIGNED_SHORT;case Qt.INT32:return j.INT;case Qt.UINT32:return j.UNSIGNED_INT;case Qt.FLOAT32:return j.FLOAT;case Qt.FLOAT64:return j.DOUBLE}}function Sce(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===It.STRING||i===Qt.INT64&&!hn.supportsBigInt64Array()||i===Qt.UINT64&&!hn.supportsBigUint64Array()}function aVe(e,t,n){if(Sce(e))return!0;let i=e._arrayOffsets;if(l(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function wce(e){e._unpackedValues=sVe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function sVe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,a=It.getComponentCount(r);if(!o&&a===1){for(let s=0;s<t;++s)n[s]=e._getValue(s);return n}for(let s=0;s<t;s++)n[s]=Tce(e,i,s);return n}function cVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:IA.valueTransformInPlace(t,e._offset,e._scale,Qt.applyValueTransform)}function lVe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:IA.valueTransformInPlace(t,e._offset,e._scale,Qt.unapplyValueTransform)}function z6(e,t,n){let i=this,o,r,a;if(t===Qt.INT64)hn.supportsBigInt()?hn.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(s){return nVe(s,i)}):(bt("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(s){return tVe(s,i)});else if(t===Qt.UINT64)hn.supportsBigInt()?hn.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),a=function(s,c){i.typedArray[s]=BigInt(c)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(s){return oVe(s,i)}):(bt("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(s){return iVe(s,i)});else{let s=rVe(t);o=j.createArrayBufferView(s,e.buffer,e.byteOffset,n),a=function(c,u){i.typedArray[c]=u}}l(r)||(r=function(s){return i.typedArray[s]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=a,this._componentType=t}var PF=DB;function fh(e){e=e??V.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,o={};if(l(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let a=new PF({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=a,i+=a.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(fh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});fh.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,this._class)};fh.prototype.hasPropertyBySemantic=function(e){return Kn.hasPropertyBySemantic(e,this._properties,this._class)};fh.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,this._class,e)};fh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=uVe(this._class,t),i};fh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};fh.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};fh.prototype.setPropertyBySemantic=function(e,t,n){let i,o=this._class.propertiesBySemantic;return l(o)&&(i=o[t]),l(i)?this.setProperty(e,i.id,n):!1};fh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};fh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function uVe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let o=i.default;return i.isArray&&(o=Ye(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var dh=fh;var G6=class{get cacheKey(){de.throwInstantiationError()}load(){de.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=`
|
|
${n.message}`);let i=new ue(t);return l(n)&&(i.stack=`Original stack:
|
|
${n.stack}
|
|
Handler stack:
|
|
${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),fe(this)}},$i=G6;var fVe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},gt=Object.freeze(fVe);var RF=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,o=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=o,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=dVe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function dVe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await RF._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var Db=RF;var Mln=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:8f8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;Pviwue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndnavcd9hmbarTmbaohdarhwinadc:CuBdbadclfhdawcufgwmbkaeTmdarcdthDalhqcbhkinaohdaqhwarhxinadadydbgmcbawIdbgP:8cL4cFeGc:cufaPJbbbb9BEgsamas9kEBdbawclfhwadclfhdaxcufgxmbkaqaDfhqakcefgkae9hmbxdkkaeTmekarcdthqavce9hhDcbhkindndndnaDmbarTmdc:CuhwalhdarhxinawcbadIdbgP:8cL4cFeGc:cufaPJbbbb9BEgmawam9kEhwadclfhdaxcufgxmbxdkkdndndndnavPleddbdkarTmlaohdalhwarhxinadcbcbawIdbgP:8cL4cFeGgmc:cufgsasam0EaPJbbbb9BEBdbadclfhdawclfhwaxcufgxmbxikkarTmicbhdarhwinaoadfcbaladfIdbgP:8cL4cFeGgxc8Aaxc8A0Ec:cufaPJbbbb9BEBdbadclfhdawcufgwmbxdkkarTmdkc:CuhwkcbhdarhminawhxdnavceSmbaoadfydbhxkdndnaladfIdbgPcjjj;8iaxai9RcefgxcLt9R::NJbbbZJbbb:;aPJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohsxekcjjjj94hskabadfascFFFrGaxcKtVBdbadclfhdamcufgmmbkkabaqfhbalaqfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",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(A){n=A.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function o(A){for(var m=new Uint8Array(A.length),_=0;_<A.length;++_){var y=A.charCodeAt(_);m[_]=y>96?y-97:y>64?y-39:y+4}for(var C=0,_=0;_<A.length;++_)m[C++]=m[_]<60?t[m[_]]:(m[_]-60)*64+m[++_];return m.buffer.slice(0,C)}function r(A){if(!A)throw new Error("Assertion failed")}function a(A){return new Uint8Array(A.buffer,A.byteOffset,A.byteLength)}function s(A,m,_,y){var C=n.exports.sbrk,E=C(m.length*4),I=C(_*4),x=new Uint8Array(n.exports.memory.buffer),S=a(m);x.set(S,E),y&&y(E,E,m.length,_);var w=A(I,E,m.length,_);x=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(_);new Uint8Array(v.buffer).set(x.subarray(I,I+_*4)),S.set(x.subarray(E,E+m.length*4)),C(E-C(0));for(var R=0;R<m.length;++R)m[R]=v[m[R]];return[v,w]}function c(A,m,_,y){var C=n.exports.sbrk,E=C(_*4),I=C(_*y),x=new Uint8Array(n.exports.memory.buffer);x.set(a(m),I),A(E,I,_,y),x=new Uint8Array(n.exports.memory.buffer);var S=new Uint32Array(_);return new Uint8Array(S.buffer).set(x.subarray(E,E+_*4)),C(E-C(0)),S}function u(A,m,_,y,C,E,I){var x=n.exports.sbrk,S=x(m),w=x(y*C),v=new Uint8Array(n.exports.memory.buffer);v.set(a(_),w);var R=A(S,m,w,y,C,E,I),N=new Uint8Array(R);return N.set(v.subarray(S,S+R)),x(S-x(0)),N}function f(A){for(var m=0,_=0;_<A.length;++_){var y=A[_];m=m<y?y:m}return m}function h(A,m){if(r(m==2||m==4),m==4)return new Uint32Array(A.buffer,A.byteOffset,A.byteLength/4);var _=new Uint16Array(A.buffer,A.byteOffset,A.byteLength/2);return new Uint32Array(_)}function p(A,m,_,y,C,E,I){var x=n.exports.sbrk,S=x(_*y),w=x(_*E),v=new Uint8Array(n.exports.memory.buffer);v.set(a(m),w),A(S,_,y,C,w,I);var R=new Uint8Array(_*y);return R.set(v.subarray(S,S+_*y)),x(S-x(0)),R}return{ready:i,supported:!0,reorderMesh:function(A,m,_){var y=m?_?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return s(n.exports.meshopt_optimizeVertexFetchRemap,A,f(A)+1,y)},reorderPoints:function(A,m){return r(A instanceof Float32Array),r(A.length%m==0),r(m>=3),c(n.exports.meshopt_spatialSortRemap,A,A.length/m,m*4)},encodeVertexBuffer:function(A,m,_){r(_>0&&_<=256),r(_%4==0);var y=n.exports.meshopt_encodeVertexBufferBound(m,_);return u(n.exports.meshopt_encodeVertexBuffer,y,A,m,_)},encodeVertexBufferLevel:function(A,m,_,y,C){r(_>0&&_<=256),r(_%4==0),r(y>=0&&y<=3),r(C===void 0||C==0||C==1);var E=n.exports.meshopt_encodeVertexBufferBound(m,_);return u(n.exports.meshopt_encodeVertexBufferLevel,E,A,m,_,y,C===void 0?-1:C)},encodeIndexBuffer:function(A,m,_){r(_==2||_==4),r(m%3==0);var y=h(A,_),C=n.exports.meshopt_encodeIndexBufferBound(m,f(y)+1);return u(n.exports.meshopt_encodeIndexBuffer,C,y,m,4)},encodeIndexSequence:function(A,m,_){r(_==2||_==4);var y=h(A,_),C=n.exports.meshopt_encodeIndexSequenceBound(m,f(y)+1);return u(n.exports.meshopt_encodeIndexSequence,C,y,m,4)},encodeGltfBuffer:function(A,m,_,y,C){var E={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(E[y]),E[y](A,m,_,2,C===void 0?0:C)},encodeFilterOct:function(A,m,_,y){return r(_==4||_==8),r(y>=2&&y<=16),p(n.exports.meshopt_encodeFilterOct,A,m,_,y,16)},encodeFilterQuat:function(A,m,_,y){return r(_==8),r(y>=4&&y<=16),p(n.exports.meshopt_encodeFilterQuat,A,m,_,y,16)},encodeFilterExp:function(A,m,_,y,C){r(_>0&&_%4==0),r(y>=1&&y<=24);var E={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,A,m,_,y,_,C?E[C]:1)},encodeFilterColor:function(A,m,_,y){return r(_==4||_==8),r(y>=2&&y<=16),p(n.exports.meshopt_encodeFilterColor,A,m,_,y,16)}}})();var y_=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq:VZkdbk:XYi5ud9:du8Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCabaOad2fhXaAcethQaxaDfhiaOaeaoaeao6E9RhLalcl4cifcd4hKazcj;cbfaAfhYcbh8AazcjdfhEaHh3incbh5dnawTmbaxa8Acd4fRbbh5kcbh8Eazcj;cbfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcj;cbfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcj;cbfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaK6mva8FaKfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasa8Acd4fRbbgociGPlbedrbkaATmdaza8Afh8Fazcj;cbfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeaza8Afhaazcj;cbfhhcbhoceh8EaYh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaLaocefgofmbka8FaQfh8FcdhoaacdfhaahaQfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8Eaza8AfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaYhainazcj;cbfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3a8Aclfg8Aad6mbkaXazcjdfaAad2z:jjjjb8AazazcjdfaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:W9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:JBl8Aud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fhOaPaDfhAasaeaH9RaHasfae6EgCcsfgocl4cifcd4hXavcj;cbfaoc9WGgQcetfhLavcj;cbfaQci2fhKavcj;cbfaQfhYcbh8Aaoc;ab6hEincbh3dnawTmbaPa8Acd4fRbbh3kcbh5avcj;cbfh8Eindndndndna3a5cet4ciGgoc9:fPdebdkaxaA9RaQ6mwdnaQTmbavcj;cbfa5aQ2faAaQ;8qbbkaAaCfhAxdkaQTmeavcj;cbfa5aQ2fcbaQ;8kbxekaxaA9RaX6moaoclVcbawEhraAaXfhocbhidnaEmbaxao9Rc;Gb6mbcbhlina8EalfhidndndndndndnaAalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaiczfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaoclffagRb:q:W:cjbfhoxikaicafaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbahaocwffagRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbahaocdffagRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaQ0meaihlaxao9Rc;Fb0mbkkdnaiaQ9pmbaici4hlinaxao9RcK6mwa8EaifhqdndndndndndnaAaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLg8Fcdp:mea8FpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogapxiiiiiiiiiiiiiiiip8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaoclffagRb:q:W:cjbfhoxikaqaopbbwaopbbbg8Fclp:mea8FpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogapxssssssssssssssssp8Jg8Fp5b9cjF;8;4;W;G;ab9:9cU1:Nghcitpbi:q:G:cjbahRb:q:W:cjbghpsa8Fp5e9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPaaa8Fp9spkbbahaocwffagRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbghcitpbi:q:G:cjbahRb:q:W:cjbghpsaoRbeggcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbahaocdffagRb:q:W:cjbfhokalcdfhlaiczfgiaQ6mbkkaohAaoTmoka8EaQfh8Ea5cefg5cl9hmbkdndndndnawTmbaza8Acd4fRbbglciGPlbedwbkaQTmdavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep9Ta8Fpxeeeeeeeeeeeeeeeegap9op9Hp9rg8Fa8Jp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ug8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp9Ug8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep9Ta8Faap9op9Hp9rg8Fp9Ugap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp9Ugap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp9Ugap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp9Ug8Jp9AbbbaladfhlaoczfgoaQ6mbxikkaQTmeavcjdfa8Afhlava8Afpbdbh8Jcbhoinalavcj;cbfaofpblbg8KaYaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaLaofpblbg8NaKaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLg8Fcep:nea8Fpxebebebebebebebebgap9op:bep9rg8Fa8Jp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ma8PpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLg8Fcep:nea8Faap9op:bep9rg8Fp:oeg8Jp9Abbbaladfgla8Ja8Fa8Fpmlvorlvorlvorlvorp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmwDqkwDqkwDqkwDqkp:oeg8Jp9Abbbaladfgla8Ja8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9Abbbaladfgla8Ja8Ka8LpmwDKYqk8AExm35Ps8E8Fg8Fcep:nea8Faap9op:bep9rg8Fp:oegap9Abbbaladfglaaa8Fa8Fpmlvorlvorlvorlvorp:oegap9Abbbaladfglaaa8Fa8FpmwDqkwDqkwDqkwDqkp:oegap9Abbbaladfglaaa8Fa8FpmxmPsxmPsxmPsxmPsp:oeg8Jp9AbbbaladfhlaoczfgoaQ6mbxdkkaQTmbcbhocbalcl4gl9Rc8FGhiavcjdfa8Afhrava8Afpbdbhainaravcj;cbfaofpblbg8JaYaofpblbg8KpmbzeHdOiAlCvXoQrLg8LaLaofpblbg8MaKaofpblbg8NpmbzeHdOiAlCvXoQrLgypmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Sep9qg8Faap9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8LaypmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Sep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwKDYq8AkEx3m5P8Es8Fg8Ja8Ma8NpmwKDYq8AkEx3m5P8Es8Fg8KpmbezHdiOAlvCXorQLg8Faip:Rea8Falp:Sep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9Abbbaradfgraaa8Ja8KpmwDKYqk8AExm35Ps8E8Fg8Faip:Rea8Falp:Sep9qg8Fp9rgap9Abbbaradfgraaa8Fa8Fpmlvorlvorlvorlvorp9rgap9Abbbaradfgraaa8Fa8FpmwDqkwDqkwDqkwDqkp9rgap9Abbbaradfgraaa8Fa8FpmxmPsxmPsxmPsxmPsp9rgap9AbbbaradfhraoczfgoaQ6mbkka8Aclfg8Aad6mbkdnaCad2goTmbaOavcjdfao;8qbbkdnammbavavcjdfaCcufad2fad;8qbbkaCaHfhHc9:hoaAhPaAmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",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)?s(t):s(e),r,a=WebAssembly.instantiate(o,{}).then(function(C){r=C.instance,r.exports.__wasm_call_ctors()});function s(C){for(var E=new Uint8Array(C.length),I=0;I<C.length;++I){var x=C.charCodeAt(I);E[I]=x>96?x-97:x>64?x-39:x+4}for(var S=0,I=0;I<C.length;++I)E[S++]=E[I]<60?i[E[I]]:(E[I]-60)*64+E[++I];return E.buffer.slice(0,S)}function c(C,E,I,x,S,w,v){var R=C.exports.sbrk,N=x+3&-4,L=R(N*S),g=R(w.length),b=new Uint8Array(C.exports.memory.buffer);b.set(w,g);var T=E(L,x,S,g,w.length);if(T==0&&v&&v(L,N,S),I.set(b.subarray(L,L+x*S)),R(L-R(0)),T!=0)throw new Error("Malformed buffer data: "+T)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function A(C){var E={object:new Worker(C),pending:0,requests:{}};return E.object.onmessage=function(I){var x=I.data;E.pending-=x.count,E.requests[x.id][x.action](x.value),delete E.requests[x.id]},E}function m(C){for(var E="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+y.name+";"+c.toString()+y.toString(),I=new Blob([E],{type:"text/javascript"}),x=URL.createObjectURL(I),S=h.length;S<C;++S)h[S]=A(x);for(var S=C;S<h.length;++S)h[S].object.postMessage({});h.length=C,URL.revokeObjectURL(x)}function _(C,E,I,x,S){for(var w=h[0],v=1;v<h.length;++v)h[v].pending<w.pending&&(w=h[v]);return new Promise(function(R,N){var L=new Uint8Array(I),g=++p;w.pending+=C,w.requests[g]={resolve:R,reject:N},w.object.postMessage({id:g,count:C,size:E,source:L,mode:x,filter:S},[L.buffer])})}function y(C){var E=C.data;if(!E.id)return self.close();self.ready.then(function(I){try{var x=new Uint8Array(E.count*E.size);c(I,I.exports[E.mode],x,E.count,E.size,E.source,I.exports[E.filter]),self.postMessage({id:E.id,count:E.count,action:"resolve",value:x},[x.buffer])}catch(S){self.postMessage({id:E.id,count:E.count,action:"reject",value:S})}})}return{ready:a,supported:!0,useWorkers:function(C){m(C)},decodeVertexBuffer:function(C,E,I,x,S){c(r,r.exports.meshopt_decodeVertexBuffer,C,E,I,x,r.exports[u[S]])},decodeIndexBuffer:function(C,E,I,x){c(r,r.exports.meshopt_decodeIndexBuffer,C,E,I,x)},decodeIndexSequence:function(C,E,I,x){c(r,r.exports.meshopt_decodeIndexSequence,C,E,I,x)},decodeGltfBuffer:function(C,E,I,x,S,w){c(r,r.exports[f[S]],C,E,I,x,r.exports[u[w]])},decodeGltfBufferAsync:function(C,E,I,x,S){return h.length>0?_(C,E,I,f[x],u[S]):a.then(function(){var w=new Uint8Array(C*E);return c(r,r.exports[f[x]],w,C,E,I,r.exports[u[S]]),w})}}})();var Oln=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:H:cjbHjjjjbbh8Masc:Cefasyd;8egHcdtfa8MBdbasaHcefBd;8ea8Mcbaez:tjjjb8AkdnadTmbcbhKabhHina8NaHclfydbg8Fcx2fgeIdba8NaHydbgacx2fgAIdbg8S:tgRa8NaHcwfydbghcx2fgXIdlaAIdlg8U:tg8VNaeIdla8U:tg8WaXIdba8S:tg8XN:tg8Ya8YNa8WaXIdwaAIdwg8Z:tg80NaeIdwa8Z:tg8Wa8VN:tg81a81Na8Wa8XNaRa80N:tg80a80NMMg8V:rhBa8Yh8Xa80h8Wa81hRdna8VJbbbb9EgATmba8YaB:vh8Xa80aB:vh8Wa81aB:vhRkaIaOaacdtfydbgXc8S2fgeaRaB:rg8VaRNNg83aeIdbMUdbaea8Wa8Va8WNgUNg85aeIdlMUdlaea8Xa8Va8XNg86Ng87aeIdwMUdwaeaRaUNgUaeIdxMUdxaea86aRNg88aeIdzMUdzaea8Wa86Ng89aeIdCMUdCaeaRa8Va8Xa8ZNaRa8SNa8Ua8WNMM:mg8:Ng86NgRaeIdKMUdKaea8Wa86Ng8WaeId3MUd3aea8Xa86Ng8XaeIdaMUdaaea86a8:Ng86aeId8KMUd8Kaea8VaeIdyMUdyaIaOa8Fcdtfydbg8Fc8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdyaIaOahcdtfydbgac8S2fgea83aeIdbMUdbaea85aeIdlMUdlaea87aeIdwMUdwaeaUaeIdxMUdxaea88aeIdzMUdzaea89aeIdCMUdCaeaRaeIdKMUdKaea8WaeId3MUd3aea8XaeIdaMUdaaea86aeId8KMUd8Kaea8VaeIdyMUdydna8MTmbdnaATmba8YaB:vh8Ya80aB:vh80a81aB:vh81ka8MaXcltfgeaBJbbbZNgRa80Ng8VaeIdlMUdlaeaRa8YNg8WaeIdwMUdwaeaRa81Ng8XaeIdbMUdbaeaRa8S:ma81Na8Ua80N:ta8Za8YN:tNgRaeIdxMUdxa8Ma8Fcltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxa8Maacltfgea8VaeIdlMUdlaea8WaeIdwMUdwaea8XaeIdbMUdbaeaRaeIdxMUdxkaHcxfhHaKcifgKad6mbkkdnalTmbJq;x8J88J;n;m;m89J:v:;;w8ZamczGEamc;abGEh80cbhHaOhXazhKaIhea8NhAindnaHaXydb9hmbaHh8FdnazTmbaKydbh8Fka80hRdnaqTmbJbbjZa80aqa8FfRbbclGEhRkaecxfg8Fa8FIdbJbbbbMUdbaeczfg8Fa8FIdbJbbbbMUdbaecCfg8Fa8FIdbJbbbbMUdbaeaRaecyfg8FIdbg8YNgRaeIdbMUdbaeclfgaaRaaIdbMUdbaecwfgaaRaaIdbMUdbaecKfgaaaIdbaAIdbg8WaRN:tUdbaAcwfIdbh8Vaec3fgaaaIdbaRaAclfIdbg8XN:tUdbaecafgaaaIdbaRa8VN:tUdbaec8KfgaIdbh81a8Fa8YaRMUdbaaa81aRa8Va8VNa8Wa8WNa8Xa8XNMMNMUdbkaXclfhXaKclfhKaec8SfheaAcxfhAalaHcefgH9hmbkkdnadTmbcbh8Aabhainaba8Acdtfh8FcbhHinaYa8FaHc:G:G:cjbfydbcdtfydbgAfRbbhedndnaYaaaHfydbgXfRbbgKc99fcFeGcpe0mbaec99fcFeGc;:e6mekdnaKcufcFeGce0mba5aXcdtfydbaA9hmekdnaecufcFeGce0mba8EaAcdtfydbaX9hmekJbbacJbbacJbbbZaecFeGceSEaKcFeGceSEhUdna8Na8FaHc:K:G:cjbfydbcdtfydbcx2fgeIdwa8NaXcx2fgKIdwg86:tg8Sa8NaAcx2fghIdwa86:tg8Xa8XNahIdbaKIdbg8U:tg80a80NahIdlaKIdlg8Z:tg8Va8VNMMg81Na8Xa8Sa8XNaeIdba8U:tg83a80Na8VaeIdla8Z:tg85NMMg8WN:tg8Ya8YNa83a81Na80a8WN:tgRaRNa85a81Na8Va8WN:tg8Wa8WNMMgBJbbbb9ETmba8YaB:rgB:vh8Ya8WaB:vh8WaRaB:vhRkaUa81:rNgBa8Ya86NaRa8UNa8Za8WNMM:mg81Ng87a81Nh88a80a85Na8Va83N:tg81a81Na8Va8SNa8Xa85N:tg8Va8VNa8Xa83Na80a8SN:tg8Xa8XNMMg83:rh80a8Ya87Nh85a8Wa87Nh89aRa87Nh87a8WaBa8YNg8SNh8:a8SaRNhZaRaBa8WNgnNhca8Ya8SNh8Ya8WanNh8WaRaBaRNNh8Sdna83Jbbbb9ETmba81a80:vh81a8Xa80:vh8Xa8Va80:vh8VkaIaOaXcdtfydbc8S2fgeaeIdba8Sa8VaUa80:rNgRa8VNNMg80MUdbaea8Wa8XaRa8XNg8SNMg83aeIdlMUdlaea8Ya81aRa81Ng8WNMg8YaeIdwMUdwaeaca8Va8SNMg8SaeIdxMUdxaeaZa8Wa8VNMgUaeIdzMUdzaea8:a8Xa8WNMg8WaeIdCMUdCaea87a8VaRa81a86Na8Va8UNa8Za8XNMMg86:mNgRNMg8VaeIdKMUdKaea89a8XaRNMg8XaeId3MUd3aea85a81aRNMg81aeIdaMUdaaea88a86aRN:tgRaeId8KMUd8KaeaBaeIdyMUdyaIaOaAcdtfydbc8S2fgea80aeIdbMUdbaea83aeIdlMUdlaea8YaeIdwMUdwaea8SaeIdxMUdxaeaUaeIdzMUdzaea8WaeIdCMUdCaea8VaeIdKMUdKaea8XaeId3MUd3aea81aeIdaMUdaaeaRaeId8KMUd8KaeaBaeIdyMUdykaHclfgHcx9hmbkaacxfhaa8Acifg8Aad6mbkaCTmbcbhainJbbbbh80a8Nabaacdtfgeclfydbg8Fcx2fgHIdwa8Naeydbghcx2fgAIdwg8Z:tg8Va8VNaHIdbaAIdbg83:tg8Wa8WNaHIdlaAIdlg85:tg8Xa8XNMMg8Sa8Naecwfydbg8Acx2fgeIdwa8Z:tg8YNa8Va8YNa8WaeIdba83:tg81Na8XaeIdla85:tgBNMMgRa8VN:tJbbbbJbbjZa8Sa8Ya8YNa81a81NaBaBNMMg8UNaRaRN:tg86:va86Jbbbb9BEg86Nh88a8Ua8VNaRa8YN:ta86Nh89a8SaBNaRa8XN:ta86Nh8:a8Ua8XNaRaBN:ta86NhZa8Sa81NaRa8WN:ta86Nhna8Ua8WNaRa81N:ta86Nhca8WaBNa8Xa81N:tgRaRNa8Xa8YNa8VaBN:tgRaRNa8Va81Na8Wa8YN:tgRaRNMM:rJbbbZNhRa8PahaC2g8JcdtfhHa8Pa8AaC2gDcdtfhAa8Pa8FaC2g8KcdtfhXa8Z:mh9ca85:mhJa83:mh9eascjdfheaChKJbbbbhBJbbbbh86Jbbbbh8SJbbbbh8UJbbbbh8ZJbbbbh83Jbbbbh85Jbbbbh87JbbbbhUinaecwfaRa89aXIdbaHIdbg8Y:tg8XNa88aAIdba8Y:tg81NMg8VNUdbaeclfaRaZa8XNa8:a81NMg8WNUdbaeaRaca8XNana81NMg8XNUdbaecxfaRa9ca8VNaJa8WNa8Ya9ea8XNMMMg8YNUdbaRa8Va8WNNa8ZMh8ZaRa8Va8XNNa8UMh8UaRa8Wa8XNNa8SMh8SaRa8Ya8YNNaUMhUaRa8Va8YNNa87Mh87aRa8Wa8YNNa85Mh85aRa8Xa8YNNa83Mh83aRa8Va8VNNa86Mh86aRa8Wa8WNNaBMhBaRa8Xa8XNNa80Mh80aHclfhHaXclfhXaAclfhAaeczfheaKcufgKmbkagahc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Fc8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Ac8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8Ac8S2fgeIdwa8Nahydlg8Fcx2fgHIdwg8WNaeIdzaHIdbg8XNaeIdaMgRaRMMa8WNaeIdlaHIdlg8YNaeIdCa8WNaeId3MgRaRMMa8YNaeIdba8XNaeIdxa8YNaeIdKMgRaRMMa8XNaeId8KMMM:lhRJbbbbJbbjZaeIdyg8V:va8VJbbbb9BEh8VdndnahydwgDmbJFFuuh86xekJbbbbJbbjZaIaOa8Fcdtfydbc8S2fgeIdyg81:va81Jbbbb9BEaeIdwa8NaKcx2fgHIdwg81NaeIdzaHIdbg80NaeIdaMgBaBMMa81NaeIdlaHIdlgBNaeIdCa81NaeId3Mg81a81MMaBNaeIdba80NaeIdxaBNaeIdKMg81a81MMa80NaeId8KMMM:lNh86ka8VaRNhBdnaCTmbagaKc8S2fgAIdwa8WNaAIdza8XNaAIdaMgRaRMMa8WNaAIdla8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8Pa8FaC2gacdtfhHa8RaKaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8Vxekaga8Fc8S2fgAIdwa8NaKcx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEaQaXfydbgacdtfydbgXcu9hmbaQa8FcdtfydbhXkagaac8S2fgAIdwa8NaXcx2fgeIdwg8WNaAIdzaeIdbg8XNaAIdaMgRaRMMa8WNaAIdlaeIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaXaC2g8AcdtfhHa8RaaaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86a8XN:tg85a8SaBa8WN:ta8Za8XN:tgB:vg8S:mh8Za86a8Y:vg9c:mhJdnJbbbbaRaRa81:vg9eN:ta86a9cN:ta85a8SN:tg86:la87J:983:g81NgR9ETmba8Za83NaJa8UNa9ea80Nax:tMMa86:vhnka81:laR9ETmba8Y:laR9ETmbaB:laR9ETmba9e:manNa8W:ma8ZanNa83aB:vMgBNa8V:maJanNa8X:maBNa8Ua8Y:vMMg85Na80:ma81:vMMMh87aLa8FfgeclfydbgHaeydbge9RhhaEaecitfh8FJbbbbhRdnaHaeSgDmbJbbbbhRa8FheahhAina8Naeclfydbcx2fgHIdwa88:tg8Va8VNaHIdba8::tg8Va8VNaHIdla89:tg8Va8VNMMg8Va8Naeydbcx2fgHIdwa88:tg8Wa8WNaHIdba8::tg8Wa8WNaHIdla89:tg8Wa8WNMMg8WaRaRa8W9DEgRaRa8V9DEhRaecwfheaAcufgAmbkaR:rgRaRNhRkaBa88:tg8Va8VNa87a8::tg8Va8VNa85a89:tg8Va8VNMMaR9EmbaKId8KhndnaDmbina8Na8Fclfydbcx2fgeIdba8Na8Fydbcx2fgHIdbg8W:tgRa89aHIdlg8X:tg80NaeIdla8X:tg8Va8:a8W:tg86N:tg8YaRa85a8X:tg8SNa8Va87a8W:tg8UN:tg8XNa8Va88aHIdwg81:tg8ZNaeIdwa81:tg8Wa80N:tg80a8VaBa81:tg83Na8Wa8SN:tg8VNa8Wa86NaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9Fmda8Fcwfh8FahcufghmbkkJbbbbJbbjZac:vacJbbbb9BEgRa9BaBNa9Ia87Na9EMg8Va8VMMaBNa9Ca85Na9HaBNa9FMg8Va8VMMa85Na9Da87Na9Ja85Na9GMg8Va8VMMa87NanMMM:lNaRa9Ba88Na9Ia8:Na9EMg8Va8VMMa88Na9Ca89Na9Ha88Na9FMg8Va8VMMa89Na9Da8:Na9Ja89Na9GMg8Va8VMMa8:NanMMM:lNJbb;aZNJ:983:g81M9Emba8JaBUdwa8Ja85Udla8Ja87UdbkaXcefgXal9hmbkdnaCmbcbhCxdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",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(E){n=E.instance,n.exports.__wasm_call_ctors()});function o(E){for(var I=new Uint8Array(E.length),x=0;x<E.length;++x){var S=E.charCodeAt(x);I[x]=S>96?S-97:S>64?S-39:S+4}for(var w=0,x=0;x<E.length;++x)I[w++]=I[x]<60?t[I[x]]:(I[x]-60)*64+I[++x];return I.buffer.slice(0,w)}function r(E){if(!E)throw new Error("Assertion failed")}function a(E){return new Uint8Array(E.buffer,E.byteOffset,E.byteLength)}function s(E,I,x,S){var w=n.exports.sbrk,v=w(x*4),R=w(x*S*4),N=new Uint8Array(n.exports.memory.buffer);N.set(a(I),R),E(v,R,x,S*4),N=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(x);return new Uint8Array(L.buffer).set(N.subarray(v,v+x*4)),w(v-w(0)),L}function c(E,I,x){var S=n.exports.sbrk,w=S(I.length*4),v=S(x*4),R=new Uint8Array(n.exports.memory.buffer),N=a(I);R.set(N,w);var L=E(v,w,I.length,x);R=new Uint8Array(n.exports.memory.buffer);var g=new Uint32Array(x);new Uint8Array(g.buffer).set(R.subarray(v,v+x*4)),N.set(R.subarray(w,w+I.length*4)),S(w-S(0));for(var b=0;b<I.length;++b)I[b]=g[I[b]];return[g,L]}function u(E){for(var I=0,x=0;x<E.length;++x){var S=E[x];I=I<S?S:I}return I}function f(E,I,x,S,w,v,R,N,L){var g=n.exports.sbrk,b=g(4),T=g(x*4),B=g(w*v),M=g(x*4),O=new Uint8Array(n.exports.memory.buffer);O.set(a(S),B),O.set(a(I),M);var G=E(T,M,x,B,w,v,R,N,L,b);O=new Uint8Array(n.exports.memory.buffer);var k=new Uint32Array(G);a(k).set(O.subarray(T,T+G*4));var z=new Float32Array(1);return a(z).set(O.subarray(b,b+4)),g(b-g(0)),[k,z[0]]}function h(E,I,x,S,w,v,R,N,L,g,b,T,B){var M=n.exports.sbrk,O=M(4),G=M(x*4),k=M(w*v),z=M(w*N),F=M(L.length*4),H=M(x*4),Y=g?M(w):0,$=new Uint8Array(n.exports.memory.buffer);$.set(a(S),k),$.set(a(R),z),$.set(a(L),F),$.set(a(I),H),g&&$.set(a(g),Y);var W=E(G,H,x,k,w,v,z,N,F,L.length,Y,b,T,B,O);$=new Uint8Array(n.exports.memory.buffer);var K=new Uint32Array(W);a(K).set($.subarray(G,G+W*4));var Z=new Float32Array(1);return a(Z).set($.subarray(O,O+4)),M(O-M(0)),[K,Z[0]]}function p(E,I,x,S,w,v,R,N,L,g,b,T,B){var M=n.exports.sbrk,O=M(4),G=M(w*v),k=M(w*N),z=M(L.length*4),F=M(x*4),H=g?M(w):0,Y=new Uint8Array(n.exports.memory.buffer);Y.set(a(S),G),Y.set(a(R),k),Y.set(a(L),z),Y.set(a(I),F),g&&Y.set(a(g),H);var $=E(F,x,G,w,v,k,N,z,L.length,H,b,T,B,O);Y=new Uint8Array(n.exports.memory.buffer),a(I).set(Y.subarray(F,F+$*4)),a(S).set(Y.subarray(G,G+w*v)),a(R).set(Y.subarray(k,k+w*N));var W=new Float32Array(1);return a(W).set(Y.subarray(O,O+4)),M(O-M(0)),[$,W[0]]}function A(E,I,x,S){var w=n.exports.sbrk,v=w(x*S),R=new Uint8Array(n.exports.memory.buffer);R.set(a(I),v);var N=E(v,x,S);return w(v-w(0)),N}function m(E,I,x,S,w,v,R,N){var L=n.exports.sbrk,g=L(N*4),b=L(x*S),T=L(x*v),B=new Uint8Array(n.exports.memory.buffer);B.set(a(I),b),w&&B.set(a(w),T);var M=E(g,b,x,S,T,v,R,N);B=new Uint8Array(n.exports.memory.buffer);var O=new Uint32Array(M);return a(O).set(B.subarray(g,g+M*4)),L(g-L(0)),O}function _(E,I,x,S,w,v,R,N,L){var g=n.exports.sbrk,b=g(4),T=g(x*4),B=g(w*v),M=g(x*4),O=R?g(w):0,G=new Uint8Array(n.exports.memory.buffer);G.set(a(S),B),G.set(a(I),M),R&&G.set(a(R),O);var k=E(T,M,x,B,w,v,O,N,L,b);G=new Uint8Array(n.exports.memory.buffer);var z=new Uint32Array(k);a(z).set(G.subarray(T,T+k*4));var F=new Float32Array(1);return a(F).set(G.subarray(b,b+4)),g(b-g(0)),[z,F[0]]}function y(E,I,x,S,w,v,R){var N=n.exports.sbrk,L=N(x*4),g=N(w*v),b=N(x*4),T=new Uint8Array(n.exports.memory.buffer);T.set(a(S),g),T.set(a(I),b);var B=E(L,b,x,g,w,v,R);T=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(B);return a(M).set(T.subarray(L,L+B*4)),N(L-N(0)),M}var C={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(E){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0);var I=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E);return c(n.exports.meshopt_optimizeVertexFetchRemap,I,u(E)+1)},generatePositionRemap:function(E,I){return r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),s(n.exports.meshopt_generatePositionRemap,E,E.length/I,I)},simplify:function(E,I,x,S,w,v){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(I instanceof Float32Array),r(I.length%x==0),r(x>=3),r(S>=0&&S<=E.length),r(S%3==0),r(w>=0);for(var R=0,N=0;N<(v?v.length:0);++N)r(v[N]in C),R|=C[v[N]];var L=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),g=f(n.exports.meshopt_simplify,L,E.length,I,I.length/x,x*4,S,w,R);return g[0]=E instanceof Uint32Array?g[0]:new E.constructor(g[0]),g},simplifyWithAttributes:function(E,I,x,S,w,v,R,N,L,g){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(I instanceof Float32Array),r(I.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length==w*(I.length/x)),r(w>=0),r(R==null||R instanceof Uint8Array),r(R==null||R.length==I.length/x),r(N>=0&&N<=E.length),r(N%3==0),r(L>=0),r(Array.isArray(v)),r(w>=v.length),r(v.length<=32);for(var b=0;b<v.length;++b)r(v[b]>=0);for(var T=0,b=0;b<(g?g.length:0);++b)r(g[b]in C),T|=C[g[b]];var B=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),M=h(n.exports.meshopt_simplifyWithAttributes,B,E.length,I,I.length/x,x*4,S,w*4,new Float32Array(v),R,N,L,T);return M[0]=E instanceof Uint32Array?M[0]:new E.constructor(M[0]),M},simplifyWithUpdate:function(E,I,x,S,w,v,R,N,L,g){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(I instanceof Float32Array),r(I.length%x==0),r(x>=3),r(S instanceof Float32Array),r(S.length==w*(I.length/x)),r(w>=0),r(R==null||R instanceof Uint8Array),r(R==null||R.length==I.length/x),r(N>=0&&N<=E.length),r(N%3==0),r(L>=0),r(Array.isArray(v)),r(w>=v.length),r(v.length<=32);for(var b=0;b<v.length;++b)r(v[b]>=0);for(var T=0,b=0;b<(g?g.length:0);++b)r(g[b]in C),T|=C[g[b]];var B=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),M=p(n.exports.meshopt_simplifyWithUpdate,B,E.length,I,I.length/x,x*4,S,w*4,new Float32Array(v),R,N,L,T);if(E!==B)for(var b=0;b<M[0];++b)E[b]=B[b];return M},getScale:function(E,I){return r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),A(n.exports.meshopt_simplifyScale,E,E.length/I,I*4)},simplifyPoints:function(E,I,x,S,w,v){return r(E instanceof Float32Array),r(E.length%I==0),r(I>=3),r(x>=0&&x<=E.length/I),S?(r(S instanceof Float32Array),r(S.length%w==0),r(w>=3),r(E.length/I==S.length/w),m(n.exports.meshopt_simplifyPoints,E,E.length/I,I*4,S,w*4,v,x)):m(n.exports.meshopt_simplifyPoints,E,E.length/I,I*4,void 0,0,0,x)},simplifySloppy:function(E,I,x,S,w,v){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(I instanceof Float32Array),r(I.length%x==0),r(x>=3),r(S==null||S instanceof Uint8Array),r(S==null||S.length==I.length/x),r(w>=0&&w<=E.length),r(w%3==0),r(v>=0);var R=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),N=_(n.exports.meshopt_simplifySloppy,R,E.length,I,I.length/x,x*4,S,w,v);return N[0]=E instanceof Uint32Array?N[0]:new E.constructor(N[0]),N},simplifyPrune:function(E,I,x,S){r(E instanceof Uint32Array||E instanceof Int32Array||E instanceof Uint16Array||E instanceof Int16Array),r(E.length%3==0),r(I instanceof Float32Array),r(I.length%x==0),r(x>=3),r(S>=0);var w=E.BYTES_PER_ELEMENT==4?E:new Uint32Array(E),v=y(n.exports.meshopt_simplifyPrune,w,E.length,I,I.length/x,x*4,S);return v=E instanceof Uint32Array?v:new E.constructor(v),v}}})();var Qln=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;E:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgzaBa81:tg8Xa80a8Z:tg8YNaUa83:tg8Za8XNa8Za8YNMMUdbazaYfaPId8KaPIdC:tg8XaPIdyaPIdK:tg8YNaPIdaaPIdz:tg8Za8XNa8Za8YNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk:SmeQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkaYTaLVceGmbamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(_){n=_.instance,n.exports.__wasm_call_ctors()});function o(_){for(var y=new Uint8Array(_.length),C=0;C<_.length;++C){var E=_.charCodeAt(C);y[C]=E>96?E-97:E>64?E-39:E+4}for(var I=0,C=0;C<_.length;++C)y[I++]=y[C]<60?t[y[C]]:(y[C]-60)*64+y[++C];return y.buffer.slice(0,I)}function r(_){if(!_)throw new Error("Assertion failed")}function a(_){return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}var s=48,c=16;function u(_,y){var C=_.meshlets[y*4+0],E=_.meshlets[y*4+1],I=_.meshlets[y*4+2],x=_.meshlets[y*4+3];return{vertices:_.vertices.subarray(C,C+I),triangles:_.triangles.subarray(E,E+x*3)}}function f(_,y,C,E,I,x,S,w,v,R){var N=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(y.length,x,S),g=N(L*c),b=N(y.length*4),T=N(y.length),B=N(y.byteLength),M=N(C.byteLength),O=new Uint8Array(n.exports.memory.buffer);O.set(a(y),B),O.set(a(C),M);var G=_(g,b,T,B,y.length,M,E,I,x,S,w,v,R);O=new Uint8Array(n.exports.memory.buffer);for(var k=O.subarray(g,g+G*c),z=new Uint32Array(k.buffer,k.byteOffset,k.byteLength/4).slice(),F=0;F<G;++F){var H=z[F*4+0],Y=z[F*4+1],E=z[F*4+2],$=z[F*4+3];n.exports.meshopt_optimizeMeshlet(b+H*4,T+Y,$,E)}var W=z[(G-1)*4+0],K=z[(G-1)*4+1],Z=z[(G-1)*4+2],pe=z[(G-1)*4+3],ge=W+Z,re=K+pe*3,ye={meshlets:z,vertices:new Uint32Array(O.buffer,b,ge).slice(),triangles:new Uint8Array(O.buffer,T,re).slice(),meshletCount:G};return N(g-N(0)),ye}function h(_){var y=new Float32Array(n.exports.memory.buffer,_,s/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function p(_,y,C,E){var I=n.exports.sbrk,x=[],S=I(y.byteLength),w=I(_.vertices.byteLength),v=I(_.triangles.byteLength),R=I(s),N=new Uint8Array(n.exports.memory.buffer);N.set(a(y),S),N.set(a(_.vertices),w),N.set(a(_.triangles),v);for(var L=0;L<_.meshletCount;++L){var g=_.meshlets[L*4+0],b=_.meshlets[L*4+0+1],T=_.meshlets[L*4+0+3];n.exports.meshopt_computeMeshletBounds(R,w+g*4,v+b,T,S,C,E),x.push(h(R))}return I(S-I(0)),x}function A(_,y,C,E){var I=n.exports.sbrk,x=I(s),S=I(_.byteLength),w=I(y.byteLength),v=new Uint8Array(n.exports.memory.buffer);v.set(a(_),S),v.set(a(y),w),n.exports.meshopt_computeClusterBounds(x,S,_.length,w,C,E);var R=h(x);return I(x-I(0)),R}function m(_,y,C,E,I){var x=n.exports.sbrk,S=x(s),w=x(_.byteLength),v=E?x(E.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(a(_),w),E&&R.set(a(E),v),n.exports.meshopt_computeSphereBounds(S,w,y,C,v,E?I:0);var N=h(S);return x(S-x(0)),N}return{ready:i,supported:!0,buildMeshlets:function(_,y,C,E,I,x){r(_.length%3==0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),r(E>=3&&E<=256),r(I>=1&&I<=512),x=x||0;var S=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(n.exports.meshopt_buildMeshletsFlex,S,y,y.length/C,C*4,E,I,I,x,0)},buildMeshletsFlex:function(_,y,C,E,I,x,S,w){r(_.length%3==0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),r(E>=3&&E<=256),r(I>=1&&x<=512),r(I<=x),S=S||0,w=w||0;var v=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(n.exports.meshopt_buildMeshletsFlex,v,y,y.length/C,C*4,E,I,x,S,w)},buildMeshletsSpatial:function(_,y,C,E,I,x,S){r(_.length%3==0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),r(E>=3&&E<=256),r(I>=1&&x<=512),r(I<=x),S=S||0;var w=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return f(n.exports.meshopt_buildMeshletsSpatial,w,y,y.length/C,C*4,E,I,x,S)},extractMeshlet:function(_,y){return r(y>=0&&y<_.meshletCount),u(_,y)},computeClusterBounds:function(_,y,C){r(_.length%3==0),r(_.length/3<=512),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3);var E=_.BYTES_PER_ELEMENT==4?_:new Uint32Array(_);return A(E,y,y.length/C,C*4)},computeMeshletBounds:function(_,y,C){return r(_.meshletCount!=0),r(y instanceof Float32Array),r(y.length%C==0),r(C>=3),p(_,y,y.length/C,C*4)},computeSphereBounds:function(_,y,C,E){return r(_ instanceof Float32Array),r(_.length%y==0),r(y>=3),r(!C||C instanceof Float32Array),r(!C||C.length%E==0),r(!C||E>=1),r(!C||_.length/y==C.length/E),E=E||0,m(_,_.length/y,y*4,C,E*4)}}})();var V6=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.bufferViewId,r=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.bufferViews[o],u=c.buffer,f=c.byteOffset,h=c.byteLength,p=!1,A,m,_,y;if(Si(c,"EXT_meshopt_compression")){let E=c.extensions.EXT_meshopt_compression;u=E.buffer,f=E.byteOffset??0,h=E.byteLength,p=!0,A=E.byteStride,m=E.count,_=E.mode,y=E.filter??"NONE"}let C=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=A,this._meshoptCount=m,this._meshoptMode=_,this._meshoptFilter=y,this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._buffer=C,this._bufferId=u,this._byteOffset=f,this._byteLength=h,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=hVe(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function hVe(e){try{let t=mVe(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,a=new Uint8Array(o*r);y_.decodeGltfBuffer(a,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=a}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}function mVe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var vB=V6;var cE=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new Zn("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new ue("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};cE._maxDecodingConcurrency=Math.max(hn.hardwareConcurrency-1,1);cE._decoderTaskProcessor=void 0;cE._taskProcessorReady=!1;cE._error=void 0;var C_=cE;var On={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function pVe(e){switch(e){case On.POSITION:return"positionMC";case On.NORMAL:return"normalMC";case On.TANGENT:return"tangentMC";case On.TEXCOORD:return"texCoord";case On.COLOR:return"color";case On.JOINTS:return"joints";case On.WEIGHTS:return"weights";case On.FEATURE_ID:return"featureId";case On.SCALE:return"scale";case On.ROTATION:return"rotation";case On.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}On.hasSetIndex=function(e){switch(e){case On.POSITION:case On.NORMAL:case On.TANGENT:case On.CUMULATIVE_DISTANCE:return!1;case On.TEXCOORD:case On.COLOR:case On.JOINTS:case On.WEIGHTS:case On.FEATURE_ID:case On.SCALE:case On.ROTATION:return!0}};On.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return On.POSITION;case"NORMAL":return On.NORMAL;case"TANGENT":return On.TANGENT;case"TEXCOORD":return On.TEXCOORD;case"COLOR":return On.COLOR;case"JOINTS":return On.JOINTS;case"WEIGHTS":return On.WEIGHTS;case"_FEATURE_ID":return On.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return On.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return On.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return On.CUMULATIVE_DISTANCE}};On.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return On.POSITION;case"RGBA":case"RGB":case"RGB565":return On.COLOR;case"NORMAL":case"NORMAL_OCT16P":return On.NORMAL;case"BATCH_ID":return On.FEATURE_ID}};On.getGlslType=function(e){switch(e){case On.POSITION:case On.NORMAL:case On.TANGENT:return"vec3";case On.TEXCOORD:return"vec2";case On.COLOR:return"vec4";case On.JOINTS:return"ivec4";case On.WEIGHTS:return"vec4";case On.FEATURE_ID:return"int";case On.SCALE:return"vec3";case On.ROTATION:return"vec4";case On.CUMULATIVE_DISTANCE:return"float";case On.OPACITY:return"float"}};On.getVariableName=function(e,t){let n=pVe(e);return l(t)&&(n+=`_${t}`),n};var at=Object.freeze(On);var H6=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.draco,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=o,this._draco=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=AVe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._dracoError)&&Bce(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,o=this._gltf,r=o.bufferViews,a=n.bufferView,s=r[a],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let A=_Ve(p);l(A)&&o.accessors[i.attributes[p]].componentType===j.FLOAT&&(u.includes(A)||u.push(A))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},h=C_.decodeBufferView(f);if(!l(h))return!1;this._decodePromise=gVe(this,h)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function AVe(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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Bce(e,n)}}function Bce(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function gVe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var lE={};lE[at.POSITION]="POSITION";lE[at.NORMAL]="NORMAL";lE[at.COLOR]="COLOR";lE[at.TEXCOORD]="TEX_COORD";function _Ve(e){for(let t in lE)if(lE.hasOwnProperty(t)&&e.startsWith(t))return lE[t]}var PB=H6;function yVe(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,a=new Blob([t],{type:n}),s;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(a,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(s=window.URL.createObjectURL(a),new De({url:s,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(s)&&window.URL.revokeObjectURL(s),c}).catch(function(c){return l(s)&&window.URL.revokeObjectURL(s),Promise.reject(c)})}var E_=yVe;var RB=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.imageId,r=t.gltfResource,a=t.baseResource,s=t.cacheKey,c=i.images[o],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=CVe(this),this._promise):(this._promise=EVe(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function Dce(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 CVe(e){e._state=gt.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 bVe(i);if(e.isDestroyed())return;let r=Dce(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:vce(e,n,"Failed to load embedded image")}}async function EVe(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await TVe(i);if(e.isDestroyed())return;let r=Dce(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:vce(e,o,`Failed to load image: ${n}`)}}function vce(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function IVe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ue("Image format is not recognized")}async function bVe(e){let t=IVe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return ku(n)}return RB._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var xVe=/(^data:image\/ktx2)|(\.ktx2$)/i;function TVe(e){let t=e.getUrlComponent(!1,!0);return xVe.test(t)?ku(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}RB._loadImageFromTypedArray=E_;var MB=RB;var SVe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Uc=Object.freeze(SVe);var W6=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.accessorId,r=t.gltfResource,a=t.baseResource,s=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,h=t.loadBuffer??!1,p=t.loadTypedArray??!1,A=i.accessors[o].componentType;this._resourceCache=n,this._gltfResource=r,this._baseResource=a,this._gltf=i,this._accessorId=o,this._indexDatatype=A,this._primitive=s,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=h,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=BVe(this),this._promise):(this._promise=DVe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=j.fromTypedArray(n),this._indexDatatype=i)}catch(r){Y6(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=wVe;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Uc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=Pce(n,i,t.context));return this.unload(),this._buffer=o,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.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}},j6=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Pce(this.typedArray,this.indexDatatype,this.context)}};function Pce(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Re.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var wVe=new j6;async function BVe(e){e._state=gt.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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;Y6(e,n)}}async function DVe(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let a=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=a,await a.load(),e.isDestroyed())return;let s=a.typedArray;return e._typedArray=vVe(e,s),e._state=gt.PROCESSING,e}catch(a){if(e.isDestroyed())return;Y6(e,a)}}function vVe(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,a=o.componentType,s=Ue.getSizeInBytes(a),c=t.buffer,u=t.byteOffset+o.byteOffset;if(u%s!==0){let h=r*s,p=new Uint8Array(c,u,h);c=new Uint8Array(p).buffer,u=0,Gs("index-buffer-unaligned",`The index array is not aligned to a ${s}-byte boundary.`)}let f;return a===Ue.UNSIGNED_BYTE?f=new Uint8Array(c,u,r):a===Ue.UNSIGNED_SHORT?f=new Uint16Array(c,u,r):a===Ue.UNSIGNED_INT&&(f=new Uint32Array(c,u,r)),f}function Y6(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}var NB=W6;function PVe(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 xs=PVe;function RVe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var zr=RVe;function nn(){}nn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};nn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(l(r))return r}}};nn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?nn.objectLegacy(i,n):nn.object(i,n)};nn.accessor=function(e,t){return nn.topLevel(e,"accessors",t)};nn.accessorWithSemantic=function(e,t,n){let i={};return nn.mesh(e,function(o){return nn.meshPrimitive(o,function(r){let a=nn.meshPrimitiveAttribute(r,function(s,c){if(c.indexOf(t)===0&&!l(i[s])){i[s]=!0;let u=n(s);if(l(u))return u}});return l(a)?a:nn.meshPrimitiveTarget(r,function(s){return nn.meshPrimitiveTargetAttribute(s,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};nn.accessorContainingVertexAttributeData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(o){let r=nn.meshPrimitiveAttribute(o,function(a){if(!l(n[a])){n[a]=!0;let s=t(a);if(l(s))return s}});return l(r)?r:nn.meshPrimitiveTarget(o,function(a){return nn.meshPrimitiveTargetAttribute(a,function(s){if(!l(n[s])){n[s]=!0;let c=t(s);if(l(c))return c}})})})})};nn.accessorContainingIndexData=function(e,t){let n={};return nn.mesh(e,function(i){return nn.meshPrimitive(i,function(o){let r=o.indices;if(l(r)&&!l(n[r])){n[r]=!0;let a=t(r);if(l(a))return a}})})};nn.animation=function(e,t){return nn.topLevel(e,"animations",t)};nn.animationChannel=function(e,t){let n=e.channels;return nn.object(n,t)};nn.animationSampler=function(e,t){let n=e.samplers;return nn.object(n,t)};nn.buffer=function(e,t){return nn.topLevel(e,"buffers",t)};nn.bufferView=function(e,t){return nn.topLevel(e,"bufferViews",t)};nn.camera=function(e,t){return nn.topLevel(e,"cameras",t)};nn.image=function(e,t){return nn.topLevel(e,"images",t)};nn.material=function(e,t){return nn.topLevel(e,"materials",t)};nn.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.mesh=function(e,t){return nn.topLevel(e,"meshes",t)};nn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],a=t(r,o);if(l(a))return a}}};nn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(l(r))return r}}};nn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}};nn.node=function(e,t){return nn.topLevel(e,"nodes",t)};nn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let o=t.length;for(let r=0;r<o;r++){let a=t[r],s=i[a];if(l(s)){let c=n(s,a);if(l(c))return c;let u=s.children;if(l(u)&&(c=nn.nodeInTree(e,u,n),l(c)))return c}}}};nn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return nn.nodeInTree(e,i,n)};nn.program=function(e,t){return zr(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.programs,t):nn.topLevel(e,"programs",t)};nn.sampler=function(e,t){return nn.topLevel(e,"samplers",t)};nn.scene=function(e,t){return nn.topLevel(e,"scenes",t)};nn.shader=function(e,t){return zr(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.shaders,t):nn.topLevel(e,"shaders",t)};nn.skin=function(e,t){return nn.topLevel(e,"skins",t)};nn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],a=t(r);if(l(a))return a}}};nn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(l(o))return o}};nn.technique=function(e,t){return zr(e,"KHR_techniques_webgl")?nn.object(e.extensions.KHR_techniques_webgl.techniques,t):nn.topLevel(e,"techniques",t)};nn.texture=function(e,t){return nn.topLevel(e,"textures",t)};var ze=nn;function MVe(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 Jf=MVe;function NVe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return j.getSizeInBytes(t.componentType)*Jf(t.type)}var Ku=NVe;function LVe(e){ze.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),ze.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){if(i.mode=i.mode??ee.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=xs(e.materials,o)}})}),ze.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=Ku(e,i),r.target=ee.ARRAY_BUFFER}}),ze.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ee.ELEMENT_ARRAY_BUFFER}}),ze.material(e,function(n){let i=n.extensions??{},o=i.KHR_materials_common;if(l(o)){let c=o.technique,u=l(o.values)?o.values:{};o.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&ze.materialValue(n,function(c){l(c.index)&&uE(c)}),uE(n.emissiveTexture),uE(n.normalTexture),uE(n.occlusionTexture);let a=n.pbrMetallicRoughness;l(a)&&(a.baseColorFactor=a.baseColorFactor??[1,1,1,1],a.metallicFactor=a.metallicFactor??1,a.roughnessFactor=a.roughnessFactor??1,uE(a.baseColorTexture),uE(a.metallicRoughnessTexture));let s=i.KHR_materials_pbrSpecularGlossiness;l(s)&&(s.diffuseFactor=s.diffuseFactor??[1,1,1,1],s.specularFactor=s.specularFactor??[1,1,1],s.glossinessFactor=s.glossinessFactor??1,uE(s.specularGlossinessTexture))}),ze.animation(e,function(n){ze.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=OVe(e);return ze.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),ze.sampler(e,function(n){n.wrapS=n.wrapS??ee.REPEAT,n.wrapT=n.wrapT??ee.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function OVe(e){let t={};return ze.animation(e,function(n){ze.animationChannel(n,function(i){let o=i.target,r=o.node,a=o.path;(a==="translation"||a==="rotation"||a==="scale")&&(t[r]=!0)})}),t}function uE(e){l(e)&&(e.texCoord=e.texCoord??0)}var MF=LVe;function FVe(e){return ze.shader(e,function(t){NF(t)}),ze.buffer(e,function(t){NF(t)}),ze.image(e,function(t){NF(t)}),NF(e),e}function NF(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var fE=FVe;function QVe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var LF=QVe;function kVe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),LF(e,t),n.length===0&&delete e.extensionsUsed}}var vb=kVe;var UVe=4;function zVe(e){if(km(e)!=="glTF")throw new ue("File is not valid binary glTF");let n=Rce(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ue("Binary glTF version is not 1 or 2");return i===1?GVe(e,n):VVe(e,n)}function Rce(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*UVe,!0);return o}function GVe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ue("Binary glTF scene format is not JSON");let r=20,a=r+i,s=ju(e,r,i),c=JSON.parse(s);fE(c);let u=e.subarray(a,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let h=f.binary_glTF??f.KHR_binary_glTF;l(h)&&(h.extras._pipeline.source=u,delete h.uri)}return vb(c,"KHR_binary_glTF"),c}function VVe(e,t){let n=t[2],i=12,o,r;for(;i<n;){let a=Rce(e,i,2),s=a[0],c=a[1];i+=8;let u=e.subarray(i,i+s);if(i+=s,c===1313821514){let f=ju(u);o=JSON.parse(f),fE(o)}else c===5130562&&(r=u)}if(l(o)&&l(r)){let a=o.buffers;if(l(a)&&a.length>0){let s=a[0];s.extras._pipeline.source=r}}return o}var Pb=zVe;function HVe(e){return ze.shader(e,function(t){OF(t)}),ze.buffer(e,function(t){OF(t)}),ze.image(e,function(t){OF(t)}),OF(e),e}function OF(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var FF=HVe;function WVe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),xs(n,t,!0)}var hh=WVe;function jVe(e){switch(e){case j.BYTE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt8(n+a*o)};case j.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint8(n+a*o)};case j.SHORT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt16(n+a*o,!0)};case j.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint16(n+a*o,!0)};case j.INT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getInt32(n+a*o,!0)};case j.UNSIGNED_INT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getUint32(n+a*o,!0)};case j.FLOAT:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getFloat32(n+a*o,!0)};case j.DOUBLE:return function(t,n,i,o,r){for(let a=0;a<i;++a)r[a]=t.getFloat64(n+a*o,!0)}}}var I_=jVe;function YVe(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Jf(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let a=new Array(r).fill(Number.POSITIVE_INFINITY),s=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],u=c.buffer,h=i[u].extras._pipeline.source,p=t.count,A=Ku(e,t),m=t.byteOffset+c.byteOffset+h.byteOffset,_=t.componentType,y=j.getSizeInBytes(_),C=new DataView(h.buffer),E=new Array(r),I=I_(_);for(let x=0;x<p;x++){I(C,m,r,y,E);for(let S=0;S<r;S++){let w=E[S];a[S]=Math.min(a[S],w),s[S]=Math.max(s[S],w)}m+=A}return{min:a,max:s}}var Rb=YVe;var qVe=[ee.FUNC_ADD,ee.FUNC_ADD],KVe=[ee.ONE,ee.ZERO,ee.ONE,ee.ZERO];function Mce(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var XVe=[ee.ZERO,ee.ONE,ee.SRC_COLOR,ee.ONE_MINUS_SRC_COLOR,ee.SRC_ALPHA,ee.ONE_MINUS_SRC_ALPHA,ee.DST_ALPHA,ee.ONE_MINUS_DST_ALPHA,ee.DST_COLOR,ee.ONE_MINUS_DST_COLOR];function JVe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(XVe.indexOf(e[n])===-1)return t;return e}function ZVe(e){let t={},n={},i=e.techniques;return l(i)&&(ze.technique(e,function(o,r){let a=o.states;if(l(a)){let s=n[r]={};if(Mce(a,ee.BLEND)){s.alphaMode="BLEND";let c=a.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??qVe,blendFactors:JVe(c.blendFuncSeparate,KVe)})}Mce(a,ee.CULL_FACE)||(s.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),hh(e,"KHR_blend")),ze.material(e,function(o){if(l(o.technique)){let r=n[o.technique];ze.objectLegacy(r,function(s,c){o[c]=s});let a=t[o.technique];l(a)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=a)}})),e}var QF=ZVe;function $Ve(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),xs(n,t,!0),hh(e,t)}var kF=$Ve;function e8e(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},a=e.glExtensionsUsed;delete e.glExtensionsUsed,ze.technique(e,function(s,c){let u={name:s.name,program:void 0,attributes:{},uniforms:{}},f;if(ze.techniqueAttribute(s,function(h,p){f=s.parameters[h],u.attributes[p]={semantic:f.semantic}}),ze.techniqueUniform(s,function(h,p){f=s.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][h]=p}),l(o[s.program]))u.program=o[s.program];else{let h=e.programs[s.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:a},A=e.shaders[h.fragmentShader];p.fragmentShader=xs(r.shaders,A,!0);let m=e.shaders[h.vertexShader];p.vertexShader=xs(r.shaders,m,!0),u.program=xs(r.programs,p),o[s.program]=u.program}i[c]=xs(r.techniques,u)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,hh(e,"KHR_techniques_webgl"),kF(e,"KHR_techniques_webgl"))}return ze.material(e,function(r){if(l(r.technique)){let a={technique:i[r.technique]};ze.objectLegacy(r.values,function(s,c){l(a.values)||(a.values={});let u=n[r.technique][c];l(u)&&(a.values[u]=s)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=a}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var UF=e8e;function t8e(e,t){Wo.typeOf.object("material",e),Wo.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,a=t(r.index,r);if(l(a))return a}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,a=t(r.index,r);if(l(a))return a}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let c=r.diffuseTexture,u=t(c.index,c);if(l(u))return u}if(l(r.specularGlossinessTexture)){let c=r.specularGlossinessTexture,u=t(c.index,c);if(l(u))return u}}let a=i.KHR_materials_specular;if(l(a)){let{specularTexture:c,specularColorTexture:u}=a;if(l(c)){let f=t(c.index,c);if(l(f))return f}if(l(u)){let f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_common;if(l(s)&&l(s.values)){let{diffuse:c,ambient:u,emission:f,specular:h}=s.values;if(l(c)&&l(c.index)){let p=t(c.index,c);if(l(p))return p}if(l(u)&&l(u.index)){let p=t(u.index,u);if(l(p))return p}if(l(f)&&l(f.index)){let p=t(f.index,f);if(l(p))return p}if(l(h)&&l(h.index)){let p=t(h.index,h);if(l(p))return p}}}let o=ze.materialValue(e,function(r){if(l(r.index)){let a=t(r.index,r);if(l(a))return a}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,a=t(r.index,r);if(l(a))return a}if(l(e.normalTexture)){let r=e.normalTexture,a=t(r.index,r);if(l(a))return a}if(l(e.occlusionTexture)){let r=e.occlusionTexture,a=t(r.index,r);if(l(a))return a}}var LB=t8e;var Nce=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function n8e(e,t){return t=t??Nce,Nce.forEach(function(n){t.indexOf(n)>-1&&o8e(e,n)}),e}var i8e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function o8e(e,t){let n=i8e[t],i=e[n];if(l(i)){let o=0,r=Vm[t](e),a=i.length;for(let s=0;s<a;++s)r[s]||(Gm[t](e,s-o),o++)}}function Gm(){}Gm.accessor=function(e,t){e.accessors.splice(t,1),ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){ze.meshPrimitiveAttribute(o,function(s,c){s>t&&o.attributes[c]--}),ze.meshPrimitiveTarget(o,function(s){ze.meshPrimitiveTargetAttribute(s,function(c,u){c>t&&s[u]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let a=o.extensions;l(a)&&l(a.CESIUM_primitive_outline)&&a.CESIUM_primitive_outline.indices>t&&--a.CESIUM_primitive_outline.indices})}),ze.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ze.animation(e,function(i){ze.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Gm.buffer=function(e,t){e.buffers.splice(t,1),ze.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--,l(i.extensions)&&l(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Gm.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ze.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ze.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ze.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),zr(e,"KHR_draco_mesh_compression")&&ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),zr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let s=o[r].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(zr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let c=o[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Gm.image=function(e,t){e.images.splice(t,1),ze.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Gm.mesh=function(e,t){e.meshes.splice(t,1),ze.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Gm.node=function(e,t){e.nodes.splice(t,1),ze.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),ze.animation(e,function(i){ze.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),ze.technique(e,function(i){ze.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),ze.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),ze.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Gm.material=function(e,t){e.materials.splice(t,1),ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Gm.sampler=function(e,t){e.samplers.splice(t,1),ze.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Gm.texture=function(e,t){if(e.textures.splice(t,1),ze.material(e,function(i){LB(i,function(o,r){r.index>t&&--r.index})}),zr(e,"EXT_feature_metadata")){ze.mesh(e,function(r){ze.meshPrimitive(r,function(a){let s=a.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let u=s.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let h=0;h<f;++h){let A=u[h].featureIds.texture;A.index>t&&--A.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let s=o[r].properties;if(l(s)){for(let c in s)if(s.hasOwnProperty(c)){let f=s[c].texture;f.index>t&&--f.index}}}}if(zr(e,"EXT_mesh_features")&&ze.mesh(e,function(i){ze.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let c=s.length;for(let u=0;u<c;++u){let f=s[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),zr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let c=o[a].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Vm(){}Vm.accessor=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){ze.meshPrimitiveAttribute(i,function(r){t[r]=!0}),ze.meshPrimitiveTarget(i,function(r){ze.meshPrimitiveTargetAttribute(r,function(a){t[a]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),ze.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ze.animation(e,function(n){ze.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),zr(e,"EXT_mesh_gpu_instancing")&&ze.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),zr(e,"CESIUM_primitive_outline")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let a=o.CESIUM_primitive_outline.indices;l(a)&&(t[a]=!0)}})}),t};Vm.buffer=function(e){let t={};return ze.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0),l(n.extensions)&&l(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Vm.bufferView=function(e){let t={};if(ze.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ze.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ze.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),zr(e,"KHR_draco_mesh_compression")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),zr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let a=i[o].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let c=a[s];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(zr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let s=i[r].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Vm.image=function(e){let t={};return ze.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Vm.mesh=function(e){let t={};return ze.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Lce(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!Lce(e,o,n)}).length===0}Vm.node=function(e){let t={};return ze.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ze.skinJoint(n,function(i){t[i]=!0})}),ze.animation(e,function(n){ze.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ze.technique(e,function(n){ze.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ze.node(e,function(n,i){Lce(e,i,t)||(t[i]=!0)}),t};Vm.material=function(e){let t={};return ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Vm.texture=function(e){let t={};if(ze.material(e,function(n){LB(n,function(i){t[i]=!0})}),zr(e,"EXT_feature_metadata")){ze.mesh(e,function(o){ze.meshPrimitive(o,function(r){let a=r.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let c=a.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let a=i[o].properties;if(l(a)){for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].texture;t[u.index]=!0}}}}if(zr(e,"EXT_mesh_features")&&ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let s=a.length;for(let c=0;c<s;++c){let u=a[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),zr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let o=i.length;for(let r=0;r<o;++r){let s=i[r].properties;for(let c in s)if(s.hasOwnProperty(c)){let u=s[c];t[u.index]=!0}}}}return t};Vm.sampler=function(e){let t={};return ze.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var zF=n8e;function r8e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:xs(e.buffers,n),byteOffset:0,byteLength:t.length};return xs(e.bufferViews,o)}var GF=r8e;function a8e(e,t){let n=Ku(e,t),i=j.getSizeInBytes(t.componentType),o=Jf(t.type),r=t.count,a=new Array(o*r);if(!l(t.bufferView))return a.fill(0);let s=e.bufferViews[t.bufferView],c=e.buffers[s.buffer].extras._pipeline.source,u=t.byteOffset+s.byteOffset+c.byteOffset,f=new DataView(c.buffer),h=new Array(o),p=I_(t.componentType);for(let A=0;A<r;++A){p(f,u,o,i,h);for(let m=0;m<o;++m)a[A*o+m]=h[m];u+=n}return a}var VF=a8e;function s8e(e){let t;return ze.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?HF(e,i,j.UNSIGNED_BYTE):t!==ee.UNSIGNED_BYTE&&t!==ee.UNSIGNED_SHORT&&HF(e,i,j.UNSIGNED_SHORT)}),ze.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ee.BYTE?HF(e,i,j.UNSIGNED_BYTE):t===ee.SHORT&&HF(e,i,j.UNSIGNED_SHORT)}),e}function HF(e,t,n){let i=j.createTypedArray(n,VF(e,t)),o=new Uint8Array(i.buffer);t.bufferView=GF(e,o),t.componentType=n,t.byteOffset=0}var WF=s8e;function c8e(e,t){return vb(e,t),t==="CESIUM_RTC"&&l8e(e),q6(e,t)}function l8e(e){ze.technique(e,function(t){ze.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function q6(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)q6(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&q6(e[o],t);return i}}var Mb=c8e;var jF={.8:p8e,"1.0":O8e,"2.0":void 0};function u8e(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(jF,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(jF,i)||(i="1.0"));let o=jF[i];for(;l(o)&&i!==n;)o(e,t),i=e.asset.version,o=jF[i];return t.keepLegacyExtensions||(k8e(e,t),U8e(e)),e}function Qce(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;l(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function f8e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(l(o)){let r=o.length;for(let a=0;a<r;++a){let s=o[a],c=s.primitive??ee.TRIANGLES;s.mode=s.mode??c,delete s.primitive}}}}function d8e(e){let t=e.nodes,n=new d,i=new Qe;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(l(r.rotation)){let s=r.rotation;d.fromArray(s,0,n),Qe.fromAxisAngle(n,s[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let a=r.instanceSkin;l(a)&&(r.skeletons=a.skeletons,r.skin=a.skin,r.meshes=a.meshes,delete r.instanceSkin)}}function h8e(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},a=new d,s=new Qe;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,h=u.parameters,p=u.samplers;if(l(f)){let A=f.length;for(let m=0;m<A;++m){let _=f[m];if(_.target.path==="rotation"){let y=h[p[_.sampler].output];if(l(r[y]))continue;r[y]=!0;let C=n[y],E=i[C.bufferView],x=o[E.buffer].extras._pipeline.source,S=x.byteOffset+E.byteOffset+C.byteOffset,w=C.componentType,v=C.count,R=Jf(C.type),N=C.count*R,L=j.createArrayBufferView(w,x.buffer,S,N);for(let g=0;g<v;g++){let b=g*R;d.unpack(L,b,a);let T=L[b+3];Qe.fromAxisAngle(a,T,s),Qe.pack(s,L,b)}}}}}}function m8e(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(l(o)){let r=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let a=o[r],s=a.instanceProgram;i.attributes=i.attributes??s.attributes,i.program=i.program??s.program,i.uniforms=i.uniforms??s.uniforms,i.states=i.states??a.states}delete i.passes,delete i.pass}}}function p8e(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Qce(e),f8e(e),d8e(e),h8e(e),m8e(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,hh(e,"KHR_materials_common")}}function A8e(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(l(o)){let r=i.samplers;for(let a in r)if(Object.prototype.hasOwnProperty.call(r,a)){let s=r[a];s.input=o[s.input],s.output=o[s.output]}delete i.parameters}}}function Oce(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),l(o.name)||(o.name=i)}return n}function g8e(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 a in r)Object.prototype.hasOwnProperty.call(r,a)&&(i=r[a].jointName,l(i)&&(o[i]=a));for(let a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&l(n[a])){let s={},c=e[a];e[a]=Oce(c,s),n[a]=s}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),ze.bufferView(e,function(a){l(a.buffer)&&(a.buffer=n.buffers[a.buffer])}),ze.accessor(e,function(a){l(a.bufferView)&&(a.bufferView=n.bufferViews[a.bufferView])}),ze.shader(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),ze.program(e,function(a){l(a.vertexShader)&&(a.vertexShader=n.shaders[a.vertexShader]),l(a.fragmentShader)&&(a.fragmentShader=n.shaders[a.fragmentShader])}),ze.technique(e,function(a){l(a.program)&&(a.program=n.programs[a.program]),ze.techniqueParameter(a,function(s){l(s.node)&&(s.node=n.nodes[s.node]);let c=s.value;typeof c=="string"&&(s.value={index:n.textures[c]})})}),ze.mesh(e,function(a){ze.meshPrimitive(a,function(s){l(s.indices)&&(s.indices=n.accessors[s.indices]),ze.meshPrimitiveAttribute(s,function(c,u){s.attributes[u]=n.accessors[c]}),l(s.material)&&(s.material=n.materials[s.material])})}),ze.node(e,function(a){let s=a.children;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}if(l(a.meshes)){let c=a.meshes,u=c.length;if(u>0)for(a.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},h=xs(e.nodes,f);l(s)||(s=[],a.children=s),s.push(h)}delete a.meshes}if(l(a.camera)&&(a.camera=n.cameras[a.camera]),l(a.skin)&&(a.skin=n.skins[a.skin]),l(a.skeletons)){let c=a.skeletons;if(c.length>0&&l(a.skin)){let f=e.skins[a.skin];f.skeleton=n.nodes[c[0]]}delete a.skeletons}l(a.jointName)&&delete a.jointName}),ze.skin(e,function(a){l(a.inverseBindMatrices)&&(a.inverseBindMatrices=n.accessors[a.inverseBindMatrices]);let s=a.jointNames;if(l(s)){let c=[],u=s.length;for(t=0;t<u;++t)c[t]=o[s[t]];a.joints=c,delete a.jointNames}}),ze.scene(e,function(a){let s=a.nodes;if(l(s)){let c=s.length;for(t=0;t<c;++t)s[t]=n.nodes[s[t]]}}),ze.animation(e,function(a){let s={};a.samplers=Oce(a.samplers,s),ze.animationSampler(a,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),ze.animationChannel(a,function(c){c.sampler=s[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),ze.material(e,function(a){l(a.technique)&&(a.technique=n.techniques[a.technique]),ze.materialValue(a,function(c,u){typeof c=="string"&&(a.values[u]={index:n.textures[c]})});let s=a.extensions;if(l(s)){let c=s.KHR_materials_common;l(c)&&l(c.values)&&ze.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),ze.image(e,function(a){let s=a.extensions;if(l(s)){let c=s.KHR_binary_glTF;l(c)&&(a.bufferView=n.bufferViews[c.bufferView],a.mimeType=c.mimeType,delete s.KHR_binary_glTF),Object.keys(s).length===0&&delete a.extensions}}),ze.texture(e,function(a){l(a.sampler)&&(a.sampler=n.samplers[a.sampler]),l(a.source)&&(a.source=n.images[a.source])})}function _8e(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){delete n.name})})}function y8e(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]}ze.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function C8e(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var E8e={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function I8e(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];l(E8e[o])&&e.extensionsRequired.push(o)}}}function b8e(e){ze.buffer(e,function(t){delete t.type})}function x8e(e){ze.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function T8e(e){ze.mesh(e,function(t){ze.meshPrimitive(t,function(n){ze.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})}),ze.technique(e,function(t){ze.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var S8e={POSITION:!0,NORMAL:!0,TANGENT:!0},w8e={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function B8e(e){let t={};ze.mesh(e,function(n){ze.meshPrimitive(n,function(i){ze.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let a=r.search(/_[0-9]+/g),s=r,c="_0";a>=0&&(s=r.substring(0,a),c=r.substring(a));let u,f=w8e[s];l(f)?(u=f+c,t[r]=u):l(S8e[s])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],a=i.attributes[o];l(a)&&(delete i.attributes[o],i.attributes[r]=a)}})}),ze.technique(e,function(n){ze.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function D8e(e){ze.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function X6(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Ku(e,t)}function v8e(e){ze.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ze.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=X6(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function P8e(e){let t,n,i,o=e.bufferViews,r={};ze.accessorContainingVertexAttributeData(e,function(s){let c=e.accessors[s];l(c.bufferView)&&(r[c.bufferView]=!0)});let a={};ze.accessor(e,function(s){l(s.bufferView)&&(a[s.bufferView]=a[s.bufferView]??[],a[s.bufferView].push(s))});for(let s in a)if(Object.prototype.hasOwnProperty.call(a,s)){i=o[s];let c=a[s];c.sort(function(p,A){return p.byteOffset-A.byteOffset});let u=0,f=0,h=c.length;for(t=0;t<h;++t){let p=c[t],A=X6(e,p),m=p.byteOffset,_=p.count*A;delete p.byteStride;let y=t<h-1,C=y?X6(e,c[t+1]):void 0;if(A!==C){let E=Ye(i,!0);r[s]&&(E.byteStride=A),E.byteOffset+=u,E.byteLength=m+_-u;let I=xs(o,E);for(n=f;n<=t;++n)p=c[n],p.bufferView=I,p.byteOffset=p.byteOffset-u;u=y?c[t+1].byteOffset:void 0,f=t+1}}}zF(e,["accessor","bufferView","buffer"])}function R8e(e){ze.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Rb(e,n);n.min=i.min,n.max=i.max}})}function kce(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||d.fromArray(e.translation).equals(d.ZERO))&&(!l(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!l(e.rotation)||ie.fromArray(e.rotation).equals(new ie(0,0,0,1)))&&(!l(e.matrix)||P.fromColumnMajorArray(e.matrix).equals(P.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Uce(e,t){ze.scene(e,function(n){let i=n.nodes;if(l(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),ze.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),kce(n)&&Uce(e,i))}}),delete e.nodes[t]}function M8e(e){return ze.node(e,function(t,n){kce(t)&&Uce(e,n)}),e}function N8e(e){ze.animation(e,function(t){ze.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=Rb(e,i);i.min=o.min,i.max=o.max}})})}function L8e(e){ze.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Rb(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function O8e(e){e.asset=e.asset??{},e.asset.version="2.0",Qce(e),A8e(e),M8e(e),g8e(e),_8e(e),C8e(e),I8e(e),v8e(e),P8e(e),R8e(e),N8e(e),L8e(e),b8e(e),x8e(e),T8e(e),B8e(e),WF(e),D8e(e),QF(e),UF(e),y8e(e)}var F8e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Q8e=["u_diffuse","u_diffuse_mat"];function J6(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function Z6(e){return l(e.index)}function $6(e){return Array.isArray(e)&&e.length===4}function zce(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 k8e(e,t){t=t??{};let n=t.baseColorTextureNames??F8e,i=t.baseColorFactorNames??Q8e;ze.material(e,function(o){ze.materialValue(o,function(r,a){n.indexOf(a)!==-1&&Z6(r)?(J6(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(a)!==-1&&$6(r)&&(J6(o),o.pbrMetallicRoughness.baseColorFactor=zce(r))})}),Mb(e,"KHR_techniques_webgl"),Mb(e,"KHR_blend")}function K6(e,t){l(t)&&($6(t)?e.pbrMetallicRoughness.baseColorFactor=zce(t):Z6(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Fce(e,t){l(t)&&($6(t)?e.emissiveFactor=t.slice(0,3):Z6(t)&&(e.emissiveTexture=t))}function U8e(e){ze.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,a=i.emission,s=i.transparency,c=n.doubleSided,u=n.transparent;J6(t),n.technique==="CONSTANT"?(hh(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},K6(t,a),K6(t,o)):(K6(t,r),Fce(t,o),Fce(t,a)),l(c)&&(t.doubleSided=c),l(s)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=s:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,s]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),Mb(e,"KHR_materials_common")}var YF=u8e;function zc(){}zc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=`
|
|
${n.message}`);let o=new ue(i);return l(n)&&(o.stack=`Original stack:
|
|
${n.stack}
|
|
Handler stack:
|
|
${o.stack}`),o};zc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:P.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:d.ZERO,l(e.rotation)?e.rotation:Qe.IDENTITY,l(e.scale)?e.scale:d.ONE)};zc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let a=i[r],s=l(n)?a.setIndex===n:!0;if(a.semantic===t&&s)return a}};zc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};zc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};zc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};zc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;l(t)?(i=at.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),a=e.type,s=zt.getGlslType(a);r&&(s="vec4");let c=l(e.quantization),u;return c&&(u=r?"vec4":zt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:o,glslType:s,quantizedGlslType:u}};var z8e=new d,G8e=new d;zc.getPositionMinMax=function(e,t,n){let i=zc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return l(n)&&l(t)&&(r=d.add(r,t,G8e),o=d.add(o,n,z8e)),{min:r,max:o}};zc.getAxisCorrectionMatrix=function(e,t,n){return n=P.clone(P.IDENTITY,n),e===so.Y?n=P.clone(so.Y_UP_TO_Z_UP,n):e===so.X&&(n=P.clone(so.X_UP_TO_Z_UP,n)),t===so.Z&&(n=P.multiplyTransformation(n,so.Z_UP_TO_X_UP,n)),n};var V8e=new J;zc.getCullFace=function(e,t){if(!Pe.isTriangles(t))return Li.BACK;let n=P.getMatrix3(e,V8e);return J.determinant(n)<0?Li.FRONT:Li.BACK};zc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};zc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};zc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!zc.supportedExtensions[i])throw new ue(`Unsupported glTF Extension: ${i}`)}};var Tt=zc;var eY=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,o=t.baseResource,r=t.typedArray,a=t.gltfJson,s=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=o,this._typedArray=r,this._gltfJson=a,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,l(this._gltfJson)?(this._promise=Gce(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Vce(this,this._typedArray),this._promise):(this._promise=H8e(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function H8e(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;tY(e,n)}return Vce(e,t)}function tY(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function W8e(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!zr(t,"KHR_techniques_webgl")&&!zr(t,"KHR_materials_common"))return Promise.resolve();let n=[];ze.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),a=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(a),n.push(a.load().then(function(){a.isDestroyed()||(i.extras._pipeline.source=a.typedArray)}))}}),await Promise.all(n),YF(t)}function j8e(e){let t=[];return ze.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Am(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function Y8e(e,t){let n=[];return ze.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(l(r)&&!l(i.uri)){let s=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(s),n.push(s.load())}}),Promise.all(n)}async function Gce(e,t){try{fE(t),await j8e(t),await W8e(e,t),MF(t),await Y8e(e,t),FF(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new ue(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&Tt.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;tY(e,n)}}async function Vce(e,t){let n;try{km(t)==="glTF"?n=Pb(t):n=Pr(t)}catch(i){if(e.isDestroyed())return;tY(e,i)}return Gce(e,n)}var OB=eY;var q8e={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},bA=Object.freeze(q8e);var Po={},nY=class{constructor(){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}},iY=class{constructor(){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}},oY=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},rY=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},aY=class{constructor(){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}},sY=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},cY=class{constructor(){this.attributes=[]}},lY=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},uY=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},fY=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},dY=class{constructor(){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,this.meshVector=void 0}},hY=class{constructor(){this.nodes=[]}},K8e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},mY=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},pY=class{constructor(){this.node=void 0,this.path=void 0}},AY=class{constructor(){this.sampler=void 0,this.target=void 0}},gY=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},_Y=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},yY=class{constructor(){this.name=void 0,this.stages=[]}},qF=class{constructor(){this.credits=[]}},CY=class{constructor(){this.asset=new qF,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=P.clone(P.IDENTITY),this.extensions={}}},EY=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=J.clone(J.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},b_=class b_{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=ie.clone(b_.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=b_.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=b_.DEFAULT_ROUGHNESS_FACTOR}};vn(b_,"DEFAULT_BASE_COLOR_FACTOR",ie.ONE),vn(b_,"DEFAULT_METALLIC_FACTOR",1),vn(b_,"DEFAULT_ROUGHNESS_FACTOR",1);var KF=b_,x_=class x_{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=ie.clone(x_.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(x_.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=x_.DEFAULT_GLOSSINESS_FACTOR}};vn(x_,"DEFAULT_DIFFUSE_FACTOR",ie.ONE),vn(x_,"DEFAULT_SPECULAR_FACTOR",d.ONE),vn(x_,"DEFAULT_GLOSSINESS_FACTOR",1);var IY=x_,Nb=class Nb{constructor(){this.specularFactor=Nb.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(Nb.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};vn(Nb,"DEFAULT_SPECULAR_FACTOR",1),vn(Nb,"DEFAULT_SPECULAR_COLOR_FACTOR",d.ONE);var bY=Nb,Lb=class Lb{constructor(){this.anisotropyStrength=Lb.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=Lb.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};vn(Lb,"DEFAULT_ANISOTROPY_STRENGTH",0),vn(Lb,"DEFAULT_ANISOTROPY_ROTATION",0);var xY=Lb,Ob=class Ob{constructor(){this.clearcoatFactor=Ob.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=Ob.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};vn(Ob,"DEFAULT_CLEARCOAT_FACTOR",0),vn(Ob,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var TY=Ob,SY=class{constructor(){vn(this,"width");vn(this,"pattern")}},XF=class XF{constructor(){this.metallicRoughness=new KF,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=d.clone(XF.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=bA.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.lineStyle=void 0}};vn(XF,"DEFAULT_EMISSIVE_FACTOR",d.ZERO);var wY=XF,BY=class{constructor(){vn(this,"vector",!0);vn(this,"count",0);vn(this,"polygonAttributeOffsets");vn(this,"polygonHoleCounts");vn(this,"polygonHoleOffsets");vn(this,"polygonIndicesOffsets")}};Po.Quantization=nY;Po.Attribute=iY;Po.Indices=oY;Po.FeatureIdAttribute=rY;Po.FeatureIdTexture=sY;Po.FeatureIdImplicitRange=aY;Po.MorphTarget=cY;Po.Primitive=lY;Po.Instances=uY;Po.Skin=fY;Po.Node=dY;Po.Scene=hY;Po.AnimatedPropertyType=Object.freeze(K8e);Po.AnimationSampler=mY;Po.AnimationTarget=pY;Po.AnimationChannel=AY;Po.Animation=gY;Po.ArticulationStage=_Y;Po.Articulation=yY;Po.Asset=qF;Po.Components=CY;Po.TextureReader=EY;Po.MetallicRoughness=KF;Po.SpecularGlossiness=IY;Po.Specular=bY;Po.Anisotropy=xY;Po.Clearcoat=TY;Po.LineStyle=SY;Po.Material=wY;Po.Vector=BY;var bn=Po;var JF={};JF.getImageIdFromTexture=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,o=t.textures[n],r=o.extensions;if(l(r)){if(i.webp&&l(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&l(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};JF.createSampler=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,o=pn.REPEAT,r=pn.REPEAT,a=Wt.LINEAR,s=si.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let h=t.samplers[f];o=h.wrapS??o,r=h.wrapT??r,a=h.minFilter??a,s=h.magFilter??s}return i&&a!==Wt.LINEAR&&a!==Wt.NEAREST&&(a===Wt.NEAREST_MIPMAP_NEAREST||a===Wt.NEAREST_MIPMAP_LINEAR?a=Wt.NEAREST:a=Wt.LINEAR),new jt({wrapS:o,wrapT:r,minificationFilter:a,magnificationFilter:s})};var X8e=new Q(1,1);JF.createModelTextureReader=function(e){e=e??V.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,o=t.texCoord??0,r,a=t.extensions?.KHR_texture_transform;if(l(a)){o=a.texCoord??o;let u=l(a.offset)?Q.unpack(a.offset):Q.ZERO,f=a.rotation??0,h=l(a.scale)?Q.unpack(a.scale):X8e;f=-f,r=new J(Math.cos(f)*h.x,-Math.sin(f)*h.y,u.x,Math.sin(f)*h.x,Math.cos(f)*h.y,u.y,0,0,1)}let s=new bn.TextureReader;s.index=t.index,s.texture=i,s.texCoord=o,s.scale=t.scale,s.transform=r,s.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(s.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?Q.unpack(c.offset):Q.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),s};var Xu=JF;function J8e(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var dE=J8e;var DY=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.textureInfo,r=t.gltfResource,a=t.baseResource,s=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=o.index,h=Xu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:s});this._resourceCache=n,this._gltf=i,this._textureInfo=o,this._imageId=h,this._gltfResource=r,this._baseResource=a,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=$8e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=gt.PROCESSING;let n;if(this._asynchronous){let i=Z8e;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Uc.TEXTURE))return!1;n=i.texture}else n=Hce(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0}},vY=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,o,r,a){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=o,this.mipLevels=r,this.context=a}execute(){this.texture=Hce(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function Hce(e,t,n,i,o,r){let a=i.internalFormat,s=!1;Ke.isCompressedFormat(a)&&!l(o)&&(s=!0);let c=Xu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:s}),u=c.minificationFilter,f=c.wrapS,h=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,A=!l(a)&&p,m=A||f===pn.REPEAT||f===pn.MIRRORED_REPEAT||h===pn.REPEAT||h===pn.MIRRORED_REPEAT,_=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),y=m&&_,C;return l(a)?(!r.webgl2&&Ke.isCompressedFormat(a)&&_&&m&&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."),C=vt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(y&&(i=dE(i)),C=vt.create({id:n,context:r,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),A&&C.generateMipmap(),C}var Z8e=new vY;async function $8e(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=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}var FB=DY;var PY=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.gltfResource,r=t.baseResource,a=t.bufferViewId,s=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,h=t.cacheKey,p=t.spz,A=t.asynchronous??!0,m=t.loadBuffer??!1,_=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=o,this._baseResource=r,this._gltf=i,this._bufferViewId=a,this._primitive=s,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=h,this._asynchronous=A,this._loadBuffer=m,this._loadTypedArray=_,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=nHe(this),this._promise):eHe(this._draco,this._attributeSemantic)?(this._promise=aHe(this),this._promise):(this._promise=cHe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(o){ZF(this,o)}sHe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(o){ZF(this,o)}rHe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let o=lHe;if(o.set(i,t.context),!t.jobScheduler.execute(o,Uc.BUFFER))return!1;n=o.buffer}else this._loadBuffer&&(n=Wce(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function eHe(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function tHe(e,t,n,i){let r=(1<<e.quantizationBits)-1,a=1/r,s=new bn.Quantization;if(s.componentDatatype=t,s.octEncoded=e.octEncoded,s.octEncodedZXY=!0,s.type=i,s.octEncoded)s.type=zt.VEC2,s.normalizationRange=r;else{let c=zt.getMathType(i);if(c===Number){let u=e.range;s.quantizedVolumeOffset=e.minValues[0],s.quantizedVolumeDimensions=u,s.normalizationRange=r,s.quantizedVolumeStepSize=u*a}else{s.quantizedVolumeOffset=c.unpack(e.minValues),s.normalizationRange=c.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);s.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(h){return h*a});s.quantizedVolumeStepSize=c.unpack(f)}}return s}async function nHe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return}}function iHe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function oHe(e){let t=iHe(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),a=parseInt(e.slice(o+n.length),10);return{l:r,n:a}}function rHe(e){e._state=gt.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,o=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let r=0;r<i.length/3;r++)e._typedArray[r*4]=D.clamp(i[r*3]*255,0,255),e._typedArray[r*4+1]=D.clamp(i[r*3+1]*255,0,255),e._typedArray[r*4+2]=D.clamp(i[r*3+2]*255,0,255),e._typedArray[r*4+3]=D.clamp(o[r]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:o}=oHe(e._attributeSemantic),r=n.shDegree,a=0,s=[0,9,24];switch(r){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let h=f*a+s[i-1]+o*3;e._typedArray[f*3]=u[h],e._typedArray[f*3+1]=u[h+1],e._typedArray[f*3+2]=u[h+2]}}}async function aHe(e){e._state=gt.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=gt.LOADED,e)}catch{if(e.isDestroyed())return;ZF(e)}}function sHe(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,s=e._gltf.accessors[r].type,c=o.array,u=o.data.quantization;l(u)&&(e._quantization=tHe(u,o.data.componentDatatype,o.data.componentsPerAttribute,s)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function cHe(e){e._state=gt.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=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;ZF(e,n)}}function ZF(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}var RY=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Wce(this.typedArray,this.context)}};function Wce(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Re.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var lHe=new RY,QB=PY;async function uHe(e={}){var t,n,i=e,o=typeof window=="object",r=typeof WorkerGlobalScope<"u",a=typeof process=="object"&&((t=process.versions)==null?void 0:t.node)&&process.type!="renderer";if(a){let{createRequire:ae}=await Promise.resolve().then(()=>pHe);var s=ae(import.meta.url)}var c="./this.program",u=import.meta.url,f;if(a){var h=s("fs");u.startsWith("file:")&&s("path").dirname(s("url").fileURLToPath(u)),f=ae=>(ae=y(ae)?new URL(ae):ae,h.readFileSync(ae)),1<process.argv.length&&(c=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2)}else if(o||r){try{new URL(".",u)}catch{}r&&(f=ae=>{var ne=new XMLHttpRequest;return ne.open("GET",ae,!1),ne.responseType="arraybuffer",ne.send(null),new Uint8Array(ne.response)})}var p=console.log.bind(console),A=console.error.bind(console),m,_=!1,y=ae=>ae.startsWith("file://"),C,E,I,x,S,w,v,R,N,L,g,b,T,B=!1;function M(){var ae=I.buffer;x=new Int8Array(ae),w=new Int16Array(ae),i.HEAPU8=S=new Uint8Array(ae),v=new Uint16Array(ae),R=new Int32Array(ae),N=new Uint32Array(ae),i.HEAPF32=L=new Float32Array(ae),g=new Float64Array(ae),b=new BigInt64Array(ae),T=new BigUint64Array(ae)}var O=0,G=null;function k(ae){var ne;throw(ne=i.onAbort)==null||ne.call(i,ae),ae="Aborted("+ae+")",A(ae),_=!0,ae=new WebAssembly.RuntimeError(ae+". Build with -sASSERTIONS for more info."),E?.(ae),ae}var z;async function F(ae){if(!ArrayBuffer.isView(ae))if(ae==z&&m)ae=new Uint8Array(m);else if(f)ae=f(ae);else throw"both async and sync fetching of the wasm failed";return ae}async function H(ae){var ne=z;try{var Ie=await F(ne);return await WebAssembly.instantiate(Ie,ae)}catch(Te){A(`failed to asynchronously prepare wasm: ${Te}`),k(Te)}}async function Y(ae){return H(ae)}var $=ae=>{for(;0<ae.length;)ae.shift()(i)},W=[],K=[],Z=()=>{var ae=i.preRun.shift();K.push(ae)},pe=ae=>{if(a)return ae=Buffer.from(ae,"base64"),new Uint8Array(ae.buffer,ae.byteOffset,ae.length);for(var ne,Ie,Te=0,qe=0,xt=ae.length,ht=new Uint8Array((3*xt>>2)-(ae[xt-2]=="=")-(ae[xt-1]=="="));Te<xt;Te+=4,qe+=3)ne=Jp[ae.charCodeAt(Te+1)],Ie=Jp[ae.charCodeAt(Te+2)],ht[qe]=Jp[ae.charCodeAt(Te)]<<2|ne>>4,ht[qe+1]=ne<<4|Ie>>2,ht[qe+2]=Ie<<6|Jp[ae.charCodeAt(Te+3)];return ht},ge={},re=ae=>{for(;ae.length;){var ne=ae.pop();ae.pop()(ne)}};function ye(ae){return this.N(N[ae>>2])}var Ce={},ve={},Ne={},Le=class extends Error{constructor(ae){super(ae),this.name="InternalError"}},Oe=(ae,ne,Ie)=>{function Te(Dt){if(Dt=Ie(Dt),Dt.length!==ae.length)throw new Le("Mismatched type converter count");for(var Sn=0;Sn<ae.length;++Sn)je(ae[Sn],Dt[Sn])}ae.forEach(Dt=>Ne[Dt]=ne);var qe=Array(ne.length),xt=[],ht=0;ne.forEach((Dt,Sn)=>{ve.hasOwnProperty(Dt)?qe[Sn]=ve[Dt]:(xt.push(Dt),Ce.hasOwnProperty(Dt)||(Ce[Dt]=[]),Ce[Dt].push(()=>{qe[Sn]=ve[Dt],++ht,ht===xt.length&&Te(qe)}))}),xt.length===0&&Te(qe)},nt=ae=>{for(var ne="";;){var Ie=S[ae++];if(!Ie)return ne;ne+=String.fromCharCode(Ie)}},Fe=class extends Error{constructor(ae){super(ae),this.name="BindingError"}},_t=ae=>{throw new Fe(ae)};function rt(ae,ne,Ie={}){var Te=ne.name;if(!ae)throw new Fe(`type "${Te}" must have a positive integer typeid pointer`);if(ve.hasOwnProperty(ae)){if(Ie.wa)return;throw new Fe(`Cannot register type '${Te}' twice`)}ve[ae]=ne,delete Ne[ae],Ce.hasOwnProperty(ae)&&(ne=Ce[ae],delete Ce[ae],ne.forEach(qe=>qe()))}function je(ae,ne,Ie={}){return rt(ae,ne,Ie)}var st=(ae,ne,Ie)=>{switch(ne){case 1:return Ie?Te=>x[Te]:Te=>S[Te];case 2:return Ie?Te=>w[Te>>1]:Te=>v[Te>>1];case 4:return Ie?Te=>R[Te>>2]:Te=>N[Te>>2];case 8:return Ie?Te=>b[Te>>3]:Te=>T[Te>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ae}`)}},ft=ae=>{throw new Fe(ae.L.P.M.name+" instance already deleted")},St=!1,be=()=>{},Se=ae=>typeof FinalizationRegistry>"u"?(Se=ne=>ne,ae):(St=new FinalizationRegistry(ne=>{ne=ne.L,--ne.count.value,ne.count.value===0&&(ne.S?ne.W.Y(ne.S):ne.P.M.Y(ne.O))}),Se=ne=>{var Ie=ne.L;return Ie.S&&St.register(ne,{L:Ie},ne),ne},be=ne=>{St.unregister(ne)},Se(ae));function qt(){}var mt=(ae,ne)=>Object.defineProperty(ne,"name",{value:ae}),Ut={},Gn=(ae,ne,Ie)=>{if(ae[ne].R===void 0){var Te=ae[ne];ae[ne]=function(...qe){if(!ae[ne].R.hasOwnProperty(qe.length))throw new Fe(`Function '${Ie}' called with an invalid number of arguments (${qe.length}) - expects one of (${ae[ne].R})!`);return ae[ne].R[qe.length].apply(this,qe)},ae[ne].R=[],ae[ne].R[Te.aa]=Te}},Xe=(ae,ne,Ie)=>{if(i.hasOwnProperty(ae)){if(Ie===void 0||i[ae].R!==void 0&&i[ae].R[Ie]!==void 0)throw new Fe(`Cannot register public name '${ae}' twice`);if(Gn(i,ae,ae),i[ae].R.hasOwnProperty(Ie))throw new Fe(`Cannot register multiple overloads of a function with the same number of arguments (${Ie})!`);i[ae].R[Ie]=ne}else i[ae]=ne,i[ae].aa=Ie},ro=ae=>{ae=ae.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ae.charCodeAt(0);return 48<=ne&&57>=ne?`_${ae}`:ae};function Vt(ae,ne,Ie,Te,qe,xt,ht,Dt){this.name=ae,this.constructor=ne,this.$=Ie,this.Y=Te,this.U=qe,this.ra=xt,this.ea=ht,this.pa=Dt,this.ya=[]}var Do=(ae,ne,Ie)=>{for(;ne!==Ie;){if(!ne.ea)throw new Fe(`Expected null or instance of ${Ie.name}, got an instance of ${ne.name}`);ae=ne.ea(ae),ne=ne.U}return ae},ji=ae=>{if(ae===null)return"null";var ne=typeof ae;return ne==="object"||ne==="array"||ne==="function"?ae.toString():""+ae};function Mi(ae,ne){if(ne===null){if(this.ha)throw new Fe(`null is not a valid ${this.name}`);return 0}if(!ne.L)throw new Fe(`Cannot pass "${ji(ne)}" as a ${this.name}`);if(!ne.L.O)throw new Fe(`Cannot pass deleted object as a pointer of type ${this.name}`);return Do(ne.L.O,ne.L.P.M,this.M)}function zo(ae,ne){if(ne===null){if(this.ha)throw new Fe(`null is not a valid ${this.name}`);if(this.ga){var Ie=this.ia();return ae!==null&&ae.push(this.Y,Ie),Ie}return 0}if(!ne||!ne.L)throw new Fe(`Cannot pass "${ji(ne)}" as a ${this.name}`);if(!ne.L.O)throw new Fe(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.fa&&ne.L.P.fa)throw new Fe(`Cannot convert argument of type ${ne.L.W?ne.L.W.name:ne.L.P.name} to parameter type ${this.name}`);if(Ie=Do(ne.L.O,ne.L.P.M,this.M),this.ga){if(ne.L.S===void 0)throw new Fe("Passing raw pointer to smart pointer is illegal");switch(this.Da){case 0:if(ne.L.W===this)Ie=ne.L.S;else throw new Fe(`Cannot convert argument of type ${ne.L.W?ne.L.W.name:ne.L.P.name} to parameter type ${this.name}`);break;case 1:Ie=ne.L.S;break;case 2:if(ne.L.W===this)Ie=ne.L.S;else{var Te=ne.clone();Ie=this.za(Ie,Mu(()=>Te.delete())),ae!==null&&ae.push(this.Y,Ie)}break;default:throw new Fe("Unsupporting sharing policy")}}return Ie}function ii(ae,ne){if(ne===null){if(this.ha)throw new Fe(`null is not a valid ${this.name}`);return 0}if(!ne.L)throw new Fe(`Cannot pass "${ji(ne)}" as a ${this.name}`);if(!ne.L.O)throw new Fe(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.L.P.fa)throw new Fe(`Cannot convert argument of type ${ne.L.P.name} to parameter type ${this.name}`);return Do(ne.L.O,ne.L.P.M,this.M)}var qn=(ae,ne,Ie)=>ne===Ie?ae:Ie.U===void 0?null:(ae=qn(ae,ne,Ie.U),ae===null?null:Ie.pa(ae)),Yi={},vo=(ae,ne)=>{if(ne===void 0)throw new Fe("ptr should not be undefined");for(;ae.U;)ne=ae.ea(ne),ae=ae.U;return Yi[ne]},mo=(ae,ne)=>{if(!ne.P||!ne.O)throw new Le("makeClassHandle requires ptr and ptrType");if(!!ne.W!=!!ne.S)throw new Le("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},Se(Object.create(ae,{L:{value:ne,writable:!0}}))};function Xo(ae,ne,Ie,Te,qe,xt,ht,Dt,Sn,Wn,dn){this.name=ae,this.M=ne,this.ha=Ie,this.fa=Te,this.ga=qe,this.xa=xt,this.Da=ht,this.na=Dt,this.ia=Sn,this.za=Wn,this.Y=dn,qe||ne.U!==void 0?this.T=zo:(this.T=Te?Mi:ii,this.V=null)}var Go=(ae,ne,Ie)=>{if(!i.hasOwnProperty(ae))throw new Le("Replacing nonexistent public symbol");i[ae].R!==void 0&&Ie!==void 0?i[ae].R[Ie]=ne:(i[ae]=ne,i[ae].aa=Ie)},yn,Ei=(ae,ne)=>{ae=nt(ae);var Ie=yn.get(ne);if(typeof Ie!="function")throw new Fe(`unknown function pointer with signature ${ae}: ${ne}`);return Ie};class Nn extends Error{}var Vo=ae=>{ae=Hte(ae);var ne=nt(ae);return Ng(ae),ne},Ho=(ae,ne)=>{function Ie(xt){qe[xt]||ve[xt]||(Ne[xt]?Ne[xt].forEach(Ie):(Te.push(xt),qe[xt]=!0))}var Te=[],qe={};throw ne.forEach(Ie),new Nn(`${ae}: `+Te.map(Vo).join([", "]))},Xa=(ae,ne)=>{for(var Ie=[],Te=0;Te<ae;Te++)Ie.push(N[ne+4*Te>>2]);return Ie};function Ui(ae){for(var ne=1;ne<ae.length;++ne)if(ae[ne]!==null&&ae[ne].V===void 0)return!0;return!1}function Eo(ae,ne,Ie,Te,qe,xt){var ht=ne.length;if(2>ht)throw new Fe("argTypes array size mismatch! Must at least get return value and 'this' types!");var Dt=ne[1]!==null&&Ie!==null,Sn=Ui(ne);Ie=!ne[0].ma;var Wn=ne[0],dn=ne[1];for(Te=[ae,_t,Te,qe,re,Wn.N.bind(Wn),dn?.T.bind(dn)],qe=2;qe<ht;++qe)Wn=ne[qe],Te.push(Wn.T.bind(Wn));if(!Sn)for(qe=Dt?1:2;qe<ne.length;++qe)ne[qe].V!==null&&Te.push(ne[qe].V);for(Sn=Ui(ne),qe=ne.length-2,dn=[],Wn=["fn"],Dt&&Wn.push("thisWired"),ht=0;ht<qe;++ht)dn.push(`arg${ht}`),Wn.push(`arg${ht}Wired`);dn=dn.join(","),Wn=Wn.join(","),dn=`return function (${dn}) {
|
|
`,Sn&&(dn+=`var destructors = [];
|
|
`);var ma=Sn?"destructors":"null",Lu="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(Dt&&(dn+=`var thisWired = toClassParamWire(${ma}, this);
|
|
`),ht=0;ht<qe;++ht){var ol=`toArg${ht}Wire`;dn+=`var arg${ht}Wired = ${ol}(${ma}, arg${ht});
|
|
`,Lu.push(ol)}if(dn+=(Ie||xt?"var rv = ":"")+`invoker(${Wn});
|
|
`,Sn)dn+=`runDestructors(destructors);
|
|
`;else for(ht=Dt?1:2;ht<ne.length;++ht)xt=ht===1?"thisWired":"arg"+(ht-2)+"Wired",ne[ht].V!==null&&(dn+=`${xt}_dtor(${xt});
|
|
`,Lu.push(`${xt}_dtor`));return Ie&&(dn+=`var ret = fromRetWire(rv);
|
|
return ret;
|
|
`),ne=new Function(Lu,dn+`}
|
|
`)(...Te),mt(ae,ne)}for(var ps=ae=>{ae=ae.trim();let ne=ae.indexOf("(");return ne===-1?ae:ae.slice(0,ne)},da=[],wr=[0,1,,1,null,1,!0,1,!1,1],As=ae=>{9<ae&&--wr[ae+1]===0&&(wr[ae]=void 0,da.push(ae))},Ru=ae=>{if(!ae)throw new Fe(`Cannot use deleted val. handle = ${ae}`);return wr[ae]},Mu=ae=>{switch(ae){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=da.pop()||wr.length;return wr[ne]=ae,wr[ne+1]=1,ne}},Nu={name:"emscripten::val",N:ae=>{var ne=Ru(ae);return As(ae),ne},T:(ae,ne)=>Mu(ne),X:ye,V:null},Kd=(ae,ne,Ie)=>{switch(ne){case 1:return Ie?function(Te){return this.N(x[Te])}:function(Te){return this.N(S[Te])};case 2:return Ie?function(Te){return this.N(w[Te>>1])}:function(Te){return this.N(v[Te>>1])};case 4:return Ie?function(Te){return this.N(R[Te>>2])}:function(Te){return this.N(N[Te>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ae}`)}},Fs=(ae,ne)=>{var Ie=ve[ae];if(Ie===void 0)throw ae=`${ne} has unknown type ${Vo(ae)}`,new Fe(ae);return Ie},Pg=(ae,ne)=>{switch(ne){case 4:return function(Ie){return this.N(L[Ie>>2])};case 8:return function(Ie){return this.N(g[Ie>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ae}`)}},dm=Object.assign({optional:!0},Nu),pr=(ae,ne,Ie)=>{var Te=S;if(!(0<Ie))return 0;var qe=ne;Ie=ne+Ie-1;for(var xt=0;xt<ae.length;++xt){var ht=ae.codePointAt(xt);if(127>=ht){if(ne>=Ie)break;Te[ne++]=ht}else if(2047>=ht){if(ne+1>=Ie)break;Te[ne++]=192|ht>>6,Te[ne++]=128|ht&63}else if(65535>=ht){if(ne+2>=Ie)break;Te[ne++]=224|ht>>12,Te[ne++]=128|ht>>6&63,Te[ne++]=128|ht&63}else{if(ne+3>=Ie)break;Te[ne++]=240|ht>>18,Te[ne++]=128|ht>>12&63,Te[ne++]=128|ht>>6&63,Te[ne++]=128|ht&63,xt++}}return Te[ne]=0,ne-qe},Ja=ae=>{for(var ne=0,Ie=0;Ie<ae.length;++Ie){var Te=ae.charCodeAt(Ie);127>=Te?ne++:2047>=Te?ne+=2:55296<=Te&&57343>=Te?(ne+=4,++Ie):ne+=3}return ne},Za=new TextDecoder,on=(ae,ne,Ie,Te)=>{if(Ie=ne+Ie,Te)return Ie;for(;ae[ne]&&!(ne>=Ie);)++ne;return ne},we=new TextDecoder("utf-16le"),lt=(ae,ne,Ie)=>(ae>>=1,we.decode(v.subarray(ae,on(v,ae,ne/2,Ie)))),an=(ae,ne,Ie)=>{if(Ie??(Ie=2147483647),2>Ie)return 0;Ie-=2;var Te=ne;Ie=Ie<2*ae.length?Ie/2:ae.length;for(var qe=0;qe<Ie;++qe)w[ne>>1]=ae.charCodeAt(qe),ne+=2;return w[ne>>1]=0,ne-Te},fo=ae=>2*ae.length,Ma=(ae,ne,Ie)=>{var Te="";ae>>=2;for(var qe=0;!(qe>=ne/4);qe++){var xt=N[ae+qe];if(!xt&&!Ie)break;Te+=String.fromCodePoint(xt)}return Te},ao=(ae,ne,Ie)=>{if(Ie??(Ie=2147483647),4>Ie)return 0;var Te=ne;Ie=Te+Ie-4;for(var qe=0;qe<ae.length;++qe){var xt=ae.codePointAt(qe);if(65535<xt&&qe++,R[ne>>2]=xt,ne+=4,ne+4>Ie)break}return R[ne>>2]=0,ne-Te},ha=ae=>{for(var ne=0,Ie=0;Ie<ae.length;++Ie)65535<ae.codePointAt(Ie)&&Ie++,ne+=4;return ne},il=[],Rg=ae=>{var ne=il.length;return il.push(ae),ne},cw=(ae,ne)=>{for(var Ie=Array(ae),Te=0;Te<ae;++Te)Ie[Te]=Fs(N[ne+4*Te>>2],`parameter ${Te}`);return Ie},gs=(ae,ne,Ie)=>{var Te=[];return ae=ae(Te,Ie),Te.length&&(N[ne>>2]=Mu(Te)),ae},iM={},oM=ae=>{var ne=iM[ae];return ne===void 0?nt(ae):ne},V5={},Vte=()=>{if(!H5){var ae={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(typeof navigator=="object"&&navigator.language||"C").replace("-","_")+".UTF-8",_:c||"./this.program"},ne;for(ne in V5)V5[ne]===void 0?delete ae[ne]:ae[ne]=V5[ne];var Ie=[];for(ne in ae)Ie.push(`${ne}=${ae[ne]}`);H5=Ie}return H5},H5,fve=[null,[],[]],Jp=new Uint8Array(123),Mg=25;0<=Mg;--Mg)Jp[48+Mg]=52+Mg,Jp[65+Mg]=Mg,Jp[97+Mg]=26+Mg;Jp[43]=62,Jp[47]=63,(()=>{let ae=qt.prototype;Object.assign(ae,{isAliasOf:function(Ie){if(!(this instanceof qt&&Ie instanceof qt))return!1;var Te=this.L.P.M,qe=this.L.O;Ie.L=Ie.L;var xt=Ie.L.P.M;for(Ie=Ie.L.O;Te.U;)qe=Te.ea(qe),Te=Te.U;for(;xt.U;)Ie=xt.ea(Ie),xt=xt.U;return Te===xt&&qe===Ie},clone:function(){if(this.L.O||ft(this),this.L.da)return this.L.count.value+=1,this;var Ie=Se,Te=Object,qe=Te.create,xt=Object.getPrototypeOf(this),ht=this.L;return Ie=Ie(qe.call(Te,xt,{L:{value:{count:ht.count,ba:ht.ba,da:ht.da,O:ht.O,P:ht.P,S:ht.S,W:ht.W}}})),Ie.L.count.value+=1,Ie.L.ba=!1,Ie},delete(){if(this.L.O||ft(this),this.L.ba&&!this.L.da)throw new Fe("Object already scheduled for deletion");be(this);var Ie=this.L;--Ie.count.value,Ie.count.value===0&&(Ie.S?Ie.W.Y(Ie.S):Ie.P.M.Y(Ie.O)),this.L.da||(this.L.S=void 0,this.L.O=void 0)},isDeleted:function(){return!this.L.O},deleteLater:function(){if(this.L.O||ft(this),this.L.ba&&!this.L.da)throw new Fe("Object already scheduled for deletion");return this.L.ba=!0,this}});let ne=Symbol.dispose;ne&&(ae[ne]=ae.delete)})(),Object.assign(Xo.prototype,{sa(ae){return this.na&&(ae=this.na(ae)),ae},ka(ae){var ne;(ne=this.Y)==null||ne.call(this,ae)},X:ye,N:function(ae){function ne(){return this.ga?mo(this.M.$,{P:this.xa,O:Ie,W:this,S:ae}):mo(this.M.$,{P:this,O:ae})}var Ie=this.sa(ae);if(!Ie)return this.ka(ae),null;var Te=vo(this.M,Ie);if(Te!==void 0)return Te.L.count.value===0?(Te.L.O=Ie,Te.L.S=ae,Te.clone()):(Te=Te.clone(),this.ka(ae),Te);if(Te=this.M.ra(Ie),Te=Ut[Te],!Te)return ne.call(this);Te=this.fa?Te.oa:Te.pointerType;var qe=qn(Ie,this.M,Te.M);return qe===null?ne.call(this):this.ga?mo(Te.M.$,{P:Te,O:qe,W:this,S:ae}):mo(Te.M.$,{P:Te,O:qe})}}),i.print&&(p=i.print),i.printErr&&(A=i.printErr),i.wasmBinary&&(m=i.wasmBinary),i.thisProgram&&(c=i.thisProgram);var Hte,W5,Ng,dve={x:()=>k(""),q:ae=>{var ne=ge[ae];delete ge[ae];var Ie=ne.ia,Te=ne.Y,qe=ne.la,xt=qe.map(ht=>ht.va).concat(qe.map(ht=>ht.Ba));Oe([ae],xt,ht=>{var Dt={};return qe.forEach((Sn,Wn)=>{var dn=ht[Wn],ma=Sn.ta,Lu=Sn.ua,ol=ht[Wn+qe.length],rl=Sn.Aa,Mf=Sn.Ca;Dt[Sn.qa]={read:Zp=>dn.N(ma(Lu,Zp)),write:(Zp,lw)=>{var Ou=[];rl(Mf,Zp,ol.T(Ou,lw)),re(Ou)},optional:ht[Wn].optional}}),[{name:ne.name,N:Sn=>{var Wn={},dn;for(dn in Dt)Wn[dn]=Dt[dn].read(Sn);return Te(Sn),Wn},T:(Sn,Wn)=>{for(var dn in Dt)if(!(dn in Wn||Dt[dn].optional))throw new TypeError(`Missing field: "${dn}"`);var ma=Ie();for(dn in Dt)Dt[dn].write(ma,Wn[dn]);return Sn!==null&&Sn.push(Te,ma),ma},X:ye,V:Te}]})},n:(ae,ne,Ie,Te,qe)=>{ne=nt(ne),Te=Te===0n;let xt=ht=>ht;if(Te){let ht=8*Ie;xt=Dt=>BigInt.asUintN(ht,Dt),qe=xt(qe)}je(ae,{name:ne,N:xt,T:(ht,Dt)=>(typeof Dt=="number"&&(Dt=BigInt(Dt)),Dt),X:st(ne,Ie,!Te),V:null})},B:(ae,ne,Ie,Te)=>{ne=nt(ne),je(ae,{name:ne,N:function(qe){return!!qe},T:function(qe,xt){return xt?Ie:Te},X:function(qe){return this.N(S[qe])},V:null})},j:(ae,ne,Ie,Te,qe,xt,ht,Dt,Sn,Wn,dn,ma,Lu)=>{dn=nt(dn),xt=Ei(qe,xt),Dt&&(Dt=Ei(ht,Dt)),Wn&&(Wn=Ei(Sn,Wn)),Lu=Ei(ma,Lu);var ol=ro(dn);Xe(ol,function(){Ho(`Cannot construct ${dn} due to unbound types`,[Te])}),Oe([ae,ne,Ie],Te?[Te]:[],rl=>{if(rl=rl[0],Te)var Mf=rl.M,Zp=Mf.$;else Zp=qt.prototype;rl=mt(dn,function(...Y5){if(Object.getPrototypeOf(this)!==lw)throw new Fe(`Use 'new' to construct ${dn}`);if(Ou.Z===void 0)throw new Fe(`${dn} has no accessible constructor`);var Wte=Ou.Z[Y5.length];if(Wte===void 0)throw new Fe(`Tried to invoke ctor of ${dn} with invalid number of parameters (${Y5.length}) - expected (${Object.keys(Ou.Z).toString()}) parameters instead!`);return Wte.apply(this,Y5)});var lw=Object.create(Zp,{constructor:{value:rl}});rl.prototype=lw;var Ou=new Vt(dn,rl,lw,Lu,Mf,xt,Dt,Wn);if(Ou.U){var uw;(uw=Ou.U).ja??(uw.ja=[]),Ou.U.ja.push(Ou)}return Mf=new Xo(dn,Ou,!0,!1,!1),uw=new Xo(dn+"*",Ou,!1,!1,!1),Zp=new Xo(dn+" const*",Ou,!1,!0,!1),Ut[ae]={pointerType:uw,oa:Zp},Go(ol,rl),[Mf,uw,Zp]})},g:(ae,ne,Ie,Te,qe,xt)=>{var ht=Xa(ne,Ie);qe=Ei(Te,qe),Oe([],[ae],Dt=>{Dt=Dt[0];var Sn=`constructor ${Dt.name}`;if(Dt.M.Z===void 0&&(Dt.M.Z=[]),Dt.M.Z[ne-1]!==void 0)throw new Fe(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${Dt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Dt.M.Z[ne-1]=()=>{Ho(`Cannot construct ${Dt.name} due to unbound types`,ht)},Oe([],ht,Wn=>(Wn.splice(1,0,null),Dt.M.Z[ne-1]=Eo(Sn,Wn,null,qe,xt),[])),[]})},b:(ae,ne,Ie,Te,qe,xt,ht,Dt,Sn)=>{var Wn=Xa(Ie,Te);ne=nt(ne),ne=ps(ne),xt=Ei(qe,xt),Oe([],[ae],dn=>{function ma(){Ho(`Cannot call ${Lu} due to unbound types`,Wn)}dn=dn[0];var Lu=`${dn.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),Dt&&dn.M.ya.push(ne);var ol=dn.M.$,rl=ol[ne];return rl===void 0||rl.R===void 0&&rl.className!==dn.name&&rl.aa===Ie-2?(ma.aa=Ie-2,ma.className=dn.name,ol[ne]=ma):(Gn(ol,ne,Lu),ol[ne].R[Ie-2]=ma),Oe([],Wn,Mf=>(Mf=Eo(Lu,Mf,dn,xt,ht,Sn),ol[ne].R===void 0?(Mf.aa=Ie-2,ol[ne]=Mf):ol[ne].R[Ie-2]=Mf,[])),[]})},z:ae=>je(ae,Nu),r:(ae,ne,Ie,Te)=>{function qe(){}ne=nt(ne),qe.values={},je(ae,{name:ne,constructor:qe,N:function(xt){return this.constructor.values[xt]},T:(xt,ht)=>ht.value,X:Kd(ne,Ie,Te),V:null}),Xe(ne,qe)},d:(ae,ne,Ie)=>{var Te=Fs(ae,"enum");ne=nt(ne),ae=Te.constructor,Te=Object.create(Te.constructor.prototype,{value:{value:Ie},constructor:{value:mt(`${Te.name}_${ne}`,function(){})}}),ae.values[Ie]=Te,ae[ne]=Te},m:(ae,ne,Ie)=>{ne=nt(ne),je(ae,{name:ne,N:Te=>Te,T:(Te,qe)=>qe,X:Pg(ne,Ie),V:null})},l:(ae,ne,Ie,Te,qe,xt,ht)=>{var Dt=Xa(ne,Ie);ae=nt(ae),ae=ps(ae),qe=Ei(Te,qe),Xe(ae,function(){Ho(`Cannot call ${ae} due to unbound types`,Dt)},ne-1),Oe([],Dt,Sn=>(Sn=[Sn[0],null].concat(Sn.slice(1)),Go(ae,Eo(ae,Sn,null,qe,xt,ht),ne-1),[]))},c:(ae,ne,Ie,Te,qe)=>{ne=nt(ne);let xt=Dt=>Dt;if(Te===0){var ht=32-8*Ie;xt=Dt=>Dt<<ht>>>ht,qe=xt(qe)}je(ae,{name:ne,N:xt,T:(Dt,Sn)=>Sn,X:st(ne,Ie,Te!==0),V:null})},a:(ae,ne,Ie)=>{function Te(xt){return new qe(x.buffer,N[xt+4>>2],N[xt>>2])}var qe=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Ie=nt(Ie),je(ae,{name:Ie,N:Te,X:Te},{wa:!0})},h:ae=>{je(ae,dm)},A:(ae,ne)=>{ne=nt(ne),je(ae,{name:ne,N(Ie){var Te=(Te=Ie+4)?Za.decode(S.subarray(Te,on(S,Te,N[Ie>>2],!0))):"";return Ng(Ie),Te},T(Ie,Te){Te instanceof ArrayBuffer&&(Te=new Uint8Array(Te));var qe=typeof Te=="string";if(!(qe||ArrayBuffer.isView(Te)&&Te.BYTES_PER_ELEMENT==1))throw new Fe("Cannot pass non-string to std::string");var xt=qe?Ja(Te):Te.length,ht=W5(4+xt+1),Dt=ht+4;return N[ht>>2]=xt,qe?pr(Te,Dt,xt+1):S.set(Te,Dt),Ie!==null&&Ie.push(Ng,ht),ht},X:ye,V(Ie){Ng(Ie)}})},f:(ae,ne,Ie)=>{if(Ie=nt(Ie),ne===2)var Te=lt,qe=an,xt=fo;else Te=Ma,qe=ao,xt=ha;je(ae,{name:Ie,N:ht=>{var Dt=Te(ht+4,N[ht>>2]*ne,!0);return Ng(ht),Dt},T:(ht,Dt)=>{if(typeof Dt!="string")throw new Fe(`Cannot pass non-string to C++ string type ${Ie}`);var Sn=xt(Dt),Wn=W5(4+Sn+ne);return N[Wn>>2]=Sn/ne,qe(Dt,Wn+4,Sn+ne),ht!==null&&ht.push(Ng,Wn),Wn},X:ye,V(ht){Ng(ht)}})},i:(ae,ne,Ie,Te,qe,xt)=>{ge[ae]={name:nt(ne),ia:Ei(Ie,Te),Y:Ei(qe,xt),la:[]}},e:(ae,ne,Ie,Te,qe,xt,ht,Dt,Sn,Wn)=>{ge[ae].la.push({qa:nt(ne),va:Ie,ta:Ei(Te,qe),ua:xt,Ba:ht,Aa:Ei(Dt,Sn),Ca:Wn})},C:(ae,ne)=>{ne=nt(ne),je(ae,{ma:!0,name:ne,N:()=>{},T:()=>{}})},p:(ae,ne,Ie)=>{var[Te,...qe]=cw(ae,ne);ne=Te.T.bind(Te);var xt=qe.map(Sn=>Sn.X.bind(Sn));ae--;var ht={toValue:Ru};switch(ae=xt.map((Sn,Wn)=>{var dn=`argFromPtr${Wn}`;return ht[dn]=Sn,`${dn}(args${Wn?"+"+8*Wn:""})`}),Ie){case 0:var Dt="toValue(handle)";break;case 2:Dt="new (toValue(handle))";break;case 3:Dt="";break;case 1:ht.getStringOrSymbol=oM,Dt="toValue(handle)[getStringOrSymbol(methodName)]"}return Dt+=`(${ae})`,Te.ma||(ht.toReturnWire=ne,ht.emval_returnValue=gs,Dt=`return emval_returnValue(toReturnWire, destructorsRef, ${Dt})`),Dt=`return function (handle, methodName, destructorsRef, args) {
|
|
${Dt}
|
|
}`,Ie=new Function(Object.keys(ht),Dt)(...Object.values(ht)),Dt=`methodCaller<(${qe.map(Sn=>Sn.name)}) => ${Te.name}>`,Rg(mt(Dt,Ie))},E:As,o:(ae,ne,Ie,Te,qe)=>il[ae](ne,Ie,Te,qe),D:ae=>{var ne=Ru(ae);re(ne),As(ae)},s:(ae,ne,Ie,Te)=>{var qe=new Date().getFullYear(),xt=new Date(qe,0,1).getTimezoneOffset();qe=new Date(qe,6,1).getTimezoneOffset(),N[ae>>2]=60*Math.max(xt,qe),R[ne>>2]=+(xt!=qe),ne=ht=>{var Dt=Math.abs(ht);return`UTC${0<=ht?"-":"+"}${String(Math.floor(Dt/60)).padStart(2,"0")}${String(Dt%60).padStart(2,"0")}`},ae=ne(xt),ne=ne(qe),qe<xt?(pr(ae,Ie,17),pr(ne,Te,17)):(pr(ae,Te,17),pr(ne,Ie,17))},y:ae=>{var ne=S.length;if(ae>>>=0,2147483648<ae)return!1;for(var Ie=1;4>=Ie;Ie*=2){var Te=ne*(1+.2/Ie);Te=Math.min(Te,ae+100663296);e:{Te=(Math.min(2147483648,65536*Math.ceil(Math.max(ae,Te)/65536))-I.buffer.byteLength+65535)/65536|0;try{I.grow(Te),M();var qe=1;break e}catch{}qe=void 0}if(qe)return!0}return!1},t:(ae,ne)=>{var Ie=0,Te=0,qe;for(qe of Vte()){var xt=ne+Ie;N[ae+Te>>2]=xt,Ie+=pr(qe,xt,1/0)+1,Te+=4}return 0},u:(ae,ne)=>{var Ie=Vte();N[ae>>2]=Ie.length,ae=0;for(var Te of Ie)ae+=Ja(Te)+1;return N[ne>>2]=ae,0},v:()=>52,w:function(){return 70},k:(ae,ne,Ie,Te)=>{for(var qe=0,xt=0;xt<Ie;xt++){var ht=N[ne>>2],Dt=N[ne+4>>2];ne+=8;for(var Sn=0;Sn<Dt;Sn++){var Wn=ae,dn=S[ht+Sn],ma=fve[Wn];dn===0||dn===10?(Wn=Wn===1?p:A,dn=on(ma,0),dn=Za.decode(ma.buffer?ma.subarray(0,dn):new Uint8Array(ma.slice(0,dn))),Wn(dn),ma.length=0):ma.push(dn)}qe+=Dt}return N[Te>>2]=qe,0}},AI=await(async function(){var ae;function ne(Te){var qe;return AI=Te.exports,I=AI.F,M(),yn=AI.H,Te=AI,Hte=Te.I,i._malloc=W5=Te.J,i._free=Ng=Te.K,O--,(qe=i.monitorRunDependencies)==null||qe.call(i,O),O==0&&G&&(Te=G,G=null,Te()),AI}O++,(ae=i.monitorRunDependencies)==null||ae.call(i,O);var Ie={a:dve};return i.instantiateWasm?new Promise(Te=>{i.instantiateWasm(Ie,(qe,xt)=>{Te(ne(qe))})}):(z??(z=pe("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C0EAEKEDRQRAQZiDASEBIARBmIMBQRgQiwFFDQJBsIMBIQEgBEGwgwFBGBCLAUUNAkEAIQBBvO4BLQAARQRAA0AgAEECdCAAQcYfEKIDNgKM7gEgAEEBaiIAQQZHDQALQbzuAUEBOgAAQaTuAUGM7gEoAgA2AgALQYzuASEBIAJBCGoiAEGM7gFBGBCLAUUNAkGk7gEhASAAQaTuAUEYEIsBRQ0CQRgQNCIBRQ0BCyABIAIpAgg3AgAgASACKQIYNwIQIAEgAikCEDcCCAwBC0EAIQELIAJBIGokAEGc8QFBAToAAEGY8QEgATYCACABC80KAgV/CX4jAEHgAGsiBSQAIARC////////P4MhCiACIASFQoCAgICAgICAgH+DIQsgAkL///////8/gyIMQiCIIQ8gBEIwiKdB//8BcSEHAkACQCACQjCIp0H//wFxIglB//8Ba0GCgH5PBEAgB0H//wFrQYGAfksNAQsgAVAgAkL///////////8AgyINQoCAgICAgMD//wBUIA1CgICAgICAwP//AFEbRQRAIAJCgICAgICAIIQhCwwCCyADUCAEQv///////////wCDIgJCgICAgICAwP//AFQgAkKAgICAgIDA//8AURtFBEAgBEKAgICAgIAghCELIAMhAQwCCyABIA1CgICAgICAwP//AIWEUARAIAIgA4RQBEBCgICAgICA4P//ACELQgAhAQwDCyALQoCAgICAgMD//wCEIQtCACEBDAILIAMgAkKAgICAgIDA//8AhYRQBEAgASANhEIAIQFQBEBCgICAgICA4P//ACELDAMLIAtCgICAgICAwP//AIQhCwwCCyABIA2EUARAQgAhAQwCCyACIAOEUARAQgAhAQwCCyANQv///////z9YBEAgBUHQAGogASAMIAEgDCAMUCIGG3lCwABCACAGG3ynIgZBD2sQREEQIAZrIQYgBSkDWCIMQiCIIQ8gBSkDUCEBCyACQv///////z9WDQAgBUFAayADIAogAyAKIApQIggbeULAAEIAIAgbfKciCEEPaxBEIAYgCGtBEGohBiAFKQNIIQogBSkDQCEDCyAHIAlqIAZqQf//AGshBgJAIApCD4YiDkIgiEKAgICACIQiAiABQiCIIgR+IhAgA0IPhiIRQiCIIgogD0KAgASEIg1+fCIPIBBUrSAPIANCMYggDoRC/////w+DIgMgDEL/////D4MiDH58Ig4gD1StfCACIA1+fCAOIA4gEUKAgP7/D4MiDyAMfiIRIAQgCn58IhAgEVStIBAgECADIAFC/////w+DIgF+fCIQVq18fCIOVq18IAMgDX4iEiACIAx+fCIRIBJUrUIghiARQiCIhHwgDiAOIBFCIIZ8Ig5WrXwgDiANIA9+Ig0gCiAMfnwiDCABIAJ+fCICIAMgBH58IgNCIIggAiADVq0gDCANVK0gAiAMVK18fEIghoR8IgIgDlStfCACIBAgBCAPfiIMIAEgCn58IgRCIIggBCAMVK1CIIaEfCIKIBBUrSAKIANCIIZ8IgMgClStfHwiCiACVK18IAogAyAEQiCGIgIgASAPfnwiASACVK18IgIgA1StfCIEIApUrXwiA0KAgICAgIDAAINQRQRAIAZBAWohBgwBCyABQj+IIANCAYYgBEI/iIQhAyAEQgGGIAJCP4iEIQQgAUIBhiEBIAJCAYaEIQILIAZB//8BTgRAIAtCgICAgICAwP//AIQhC0IAIQEMAQsCfiAGQQBMBEBBASAGayIHQf8ATQRAIAVBMGogASACIAZB/wBqIgYQRCAFQSBqIAQgAyAGEEQgBUEQaiABIAIgBxCKASAFIAQgAyAHEIoBIAUpAzAgBSkDOIRCAFKtIAUpAyAgBSkDEISEIQEgBSkDKCAFKQMYhCECIAUpAwAhBCAFKQMIDAILQgAhAQwCCyADQv///////z+DIAatQjCGhAsgC4QhCyABUCACQgBZIAJCgICAgICAgICAf1EbRQRAIAsgBEIBfCIBUK18IQsMAQsgASACQoCAgICAgICAgH+FhFBFBEAgBCEBDAELIAsgBCAEQgGDfCIBIARUrXwhCwsgACABNwMAIAAgCzcDCCAFQeAAaiQACwYAIAAQLQt8AQN/IwBBEGsiASQAIAEgADYCDCMAQRBrIgIkACAAKAIAQX9HBEAgAkEIaiACQQxqIAFBDGoQVRBVIQMDQCAAKAIAQQFGDQALIAAoAgBFBEAgAEEBNgIAIAMQ0gIgAEF/NgIACwsgAkEQaiQAIAAoAgQgAUEQaiQAQQFrCyAAIAAgAUEBazYCBCAAQeDVATYCACAAQZCtATYCACAAC/cFAQl/IwBBEGsiCSQAIAEQ1wIgCUEMaiABEFUhCCAAQQhqIgMQayACTQRAAkAgAkEBaiIAIAMQayIBSwRAIwBBIGsiCiQAAkAgACABayIHIAMoAgggAygCBGtBAnVNBEAgAyAHENkCDAELIApBDGohAQJ/IAMQayAHaiEFIwBBEGsiACQAIAAgBTYCDCAFELwCIgRNBEAgAxC5AiIFIARBAXZJBEAgACAFQQF0NgIIIABBCGogAEEMahCgASgCACEECyAAQRBqJAAgBAwBCxCMAQALIQQgAxBrIQUjAEEQayIAJAAgASADQQxqIgs2AhAgAUEANgIMIAQEfyAAQQhqIAsgBBC7AiAAKAIIIQYgACgCDAVBAAshBCABIAY2AgAgASAGIAVBAnRqIgU2AgggASAGIARBAnRqNgIMIAEgBTYCBCAAQRBqJAAjAEEQayIGJAAgASgCCCEEIAZBBGoiACABQQhqNgIIIAAgBDYCACAAIAQgB0ECdGo2AgQgACgCACEEA0AgACgCBCAERwRAIAEoAhAaIAQQugIgACAAKAIAQQRqIgQ2AgAMAQsLIAAoAgggACgCADYCACAGQRBqJAAgASgCBCADKAIAIgAgAygCBGtqIQQgAygCBCAAayIHBEAgBCAAIAf8CgAACyABIAQ2AgQgAyADKAIANgIEIAMgAUEEahDXASADQQRqIAFBCGoQ1wEgA0EIaiABQQxqENcBIAEgASgCBDYCACADEGsaIAEoAgQhAANAIAEoAggiBCAARwRAIAEgBEEEazYCCCABKAIQGgwBCwsgASgCACIABEAgASgCECAAIAEoAgwgASgCAGtBAnUQuAILCyAKQSBqJAAMAQsgACABSQRAIAMoAgAgAEECdGohACADEGsaIAMgABDYAgsLCyADIAIQggEoAgAEQCADIAIQggEoAgAQvwELIAgQrAEhACADIAIQggEgADYCACAIKAIAIQAgCEEANgIAIAAEQCAAEL8BCyAJQRBqJAALySgBC38jAEEQayIKJAACQAJAAkACQAJAAkACQAJAAkACQCAAQfQBTQRAQYzqASgCACIEQRAgAEELakH4A3EgAEELSRsiBkEDdiIAdiIBQQNxBEACQCABQX9zQQFxIABqIgJBA3QiAUG06gFqIgAgASgCvOoBIgEoAggiBUYEQEGM6gEgBEF+IAJ3cTYCAAwBCyAFIAA2AgwgACAFNgIICyABQQhqIQAgASACQQN0IgJBA3I2AgQgASACaiIBIAEoAgRBAXI2AgQMCwsgBkGU6gEoAgAiCE0NASABBEACQEECIAB0IgJBACACa3IgASAAdHFoIgFBA3QiAEG06gFqIgIgACgCvOoBIgAoAggiBUYEQEGM6gEgBEF+IAF3cSIENgIADAELIAUgAjYCDCACIAU2AggLIAAgBkEDcjYCBCAAIAZqIgcgAUEDdCIBIAZrIgVBAXI2AgQgACABaiAFNgIAIAgEQCAIQXhxQbTqAWohAUGg6gEoAgAhAgJ/IARBASAIQQN2dCIDcUUEQEGM6gEgAyAEcjYCACABDAELIAEoAggLIQMgASACNgIIIAMgAjYCDCACIAE2AgwgAiADNgIICyAAQQhqIQBBoOoBIAc2AgBBlOoBIAU2AgAMCwtBkOoBKAIAIgtFDQEgC2hBAnQoArzsASICKAIEQXhxIAZrIQMgAiEBA0ACQCABKAIQIgBFBEAgASgCFCIARQ0BCyAAKAIEQXhxIAZrIgEgAyABIANJIgEbIQMgACACIAEbIQIgACEBDAELCyACKAIYIQkgAiACKAIMIgBHBEAgAigCCCIBIAA2AgwgACABNgIIDAoLIAIoAhQiAQR/IAJBFGoFIAIoAhAiAUUNAyACQRBqCyEFA0AgBSEHIAEiAEEUaiEFIAAoAhQiAQ0AIABBEGohBSAAKAIQIgENAAsgB0EANgIADAkLQX8hBiAAQb9/Sw0AIABBC2oiAUF4cSEGQZDqASgCACIHRQ0AQR8hCEEAIAZrIQMgAEH0//8HTQRAIAZBJiABQQh2ZyIAa3ZBAXEgAEEBdGtBPmohCAsCQAJAAkAgCEECdCgCvOwBIgFFBEBBACEADAELQQAhACAGQRkgCEEBdmtBACAIQR9HG3QhAgNAAkAgASgCBEF4cSAGayIEIANPDQAgASEFIAQiAw0AQQAhAyABIQAMAwsgACABKAIUIgQgBCABIAJBHXZBBHFqKAIQIgFGGyAAIAQbIQAgAkEBdCECIAENAAsLIAAgBXJFBEBBACEFQQIgCHQiAEEAIABrciAHcSIARQ0DIABoQQJ0KAK87AEhAAsgAEUNAQsDQCAAKAIEQXhxIAZrIgIgA0khASACIAMgARshAyAAIAUgARshBSAAKAIQIgEEfyABBSAAKAIUCyIADQALCyAFRQ0AIANBlOoBKAIAIAZrTw0AIAUoAhghCCAFIAUoAgwiAEcEQCAFKAIIIgEgADYCDCAAIAE2AggMCAsgBSgCFCIBBH8gBUEUagUgBSgCECIBRQ0DIAVBEGoLIQIDQCACIQQgASIAQRRqIQIgACgCFCIBDQAgAEEQaiECIAAoAhAiAQ0ACyAEQQA2AgAMBwsgBkGU6gEoAgAiBU0EQEGg6gEoAgAhAAJAIAUgBmsiAUEQTwRAIAAgBmoiAiABQQFyNgIEIAAgBWogATYCACAAIAZBA3I2AgQMAQsgACAFQQNyNgIEIAAgBWoiASABKAIEQQFyNgIEQQAhAkEAIQELQZTqASABNgIAQaDqASACNgIAIABBCGohAAwJCyAGQZjqASgCACICSQRAQZjqASACIAZrIgE2AgBBpOoBQaTqASgCACIAIAZqIgI2AgAgAiABQQFyNgIEIAAgBkEDcjYCBCAAQQhqIQAMCQtBACEAIAZBL2oiAwJ/QeTtASgCAARAQeztASgCAAwBC0Hw7QFCfzcCAEHo7QFCgKCAgICABDcCAEHk7QEgCkEMakFwcUHYqtWqBXM2AgBB+O0BQQA2AgBByO0BQQA2AgBBgCALIgFqIgRBACABayIHcSIBIAZNDQhBxO0BKAIAIgUEQEG87QEoAgAiCCABaiIJIAhNIAUgCUlyDQkLAkBByO0BLQAAQQRxRQRAAkACQAJAAkBBpOoBKAIAIgUEQEHM7QEhAANAIAAoAgAiCCAFTQRAIAUgCCAAKAIEakkNAwsgACgCCCIADQALC0EAEKUBIgJBf0YNAyABIQRB6O0BKAIAIgBBAWsiBSACcQRAIAEgAmsgAiAFakEAIABrcWohBAsgBCAGTQ0DQcTtASgCACIABEBBvO0BKAIAIgUgBGoiByAFTSAAIAdJcg0ECyAEEKUBIgAgAkcNAQwFCyAEIAJrIAdxIgQQpQEiAiAAKAIAIAAoAgRqRg0BIAIhAAsgAEF/Rg0BIAZBMGogBE0EQCAAIQIMBAtB7O0BKAIAIgIgAyAEa2pBACACa3EiAhClAUF/Rg0BIAIgBGohBCAAIQIMAwsgAkF/Rw0CC0HI7QFByO0BKAIAQQRyNgIACyABEKUBIgJBf0ZBABClASIAQX9GciAAIAJNcg0FIAAgAmsiBCAGQShqTQ0FC0G87QFBvO0BKAIAIARqIgA2AgBBwO0BKAIAIABJBEBBwO0BIAA2AgALAkBBpOoBKAIAIgMEQEHM7QEhAANAIAIgACgCACIBIAAoAgQiBWpGDQIgACgCCCIADQALDAQLQZzqASgCACIAQQAgACACTRtFBEBBnOoBIAI2AgALQQAhAEHQ7QEgBDYCAEHM7QEgAjYCAEGs6gFBfzYCAEGw6gFB5O0BKAIANgIAQdjtAUEANgIAA0AgAEEDdCIBIAFBtOoBaiIFNgK86gEgASAFNgLA6gEgAEEBaiIAQSBHDQALQZjqASAEQShrIgBBeCACa0EHcSIBayIFNgIAQaTqASABIAJqIgE2AgAgASAFQQFyNgIEIAAgAmpBKDYCBEGo6gFB9O0BKAIANgIADAQLIAIgA00gASADS3INAiAAKAIMQQhxDQIgACAEIAVqNgIEQaTqASADQXggA2tBB3EiAGoiATYCAEGY6gFBmOoBKAIAIARqIgIgAGsiADYCACABIABBAXI2AgQgAiADakEoNgIEQajqAUH07QEoAgA2AgAMAwtBACEADAYLQQAhAAwEC0Gc6gEoAgAgAksEQEGc6gEgAjYCAAsgAiAEaiEFQcztASEAAkADQCAFIAAoAgAiAUcEQCAAKAIIIgANAQwCCwsgAC0ADEEIcUUNAwtBzO0BIQADQAJAIAAoAgAiASADTQRAIAMgASAAKAIEaiIFSQ0BCyAAKAIIIQAMAQsLQZjqASAEQShrIgBBeCACa0EHcSIBayIHNgIAQaTqASABIAJqIgE2AgAgASAHQQFyNgIEIAAgAmpBKDYCBEGo6gFB9O0BKAIANgIAIAMgBUEnIAVrQQdxakEvayIAIAAgA0EQakkbIgFBGzYCBCABQdTtASkCADcCECABQcztASkCADcCCEHU7QEgAUEIajYCAEHQ7QEgBDYCAEHM7QEgAjYCAEHY7QFBADYCACABQRhqIQADQCAAQQc2AgQgAEEIaiAAQQRqIQAgBUkNAAsgASADRg0AIAEgASgCBEF+cTYCBCADIAEgA2siAkEBcjYCBCABIAI2AgACfyACQf8BTQRAIAJBeHFBtOoBaiEAAn9BjOoBKAIAIgFBASACQQN2dCICcUUEQEGM6gEgASACcjYCACAADAELIAAoAggLIQEgACADNgIIIAEgAzYCDEEMIQJBCAwBC0EfIQAgAkH///8HTQRAIAJBJiACQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgAyAANgIcIANCADcCECAAQQJ0QbzsAWohAQJAAkBBkOoBKAIAIgVBASAAdCIEcUUEQEGQ6gEgBCAFcjYCACABIAM2AgAMAQsgAkEZIABBAXZrQQAgAEEfRxt0IQAgASgCACEFA0AgBSIBKAIEQXhxIAJGDQIgAEEddiEFIABBAXQhACABIAVBBHFqIgQoAhAiBQ0ACyAEIAM2AhALIAMgATYCGEEIIQIgAyIBIQBBDAwBCyABKAIIIgAgAzYCDCABIAM2AgggAyAANgIIQQAhAEEYIQJBDAsgA2ogATYCACACIANqIAA2AgALQZjqASgCACIAIAZNDQBBmOoBIAAgBmsiATYCAEGk6gFBpOoBKAIAIgAgBmoiAjYCACACIAFBAXI2AgQgACAGQQNyNgIEIABBCGohAAwEC0GI6gFBMDYCAEEAIQAMAwsgACACNgIAIAAgACgCBCAEajYCBCACQXggAmtBB3FqIgggBkEDcjYCBCABQXggAWtBB3FqIgQgBiAIaiIDayEHAkBBpOoBKAIAIARGBEBBpOoBIAM2AgBBmOoBQZjqASgCACAHaiIANgIAIAMgAEEBcjYCBAwBC0Gg6gEoAgAgBEYEQEGg6gEgAzYCAEGU6gFBlOoBKAIAIAdqIgA2AgAgAyAAQQFyNgIEIAAgA2ogADYCAAwBCyAEKAIEIgBBA3FBAUYEQCAAQXhxIQkgBCgCDCECAkAgAEH/AU0EQCAEKAIIIgEgAkYEQEGM6gFBjOoBKAIAQX4gAEEDdndxNgIADAILIAEgAjYCDCACIAE2AggMAQsgBCgCGCEGAkAgAiAERwRAIAQoAggiACACNgIMIAIgADYCCAwBCwJAIAQoAhQiAAR/IARBFGoFIAQoAhAiAEUNASAEQRBqCyEBA0AgASEFIAAiAkEUaiEBIAAoAhQiAA0AIAJBEGohASACKAIQIgANAAsgBUEANgIADAELQQAhAgsgBkUNAAJAIAQoAhwiAEECdCIBKAK87AEgBEYEQCABQbzsAWogAjYCACACDQFBkOoBQZDqASgCAEF+IAB3cTYCAAwCCwJAIAQgBigCEEYEQCAGIAI2AhAMAQsgBiACNgIUCyACRQ0BCyACIAY2AhggBCgCECIABEAgAiAANgIQIAAgAjYCGAsgBCgCFCIARQ0AIAIgADYCFCAAIAI2AhgLIAcgCWohByAEIAlqIgQoAgQhAAsgBCAAQX5xNgIEIAMgB0EBcjYCBCADIAdqIAc2AgAgB0H/AU0EQCAHQXhxQbTqAWohAAJ/QYzqASgCACIBQQEgB0EDdnQiAnFFBEBBjOoBIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgAzYCCCABIAM2AgwgAyAANgIMIAMgATYCCAwBC0EfIQIgB0H///8HTQRAIAdBJiAHQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAgsgAyACNgIcIANCADcCECACQQJ0QbzsAWohAAJAAkBBkOoBKAIAIgFBASACdCIFcUUEQEGQ6gEgASAFcjYCACAAIAM2AgAMAQsgB0EZIAJBAXZrQQAgAkEfRxt0IQIgACgCACEBA0AgASIAKAIEQXhxIAdGDQIgAkEddiEBIAJBAXQhAiAAIAFBBHFqIgUoAhAiAQ0ACyAFIAM2AhALIAMgADYCGCADIAM2AgwgAyADNgIIDAELIAAoAggiASADNgIMIAAgAzYCCCADQQA2AhggAyAANgIMIAMgATYCCAsgCEEIaiEADAILAkAgCEUNAAJAIAUoAhwiAUECdCICKAK87AEgBUYEQCACQbzsAWogADYCACAADQFBkOoBIAdBfiABd3EiBzYCAAwCCwJAIAUgCCgCEEYEQCAIIAA2AhAMAQsgCCAANgIUCyAARQ0BCyAAIAg2AhggBSgCECIBBEAgACABNgIQIAEgADYCGAsgBSgCFCIBRQ0AIAAgATYCFCABIAA2AhgLAkAgA0EPTQRAIAUgAyAGaiIAQQNyNgIEIAAgBWoiACAAKAIEQQFyNgIEDAELIAUgBkEDcjYCBCAFIAZqIgQgA0EBcjYCBCADIARqIAM2AgAgA0H/AU0EQCADQXhxQbTqAWohAAJ/QYzqASgCACIBQQEgA0EDdnQiAnFFBEBBjOoBIAEgAnI2AgAgAAwBCyAAKAIICyEBIAAgBDYCCCABIAQ2AgwgBCAANgIMIAQgATYCCAwBC0EfIQAgA0H///8HTQRAIANBJiADQQh2ZyIAa3ZBAXEgAEEBdGtBPmohAAsgBCAANgIcIARCADcCECAAQQJ0QbzsAWohAQJAAkAgB0EBIAB0IgJxRQRAQZDqASACIAdyNgIAIAEgBDYCACAEIAE2AhgMAQsgA0EZIABBAXZrQQAgAEEfRxt0IQAgASgCACEBA0AgASICKAIEQXhxIANGDQIgAEEddiEBIABBAXQhACACIAFBBHFqIgcoAhAiAQ0ACyAHIAQ2AhAgBCACNgIYCyAEIAQ2AgwgBCAENgIIDAELIAIoAggiACAENgIMIAIgBDYCCCAEQQA2AhggBCACNgIMIAQgADYCCAsgBUEIaiEADAELAkAgCUUNAAJAIAIoAhwiAUECdCIFKAK87AEgAkYEQCAFQbzsAWogADYCACAADQFBkOoBIAtBfiABd3E2AgAMAgsCQCACIAkoAhBGBEAgCSAANgIQDAELIAkgADYCFAsgAEUNAQsgACAJNgIYIAIoAhAiAQRAIAAgATYCECABIAA2AhgLIAIoAhQiAUUNACAAIAE2AhQgASAANgIYCwJAIANBD00EQCACIAMgBmoiAEEDcjYCBCAAIAJqIgAgACgCBEEBcjYCBAwBCyACIAZBA3I2AgQgAiAGaiIFIANBAXI2AgQgAyAFaiADNgIAIAgEQCAIQXhxQbTqAWohAEGg6gEoAgAhAQJ/QQEgCEEDdnQiByAEcUUEQEGM6gEgBCAHcjYCACAADAELIAAoAggLIQQgACABNgIIIAQgATYCDCABIAA2AgwgASAENgIIC0Gg6gEgBTYCAEGU6gEgAzYCAAsgAkEIaiEACyAKQRBqJAAgAAsIACAAQQAQPAsVACAAIAE2AgAgACACKAIANgIEIAALCgAgACgCABC9AwsLACAAKAIAEMMDwAsXACAAEEcEQCAAKAIAIAAQfhCpAQsgAAs7AQJ/IwBBEGsiASQAIAEgADYCDCABKAIMIgAoAgAiAgRAIAAgAjYCBCAAKAIIGiACEC0LIAFBEGokAAstACACRQRAIAAoAgQgASgCBEYPCyAAIAFGBEBBAQ8LIAAoAgQgASgCBBDQAUULIQEBfyAAKAIAIQIgACABNgIAIAIEQCACIAAoAgQRAgALCwYAEMoDAAsNACAAKAIAELwDGiAACw0AIAAoAgAQnQIaIAALdQEBfiAAIAEgBH4gAiADfnwgA0IgiCICIAFCIIgiBH58IANC/////w+DIgMgAUL/////D4MiAX4iBUIgiCADIAR+fCIDQiCIfCABIAJ+IANC/////w+DfCIBQiCIfDcDCCAAIAVC/////w+DIAFCIIaENwMACxEAIAAgASAAKAIAKAIcEQQAC8EBAQN/IAAtAABBIHFFBEACQCAAKAIQIgMEfyADBSAAEN8BDQEgACgCEAsgACgCFCIEayACSQRAIAAgASACIAAoAiQRAwAaDAELAkACQCACRSAAKAJQQQBIcg0AIAIhAwNAIAEgA2oiBUEBay0AAEEKRwRAIANBAWsiAw0BDAILCyAAIAEgAyAAKAIkEQMAIANJDQIgAiADayECIAAoAhQhBAwBCyABIQULIAQgBSACEHEaIAAgACgCFCACajYCFAsLC6EBAQJ/AkAgABAfRSACIAFrQQVIcg0AIAEgAhDHASACQQRrIQQgABAjIgIgABAfaiEFAkADQAJAIAIsAAAhACABIARPDQAgAEEATCAAQf8ATnJFBEAgASgCACACLAAARw0DCyABQQRqIQEgAiAFIAJrQQFKaiECDAELCyAAQQBMIABB/wBOcg0BIAIsAAAgBCgCAEEBa0sNAQsgA0EENgIACwtQAQF+AkAgA0HAAHEEQCABIANBQGqthiECQgAhAQwBCyADRQ0AIAIgA60iBIYgAUHAACADa62IhCECIAEgBIYhAQsgACABNwMAIAAgAjcDCAtpAQF/IwBBgAJrIgUkACAEQYDABHEgAiADTHJFBEAgBSABIAIgA2siA0GAAiADQYACSSIBGxCYAiABRQRAA0AgACAFQYACEEIgA0GAAmsiA0H/AUsNAAsLIAAgBSADEEILIAVBgAJqJAALBABBAAsKACAALQALQQd2CwoAIABB0PIBEHoLCgAgAEHY8gEQegvPCQIEfwR+IwBB8ABrIgYkACAEQv///////////wCDIQkCQAJAIAFQIgUgAkL///////////8AgyIKQoCAgICAgMD//wB9QoCAgICAgMCAgH9UIApQG0UEQCADQgBSIAlCgICAgICAwP//AH0iC0KAgICAgIDAgIB/ViALQoCAgICAgMCAgH9RGw0BCyAFIApCgICAgICAwP//AFQgCkKAgICAgIDA//8AURtFBEAgAkKAgICAgIAghCEEIAEhAwwCCyADUCAJQoCAgICAgMD//wBUIAlCgICAgICAwP//AFEbRQRAIARCgICAgICAIIQhBAwCCyABIApCgICAgICAwP//AIWEUARAQoCAgICAgOD//wAgAiABIAOFIAIgBIVCgICAgICAgICAf4WEUCIFGyEEQgAgASAFGyEDDAILIAMgCUKAgICAgIDA//8AhYRQDQEgASAKhFAEQCADIAmEQgBSDQIgASADgyEDIAIgBIMhBAwCCyADIAmEUEUNACABIQMgAiEEDAELIAMgASABIANUIAkgClYgCSAKURsiCBshCiAEIAIgCBsiDEL///////8/gyEJIAIgBCAIGyILQjCIp0H//wFxIQcgDEIwiKdB//8BcSIFRQRAIAZB4ABqIAogCSAKIAkgCVAiBRt5QsAAQgAgBRt8pyIFQQ9rEEQgBikDaCEJIAYpA2AhCkEQIAVrIQULIAEgAyAIGyEDIAtC////////P4MhASAHBH4gAQUgBkHQAGogAyABIAMgASABUCIHG3lCwABCACAHG3ynIgdBD2sQREEQIAdrIQcgBikDUCEDIAYpA1gLQgOGIANCPYiEQoCAgICAgIAEhCEBIAlCA4YgCkI9iIQgAiAEhSEEAn4gA0IDhiICIAUgB0YNABogBSAHayIHQf8ASwRAQgAhAUIBDAELIAZBQGsgAiABQYABIAdrEEQgBkEwaiACIAEgBxCKASAGKQM4IQEgBikDMCAGKQNAIAYpA0iEQgBSrYQLIQlCgICAgICAgASEIQsgCkIDhiEKAkAgBEIAUwRAQgAhA0IAIQQgCSAKhSABIAuFhFANAiAKIAl9IQIgCyABfSAJIApWrX0iBEL/////////A1YNASAGQSBqIAIgBCACIAQgBFAiBxt5QsAAQgAgBxt8p0EMayIHEEQgBSAHayEFIAYpAyghBCAGKQMgIQIMAQsgCSAKfCICIAlUrSABIAt8fCIEQoCAgICAgIAIg1ANACAJQgGDIARCP4YgAkIBiISEIQIgBUEBaiEFIARCAYghBAsgDEKAgICAgICAgIB/gyEDIAVB//8BTgRAIANCgICAgICAwP//AIQhBEIAIQMMAQtBACEHAkAgBUEASgRAIAUhBwwBCyAGQRBqIAIgBCAFQf8AahBEIAYgAiAEQQEgBWsQigEgBikDACAGKQMQIAYpAxiEQgBSrYQhAiAGKQMIIQQLIARCPYYgAkIDiIQhASAEQgOIQv///////z+DIAetQjCGhCADhCEEAkACQCACp0EHcSIFQQRHBEAgBCABIAEgBUEES618IgNWrXwhBAwBCyAEIAEgASABQgGDfCIDVq18IQQMAQsgBUUN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C14BA38gAEEANgIIIABCADcCACABKAIAIQMgASgCBCIBIANrIgRBAnUiAgRAIAAgAhCuAyAAKAIEIQIgBEUgASADRnJFBEAgAiADIAT8CgAACyAAIAIgBGo2AgQLIAALDQAgACgCACABQQJ0agsXACAAEEcEQCAAIAE2AgQPCyAAIAEQUAthAQF/IwBBEGsiAiQAIAIgADYCDAJAIAAgAUYNAANAIAIgAUEBayIBNgIIIAAgAU8NASACKAIMIAIoAggQ8wIgAiACKAIMQQFqIgA2AgwgAigCCCEBDAALAAsgAkEQaiQAC6wBAQR/IwBBEGsiByQAAkAgAEUNACAEKAIMIQYgAiABa0ECdSIIQQBKBEAgACABIAgQjQIgCEcNAQsgAyABa0ECdSIBIAZIBEAgACAHQQRqIAYgAWsiASAFEP0CIgUQIyABEI0CIQYgBRA5GiABIAZHDQELIAMgAmtBAnUiAUEASgRAIAAgAiABEI0CIAFHDQELIAQoAgwaIARBADYCDCAAIQkLIAdBEGokACAJCycBAX8jAEEQayIDJAAgAyACNgIMIABB5AAgASACENEBIANBEGokAAvbAQIBfwJ+QQEhBAJAIABCAFIgAUL///////////8AgyIFQoCAgICAgMD//wBWIAVCgICAgICAwP//AFEbDQAgAkIAUiADQv///////////wCDIgZCgICAgICAwP//AFYgBkKAgICAgIDA//8AURsNACAAIAKEIAUgBoSEUARAQQAPCyABIAODQgBZBEAgACACVCABIANTIAEgA1EbBEBBfw8LIAAgAoUgASADhYRCAFIPCyAAIAJWIAEgA1UgASADURsEQEF/DwsgACAChSABIAOFhEIAUiEECyAEC+wBAQR/IwBBEGsiBCQAIABBADYCBCMAQRBrIgUkACAEQQA6AA8gACAAKAIAQQxrKAIAahDZASEGIAAgACgCAEEMaygCAGohAwJAIAYEQCADKAJIBEAgACAAKAIAQQxrKAIAaigCSBDFAwsgBCAAIAAoAgBBDGsoAgBqENkBOgAPDAELIANBBBDVAQsgBUEQaiQAQQQhAyAELQAPBEAgACAAIAAoAgBBDGsoAgBqKAIYIgMgASACIAMoAgAoAiARAwAiATYCBEEGQQAgASACRxshAwsgACAAKAIAQQxrKAIAaiADENUBIARB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AxsLPAAgAEEANgIIIABCADcCACAAIAEoAgA2AgAgACABKAIENgIEIAAgASgCCDYCCCABQQA2AgggAUIANwIACywBAX8gAEEANgIIIABCADcCACAAIAEoAgAiAiABKAIEIgEgASACaxDAAyAACwgAIABB/wFxC/wBAQN/IAAoAgQgACgCACIDa0ECdSICIAFJBEAjAEEgayIDJAACQCABIAJrIgIgACgCCCAAKAIEIgFrQQJ1TQRAIAAoAgQiASACQQJ0aiECA0AgASACRgRAIAAgAjYCBAUgAUEANgIAIAFBBGohAQwBCwsMAQsgA0EMaiAAIAEgACgCAGtBAnUgAmoQtgEgACgCBCAAKAIAa0ECdSAAEIcCIgQoAggiASACQQJ0aiECA0AgASACRwRAIAFBADYCACABQQRqIQEMAQsLIAQgAjYCCCAAIAQQhQIgBBCBAgsgA0EgaiQADwsgASACSQRAIAAgAyABQQJ0ajYCBAsLUgECf0HU3gEoAgAiASAAQQdqQXhxIgJqIQACQCACQQAgACABTRtFBEAgAD8AQRB0TQ0BIAAQGA0BC0GI6gFBMDYCAEF/DwtB1N4BIAA2AgAgAQt/AgF+A38CQCAAQoCAgIAQVARAIAAhAgwBCwNAIAFBAWsiASAAIABCCoAiAkIKfn2nQTByOgAAIABC/////58BViACIQANAAsLIAJQRQRAIAKnIQMDQCABQQFrIgEgAyADQQpuIgRBCmxrQTByOgAAIANBCUsgBCEDDQALCyABC78BAQN/IAAoAgQgACgCACIDayICIAFJBEAjAEEgayIDJAACQCABIAJrIgIgACgCCCAAKAIEIgFrTQRAIAAgAhCYAwwBCyACIANBDGogACABIAJqIAAoAgBrELQBIAAoAgQgACgCAGsgABDGASIEKAIIIgFqIQIDQCABIAJHBEAgAUEAOgAAIAFBAWohAQwBCwsgBCACNgIIIAAgBBDvASAEELoBCyADQSBqJAAPCyABIAJJBEAgACABIANqNgIECwt9AQN/AkACQCAAIgFBA3FFDQAgAS0AAEUEQEEADwsDQCABQQFqIgFBA3FFDQEgAS0AAA0ACwwBCwNAIAEiAkEEaiEBQYCChAggAigCACIDayADckGAgYKEeHFBgIGChHhGDQALA0AgAiIBQQFqIQIgAS0AAA0ACwsgASAA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BEBBCiEBIAAQXgwBCyAAEH5BAWshASAAKAIECyIDIAFGBEAgACABQQEgASABEPQBIAAQIxoMAQsgABAjGiAEDQAgACIBIANBAWoQUAwBCyAAKAIAIQEgACADQQFqNgIECyABIANqIgAgAkEPahBdIAJBADoADiAAQQFqIAJBDmoQXSACQRBqJAALoQIBA38jAEEgayIIJABB9////wciCSABQX9zaiACTwRAIAAQIyEKIAFB8////wNJBEAgCCABQQF0NgIcIAggASACajYCECAIQRBqIAhBHGoQoAEoAgAQnwFBAWohCQsgCEEcaiAIQRhqIAAQVSgCABC8ASAIQRBqIAkQngEgCCgCECECIAgoAhQaIAQEQCACIAogBBBNCyAGBEAgAiAEaiAHIAYQTQsgAyAEIAVqIglrIQcgAyAJRwRAIAIgBGogBmogBCAKaiAFaiAHEE0LIAFBCkcEQCAKEIsCCyAAIAI2AgAgACAIKAIUEFwgACAEIAZqIAdqIgA2AgQgCEEAOgAPIAAgAmogCEEPahBdIAhBHGoQuwEgCEEgaiQADwsQWwALCQAgAEEBEKgCCwoAIAAoAgAQHxoLCQAgACABEFUaCwcAIABBAkkLBABBBAsoAQF/IAAgACgCBEEBayIBNgIEIAFBf0YEQCAAIAAoAgAoAggRAgALC5UBAQN/IwBBEGsiBCQAIAQgATYCDCAEIAM2AgggBEEEaiAEQQxqEGMgBCgCCCEDIwBBEGsiASQAIAEgAzYCDCABIAM2AghBfyEFAkBBAEEAIAIgAxDRASIDQQBIDQAgACADQQFqIgMQNCIANgIAIABFDQAgACADIAIgASgCDBDRASEFCyABQRBqJAAQYiAEQRBqJAAgBQsPACAAIAAoAgAoAiQRAAALEQAgACABIAEoAgAoAiARAQALDgAgACABKAIANgIAIAALCABB/////wcLBQBB/wALOwAgACADNgIQIAAgAQR/IAEQUwVBAAsiAzYCACAAIAIgA2oiAjYCCCAAIAEgA2o2AgwgACACNgIEIAALYQEBfyMAQRBrIgIkACACIAA2AgwCQCAAIAFGDQADQCACIAFBBGsiATYCCCAAIAFPDQEgAigCDCACKAIIENcBIAIgAigCDEEEaiIANgIMIAIoAgghAQwACwALIAJBEGokAAs5AgF/AX4jAEEQayIEJAAgAykDACEFIAQgAykDCDcDCCAEIAU3AwAgACABIAIgBBDAASAEQRBqJAAL0AEBAn8gAkGAEHEEQCAAQSs6AAAgAEEBaiEACyACQYAIcQRAIABBIzoAACAAQQFqIQALIAJBhAJxIgNBhAJHBEAgAEGu1AA7AAAgAEECaiEACyACQYCAAXEhAgNAIAEtAAAiBARAIAAgBDoAACAAQQFqIQAgAUEBaiEBDAELCyAAAn8CQCADQYACRwRAIANBBEcNAUHGAEHmACACGwwCC0HFAEHlACACGwwBC0HBAEHhACACGyADQYQCRg0AGkHHAEHnACACGws6AAAgA0GEAkcLKwEBfyMAQRBrIgUkACAFIAQoAgA2AgAgACABIAIgAyAFEJYBIAVBEGokAAuqAQEBfwJAIANBgBBxRSACRXINACADQcoAcSIEQQhGIARBwABGcg0AIABBKzoAACAAQQFqIQALIANBgARxBEAgAEEjOgAAIABBAWohAAsDQCABLQAAIgQEQCAAIAQ6AAAgAEEBaiEAIAFBAWohAQwBCwsgAAJ/Qe8AIANBygBxIgFBwABGDQAaQdgAQfgAIANBgIABcRsgAUEIRg0AGkHkAEH1ACACGws6AAALDAAgABAjIAFBAnRqC5IEAQt/IwBBgAFrIgokACAKIAE2AnwgAiADELUCIQggCkHjADYCECAKQQhqQQAgCkEQaiIJEDYhDwJAAkACQCAIQeUATwRAIAgQNCIJRQ0BIA8gCRA8CyAJIQcgAiEBA0AgASADRgRAA0AgACAKQfwAaiIBECtBASAIGwRAIAAgARArBEAgBSAFKAIAQQJyNgIACwNAIAIgA0YNBiAJLQAAQQJGDQcgCUEBaiEJIAJBDGohAgwACwALIAAQNyEOIAZFBEAgBCAOEEEhDgsgDUEBaiEMQQAhECAJIQcgAiEBA0AgASADRgRAIAwhDSAQRQ0CIAAQPhogCSEHIAIhASAIIAtqQQJJDQIDQCABIANGBEAMBAUCQCAHLQAAQQJHDQAgARAfIA1GDQAgB0EAOgAAIAtBAWshCwsgB0EBaiEHIAFBDGohAQwBCwALAAUCQCAHLQAAQQFHDQAgASANEMwBKAIAIRECQCAGBH8gEQUgBCAREEELIA5GBEBBASEQIAEQHyAMRw0CIAdBAjoAACALQQFqIQsMAQsgB0EAOgAACyAIQQFrIQgLIAdBAWohByABQQxqIQEMAQsACwALAAUgB0ECQQEgARBaIgwbOgAAIAdBAWohByABQQxqIQEgCyAMaiELIAggDGshCAwBCwALAAsQPQALIAUgBSgCAEEEcjYCAAsgDxA1IApBgAFqJAAgAgsRACAAIAEgACgCACgCDBEEAAuTBAELfyMAQYABayIKJAAgCiABNgJ8IAIgAxC1AiEIIApB4wA2AhAgCkEIakEAIApBEGoiCRA2IQ8CQAJAAkAgCEHlAE8EQCAIEDQiCUUNASAPIAkQPAsgCSEHIAIhAQNAIAEgA0YEQANAIAAgCkH8AGoiARAsQQEgCBsEQCAAIAEQLARAIAUgBSgCAEECcjYCAAsDQCACIANGDQYgCS0AAEECRg0HIAlBAWohCSACQQxqIQIMAAsACyAAEDghDiAGRQRAIAQgDhDOASEOCyANQQFqIQxBACEQIAkhByACIQEDQCABIANGBEAgDCENIBBFDQIgABA/GiAJIQcgAiEBIAggC2pBAkkNAgNAIAEgA0YEQAwEBQJAIActAABBAkcNACABEB8gDUYNACAHQQA6AAAgC0EBayELCyAHQQFqIQcgAUEMaiEBDAELAAsABQJAIActAABBAUcNACABIA0QIiwAACERAkAgBgR/IBEFIAQgERDOAQsgDkYEQEEBIRAgARAfIAxHDQIgB0ECOgAAIAtBAWohCwwBCyAHQQA6AAALIAhBAWshCAsgB0EBaiEHIAFBDGohAQwBCwALAAsABSAHQQJBASABEFoiDBs6AAAgB0EBaiEHIAFBDGohASALIAxqIQsgCCAMayEIDAELAAsACxA9AAsgBSAFKAIAQQRyNgIACyAPEDUgCkGAAWokACACC0oBAn8CQCAALQAAIgJFIAIgAS0AACIDR3INAANAIAEtAAEhAyAALQABIgJFDQEgAUEBaiEBIABBAWohACACIANGDQALCyACIANrC4QBAQJ/IwBBoAFrIgQkACAEIAAgBEGeAWogARsiADYClAEgBCABQQFrIgVBACABIAVPGzYCmAEgBEEAQZAB/AsAIARBfzYCTCAEQeIANgIkIARBfzYCUCAEIARBnwFqNgIsIAQgBEGUAWo2AlQgAEEAOgAAIAQgAiADEM0DIARBoAFqJAALuwIBBH8gA0H87QEgAxsiBSgCACEDAkAC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IBAtIAAoAiQQLSAAKAIwEC0gACgCPBAtCyAACwcAIAEgAGsLDABBARDWARogABAtCwkAIAAQsQEQLQsTACAAIAEgAiAAKAIAKAIwEQMACwkAIAAQ2AEQLQsMACAAQQRqENoBIAALDAAgAEEIahDaASAACygBAn8jAEEQayICJAAgASgCACAAKAIASCEDIAJBEGokACABIAAgAxsLEAAgACABNwMIIABCADcDAAsCAAsUACAAQZj1ADYCACAAQQRqECUgAAvyAwICfgV/IwBBIGsiBSQAIAFC////////P4MhAgJ+IAFCMIhC//8BgyIDpyIEQYH4AGtB/Q9NBEAgAkIEhiAAQjyIhCECIARBgPgAa60hAwJAIABC//////////8PgyIAQoGAgICAgICACFoEQCACQgF8IQIMAQsgAEKAgICAgICAgAhSDQAgAkIBgyACfCECC0IAIAIgAkL/////////B1YiBBshACAErSADfAwBCyAAIAKEUCADQv//AVJyRQRAIAJCBIYgAEI8iIRCgICAgICAgASEIQBC/w8MAQsgBEH+hwFLBEBCACEAQv8PDAELQYD4AEGB+AAgA1AiBxsiCCAEayIGQfAASgRAQgAhAEIADAELIAVBEGogACACIAJCgICAgICAwACEIAcbIgJBgAEgBmsQRCAFIAAgAiAGEIoBIAUpAwhCBIYgBSkDACICQjyIhCEAAkAgBCAIRyAFKQMQIAUpAxiEQgBSca0gAkL//////////w+DhCICQoGAgICAgICACFoEQCAAQgF8IQAMAQsgAkKAgICAgICAgAhSDQAgAEIBgyAAfCEACyAAQoCAgICAgIAIhSAAIABC/////////wdWIgQbIQAgBK0LIQIgBUEgaiQAIAFCgICAgICAgICAf4MgAkI0hoQgAIS/C4kCAAJAIAAEfyABQf8ATQ0BAkBB3OEBKAIAKAIARQRAIAFBgH9xQYC/A0YNAwwBCyABQf8PTQRAIAAgAUE/cUGAAXI6AAEgACABQQZ2QcABcjoAAEECDwsgAUGAQHFBgMADRyABQYCwA09xRQRAIAAgAUE/cUGAAXI6AAIgACABQQx2QeABcjoAACAAIAFBBnZBP3FBgAFyOgABQQMPCyABQYCABGtB//8/TQRAIAAgAUE/cUGAAXI6AAMgACABQRJ2QfABcjoAACAAIAFBBnZBP3FBgAFyOgACIAAgAUEMdkE/cUGAAXI6AAFBBA8LC0GI6gFBGTYCAEF/BUEBCw8LIAAgAToAAEEBCzABAX8jAEEQayICJAAgAiABKAIANgIAIAAgAhByEH9BoPEAKAIAEGEaIAJBEGokAAsRACACBEAgACABwCAC/AsACwupAQEBfEQAAAAAAADwPyEBAkAgAEGACE4EQEQAAAAAAADgfyEBIABB/w9JBEAgAEH/B2shAAwCC0QAAAAAAADwfyEBQf0XIAAgAEH9F08bQf4PayEADAELIABBgXhKDQBEAAAAAAAAYAMhASAAQbhwSwRAIABByQdqIQAMAQtEAAAAAAAAAAAhAUHwaCAAIABB8GhNG0GSD2ohAAsgASAAQf8Haq1CNIa/ogtEAQF/IwBBEGsiAiQAIAAoAgAhACACIAE2AgggAiAANgIEIAJB/BQ2AgBByAsgAhByEH9BoPEAKAIAEGEaIAJBEGokAAt4AQN/AkAgAEUNACAAKAIgRQ0AIAAoAiQiAkUNACAAKAIcIgFFDQAgASgCACAARw0AIAEoAgRBtP4Aa0EfSw0AIAEoAjgiAwRAIAAoAiggAyACEQEAIAAoAiQhAiAAKAIcIQELIAAoAiggASACEQEAIABBADYCHAsL6QMAQZTZAUGFExAcQazZAUGUDkEBQQAQG0G42QFB8QxBAUGAf0H/ABACQdDZAUHqDEEBQYB/Qf8AEAJBxNkBQegMQQFBAEH/ARACQdzZAUGjCUECQYCAfkH//wEQAkHo2QFBmglBAkEAQf//AxACQfTZAUGyCUEEQYCAgIB4Qf////8HEAJBgNoBQakJQQRBAEF/EAJBjNoBQfMPQQRBgICAgHhB/////wcQAkGY2gFB6g9BBEEAQX8QAkGk2gFB4A9BCEKAgICAgICAgIB/Qv///////////wAQDUGw2gFB1w9BCEIAQn8QDUG82gFBogpBBBAMQcjaAUGMEUEIEAxBmC1BkhAQGkHgLUEEQfgPEAVBqC5BAkGeEBAFQfQuQQRBrRAQBUHMJhAZQcAvQQBB9RkQAEHoL0EAQboaEABBkDBBAUGTGhAAQbgwQQJBwhYQAEHgMEEDQeEWEABBiDFBBEGJFxAAQbAxQQVBphcQAEHYMUEEQd8aEABBgDJBBUH9GhAAQegvQQBBjBgQAEGQMEEBQesXEABBuDBBAkHOGBAAQeAwQQNBrBgQAEGIMUEEQdQZEABBsDFBBUGyGRAAQagyQQhBkRkQAEHQMkEJQe8YEABB+DJBBkHMFxAAQaAzQQdBpBsQAAsxAQF/IAAoAgwiASAAKAIQRgRAIAAgACgCACgCKBEAAA8LIAAgAUEBajYCDCABLQAAC2ABBH8gASAAKAIEIgYgA2siB2ohBCAGIQUDQCACIARNBEAgACAFNgIEIAdFIAMgBkZyRQRAIAYgB2sgASAH/AoAAAsFIAUgBC0AADoAACAFQQFqIQUgBEEBaiEEDAELCwsQACAAKAIAIgAEQCAAEB0LCzUBAX8gASAAKAIEIgJBAXVqIQEgACgCACEAIAEgAkEBcQR/IAEoAgAgAGooAgAFIAALEQAAC6ABAQR/IwBBgAJrIgAkACAAIAQ3A/gBIABCJTcD8AEgAEHwAWoiB0EBckGZDiAFIAIoAgQQywEgAEHQAWoiBiAGEC4gByAAQfgBahCJAyAGaiIIIAIQaSEJIABBBGoiByACECcgBiAJIAggAEEQaiIGIABBDGogAEEIaiAHEIADIAcQJSABIAYgACgCDCAAKAIIIAIgAxCFASAAQYACaiQAC6IBAQN/IwBBkAFrIgAkACAAIAQ2AowBIABCJTcDgAEgAEGAAWoiBkEBckGgDiAFIAIoAgQQywEgAEHzAGoiBCAEQQ0QLiAGIABBjAFqEMoBIARqIgcgAhBpIQggAEEEaiIGIAIQJyAEIAggByAAQRBqIgQgAEEMaiAAQQhqIAYQgAMgBhAlIAEgBCAAKAIMIAAoAgggAiADEIUBIABBkAFqJAALnQEBBH8jAEHwAGsiACQAIAAgBDcDaCAAQiU3A2AgAEHgAGoiB0EBckGZDiAFIAIoAgQQywEgAEFAayIGIAYQLiAHIABB6ABqEIkDIAZqIgggAhBpIQkgAEEEaiIHIAIQJyAGIAkgCCAAQRBqIgYgAEEMaiAAQQhqIAcQigMgBxAlIAEgBiAAKAIMIAAoAgggAiADEIABIABB8ABqJAALngEBA38jAEHQAGsiACQAIAAgBDYCTCAAQiU3A0AgAEFAayIGQQFyQaAOIAUgAigCBBDLASAAQTNqIgQgBEENEC4gBiAAQcwAahDKASAEaiIHIAIQaSEIIABBBGoiBiACECcgBCAIIAcgAEEQaiIEIABBDGogAEEIaiAGEIoDIAYQJSABIAQgACgCDCAAKAIIIAIgAxCAASAAQdAAaiQACwcAIAARDwALQgADQCABIAJHBEAgAQJ/IAEsAAAQTARAIAMoAgAgASwAAEECdGooAgAMAQsgAS0AAAs6AAAgAUEBaiEBDAELCyABCz0AA0AgASACRwRAIAEiACAAKAIAEEwEfyADKAIAIAAoAgBBAnRqBSAACygCADYCACAAQQRqIQEMAQsLIAELPwECfyAAKAIEIQMgACgCCCECA0AgAiADRwRAIAAgAiABayICNgIIDAELCyAAKAIAIgIEQCAAKAIMGiACEC0LC0wBAX8CQCABRQ0AIAFBiNgBEFIiAUUNACABKAIIIAAoAghBf3NxDQAgACgCDCABKAIMQQAQO0UNACAAKAIQIAEoAhBBABA7IQILIAILCwBBnBFBABCtAgALgQEBA38gACgCBCIEQQFxIQUCfyABLQA3QQFGBEAgBEEIdSIGIAVFDQEaIAIoAgAgBhDoAQwBCyAEQQh1IAVFDQAaIAEgACgCACgCBDYCOCAAKAIEIQRBACECQQALIQUgACgCACIAIAEgAiAFaiADQQIgBEECcRsgACgCACgCHBEIAAsKACAAIAFBABA7C/gBAQF/IwBBEGsiAiQAIAIgATYCDEGQ1gEoAgAiAiAAIAEQzQMaIAAQqAEgAGpBAWstAABBCkcEQAJAAkAgAigCTCIAQQBOBEAgAEUNAUGU4QEoAgAgAEH/////A3FHDQELAkAgAigCUEEKRg0AIAIoAhQiACACKAIQRg0AIAIgAEEBajYCFCAAQQo6AAAMAgsgAhDeAQwBCyACQcwAaiIBIgAgACgCACIAQf////8DIAAbNgIAAkACQCACKAJQQQpGDQAgAigCFCIAIAIoAhBGDQAgAiAAQQFqNgIUIABBCjoAAAwBCyACEN4BCyABEKwBGgsLEMoDAAsdAQF/IwBBEGsiASQAIAEgADYCAEG9HiABEK0CAAu5AgEDfyMAQSBrIggkAEH3////AyIJIAFBf3NqIAJPBEAgABAjIQogAUHz////AUkEQCAIIAFBAXQ2AhwgCCABIAJqNgIQIAhBEGogCEEcahCgASgCABCQAUEBaiEJCyAIQRxqIAhBGGogABBVKAIAELwBIAhBEGogCRCPASAIKAIQIQIgCCgCFBogBARAIAIgCiAEEGULIAYEQCAEQQJ0IAJqIAcgBhBlCyADIAQgBWoiCWshByADIAlHBEAgBEECdCIDIAJqIAZBAnRqIAMgCmogBUECdGogBxBlCyABQQFqIgFBAkcEQCAKIAEQqQELIAAgAjYCACAAIAgoAhQQXCAAIAQgBmogB2oiADYCBCAIQQA2AgwgAiAAQQJ0aiAIQQxqEFYgCEEcahC7ASAIQSBqJAAPCxBbAAuJAQECfyMAQRBrIgMkACABQff///8HTQRAAkAgARDUAQRAIAAgARBQIAAhBAwBCyADQQhqIAEQnwFBAWoQngEgAygCDBogACADKAIIIgQ2AgAgACADKAIMEFwgACABNgIECyAEIAEgAhCyAiADQQA6AAcgASAEaiADQQdqEF0gA0EQaiQADwsQWwALRAECfyAAECghAyAAEB8hBCACIANNBEAgABAjIgMgASACEE0gACADIAIQwAIPCyAAIAMgAiADayAEQQAgBCACIAEQuQELPQEBfyMAQRBrIgMkACADIAI6AA8DQCABBEAgACADLQAPOgAAIAFBAWshASAAQQFqIQAMAQsLIANBEGokAAsZACAAQYCAgIAETwRAEKoCAAsgAEECdBBTC5IFAQh/QQQgASABQQRNGyEDQQEgACAAQQFNGyEHA0ACQCAHIAMgB2pBAWtBACADa3EiACAAIAdJGyEEQQAhASMAQRBrIggkAAJAIANBA3ENACAEIANwDQACfwJAQTACfyADQQhGBEAgBBA0DAELQRwhASADQQNxIANBBElyDQEgA0ECdiIAIABBAWtxDQFBMEFAIANrIARJDQIaAn9BECEBAkBBEEEQIAMgA0EQTRsiACAAQRBNGyICIAJBAWtxRQRAIAIhAAwBCwNAIAEiAEEBdCEBIAAgAkkNAAsLQUAgAGsgBE0EQEGI6gFBMDYCAEEADAELQQBBECAEQQtqQXhxIARBC0kbIgUgAGpBDGoQNCICRQ0AGiACQQhrIQECQCAAQQFrIAJxRQRAIAEhAAwBCyACQQRrIgkoAgAiBEF4cSAAIAJqQQFrQQAgAGtxQQhrIgIgAEEAIAIgAWtBD00baiIAIAFrIgZrIQIgBEEDcUUEQCABKAIAIQEgACACNgIEIAAgASAGajYCAAwBCyAAIAIgACgCBEEBcXJBAnI2AgQgACACaiICIAIoAgRBAXI2AgQgCSAGIAkoAgBBAXFyQQJyNgIAIAEgBmoiAiACKAIEQQFyNgIEIAEgBhDbAQsCQCAAKAIEIgJBA3FFDQAgAkF4cSIBIAVBEGpNDQAgACAFIAJBAXFyQQJyNgIEIAAgBWoiBCABIAVrIgJBA3I2AgQgACABaiIBIAEoAgRBAXI2AgQgBCACENsBCyAAQQhqCwsiAEUNARogCCAANgIMQQAhAQsgAQshAEEAIAgoAgwgABshAQsgCEEQaiQAIAENAEHk/gEoAgAiAEUNACAAEQwADAELCyABRQRAEOsBCyABCwoAIAEgAGtBDG0LCQAgABAuNgIACyMBAn8gACEBA0AgASICQQRqIQEgAigCAA0ACyACIABrQQJ1Cy8BAX8jAEEQayIDJAACQCAAIAFGBEAgAEEAOgB4DAELIAEgAhCpAQsgA0EQaiQACxAAIAAoAgggACgCAGtBAnULCQAgAEEANgIAC0kBAX8jAEEQayIDJAACQAJAIAJBHksNACABLQB4QQFxDQAgAUEBOgB4DAELIAIQwQIhAQsgA0EQaiQAIAAgAjYCBCAAIAE2AgALOgECfyMAQRBrIgAkACAAQf////8DNgIMIABB/////wc2AgggAEEMaiAAQQhqELUDKAIAIABBEGokAAs0AQF/IwBBEGsiAyQAIAMgARBzNgIMIAMgAhBzNgIIIAAgA0EMaiADQQhqEGYgA0EQaiQAC04BAX8jAEEQayIDJAAgAyABNgIIIAMgADYCDCADIAI2AgRBACEBIANBBGoiACADQQxqENMBRQRAIAAgA0EIahDTASEBCyADQRBqJAAgAQswAQF/IwBBEGsiAyQAIAMgATYCDCADIAI2AgggACADQQxqIANBCGoQZiADQRBqJAALMwEBfyMAQRBrIgMkACAAEB8aIAAgAhCDASADQQA6AA8gASACaiADQQ9qEF0gA0EQaiQACzEAIABB/////wNLBEAQqgIACwJ/IABBAnQhAEEEENYBBEAgAEEEELQCDAELIAAQUwsLCQAgABDtARAtCxUAIABB8KoBNgIAIABBEGoQIBogAAsVACAAQciqATYCACAAQQxqECAaIAALgAMBBH8gAiEAA0ACQCAEIAdNIAAgA09yDQAgACwAACIBQf8BcSEFAn9BASABQQBODQAaIAFBQkkNASABQV9NBEAgAyAA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ZEYNAEEAIQAgC0EANgIQIBEgDygCACALKAJkIAtBEGoQQyALKAIQBEAgBSAFKAIAQQRyNgIADAELQQEhAAsgEBAgGiANECAaIA4QIBogDBAgGiARECAaIA8QNQwDCyACIQELIANBAWohAwwACwALIAtBkARqJAAgAAsMACAAQQFBLRD9AhoLCwAgAEEBQS0QsAILHAEBfyAALQAAIQIgACABLQAAOgAAIAEgAjoAAAtlAQF/IwBBEGsiBiQAIAZBADoADyAGIAU6AA4gBiAEOgANIAZBJToADCAFBEAgBkENaiAGQQ5qEPMCCyACIAEgASACKAIAEIoCIAZBDGogAyAAKAIAEJ4DIAFqNgIAIAZBEGokAAtBACABIAIgAyAEQQQQZyEBIAMtAABBBHFFBEAgACABQdAPaiABQewOaiABIAFB5ABJGyABQcUASBtB7A5rNgIACwtAACACIAMgAEEIaiAAKAIIKAIEEQAAIgAgAEGgAmogBSAEQQAQzQEgAGsiAEGfAkwEQCABIABBDG1BDG82AgALC0AAIAIgAyAAQQhqIAAoAggoAgARAAAiACAAQagBaiAFIARBABDNASAAayIAQacBTARAIAEgAEEMbUEHbzYCAAsLQQAgASACIAMgBEEEEGghASADLQAAQQRxRQRAIAAgAUHQD2ogAUHsDmogASABQeQASRsgAUHFAEgbQewOazYCAAsLQAAgAiADIABBCGogACgCCCgCBBEAACIAIABBoAJqIAUgBEEAEM8BIABrIgBBnwJMBEAgASAAQQxtQQxvNgIACwtAACACIAMgAEEIaiAAKAIIKAIAEQAAIgAgAEGoAWogBSAEQQAQzwEgAGsiAEGnAUwEQCABIABBDG1BB282AgALCxgBAX9BDBBTIgBBADYCCCAAQgA3AgAgAAsEAEECC8oBAQR/IwBBEGsiAyQAAkAgAUH3////A00EQAJAIAEQvQEEQCAAIAEQUCAAIQQMAQsgA0EIaiABEJABQQFqEI8BIAMoAgwaIAAgAygCCCIENgIAIAAgAygCDBBcIAAgATYCBAsjAEEQayIFJAAgBSACNgIMIAQhBiABIQIDQCACBEAgBiAFKAIMNgIAIAJBAWshAiAGQQRqIQYMAQsLIAVBEGokACADQQA2AgQgBCABQQJ0aiADQQRqEFYgA0EQaiQADAELEFsA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hoRCAEKAgICAgIDAwz8QLyAFKQNIIQIgBSkDQCEEDAELIAlC////////P4MgBiAHcq1CMIaEIQILIAAgBDcDACAAIAI3AwggBUGAAWokAAuIEAIFfw9+IwBB0AJrIgUkACAEQv///////z+DIQsgAkL///////8/gyEKIAIgBIVCgICAgICAgICAf4MhDCAEQjCIp0H//wFxIQcCQAJAIAJCMIinQf//AXEiCEH//wFrQYKAfk8EQCAHQf//AWtBgYB+Sw0BCyABUCACQv///////////wCDIg5CgICAgICAwP//AFQgDkKAgICAgIDA//8AURtFBEAgAkKAgICAgIAghCEMDAILIANQIARC////////////AIMiAkKAgICAgIDA//8AVCACQoCAgICAgMD//wBRG0UEQCAEQoCAgICAgCCEIQwgAyEBDAILIAEgDkKAgICAgIDA//8AhYRQBEAgAyACQoCAgICAgMD//wCFhFAEQEIAIQFCgICAgICA4P//ACEMDAMLIAxCgICAgICAwP//AIQhDEIAIQEMAgsgAyACQoCAgICAgMD//wCFhFAEQEIAIQEMAgsgASAOhFAEQEKAgICAgIDg//8AIAwgAiADhFAbIQxCACEBDAILIAIgA4RQBEAgDEKAgICAgIDA//8AhCEMQgAhAQwCCyAOQv///////z9YBEAgBUHAAmogASAKIAEgCiAKUCIGG3lCwABCACAGG3ynIgZBD2sQREEQIAZrIQYgBSkDyAIhCiAFKQPAAiEBCyACQv///////z9WDQAgBUGwAmogAyALIAMgCyALUCIJG3lCwABCACAJG3ynIglBD2sQRCAGIAlqQRBrIQYgBSkDuAIhCyAFKQOwAiEDCyAFQaACaiALQoCAgICAgMAAhCISQg+GIANCMYiEIgJCAEKAgICAsOa8gvUAIAJ9IgRCABBAIAVBkAJqQgAgBSkDqAJ9QgAgBEIAEEAgBUGAAmogBSkDmAJCAYYgBSkDkAJCP4iEIgRCACACQgAQQCAFQfABaiAEQgBCACAFKQOIAn1CABBAIAVB4AFqIAUpA/gBQgGGIAUpA/ABQj+IhCIEQgAgAkIAEEAgBUHQAWogBEIAQgAgBSkD6AF9QgAQQCAFQcABaiAFKQPYAUIBhiAFKQPQAUI/iIQiBEIAIAJCABBAIAVBsAFqIARCAEIAIAUpA8gBfUIAEEAgBUGgAWogAkIAIAUpA7gBQgGGIAUpA7ABQj+IhEIBfSICQgAQQCAFQZABaiADQg+GQgAgAkIAEEAgBUHwAGogAkIAQgAgBSkDqAEgBSkDoAEiDiAFKQOYAXwiBCAOVK18IARCAVatfH1CABBAIAVBgAFqQgEgBH1CACACQgAQQCAGIAggB2tqIghB//8AaiEGAn4gBSkDcCITQgGGIg0gBSkDiAEiD0IBhiAFKQOAAUI/iIR8IhBC5+wAfSIUQiCIIgIgCkKAgICAgIDAAIQiFUIBhiIWQiCIIgR+IhEgAUIBhiIOQiCIIgsgECAUVq0gDSAQVq0gBSkDeEIBhiATQj+IhCAPQj+IfHx8QgF9IhNCIIgiEH58Ig0gEVStIA0gDSATQv////8PgyITIAFCP4giFyAKQgGGhEL/////D4MiCn58Ig1WrXwgBCAQfnwgBCATfiIRIAogEH58Ig8gEVStQiCGIA9CIIiEfCANIA9CIIZ8Ig8gDVStfCAPIA8gFEL/////D4MiFCAKfiINIAIgC358IhEgDVStIBEgESATIA5C/v///w+DIg1+fCIRVq18fCIPVq18IA8gBCAUfiIYIA0gEH58IgQgAiAKfnwiCiALIBN+fCIQQiCIIAogEFatIAQgGFStIAQgClatfHxCIIaEfCIEIA9UrXwgBCAEIBEgAiANfiIKIAsgFH58IgJCIIggAiAKVK1CIIaEfCIKIBFUrSAKIAogEEIghnwiClatfHwiBFatfCAEIAQgCiACQiCGIgIgDSAUfnwgAlStQn+FIgJWIAIgClJxrXwiBFatfCICQv////////8AWARAIBYgF4QhFSAFQdAAaiAEIAJCgICAgICAwABUIgetIguGIgogAiALhiAEQgGIIAdBP3OtiIQiBCADIBIQQCAIQf7/AGogBiAHG0EBayEGIAFCMYYgBSkDWH0gBSkDUCIBQgBSrX0hC0IAIAF9DAELIAVB4ABqIAJCP4YgBEIBiIQiCiACQgGIIgQgAyASEEAgAUIwhiAFKQNofSAFKQNgIgJCAFKtfSELIAEhDkIAIAJ9CyECIAZB//8BTgRAIAxCgICAgICAwP//AIQhDEIAIQEMAQsCfiAGQQBKBEAgC0IBhiACQj+IhCEBIARC////////P4MgBq1CMIaEIQsgAkIBhgwBCyAGQY9/TARAQgAhAQwCCyAFQUBrIAogBEEBIAZrEIoBIAVBMGogDiAVIAZB8ABqEEQgBUEgaiADIBIgBSkDQCIKIAUpA0giCxBAIAUpAzggBSkDKEIBhiAFKQMgIgFCP4iEfSAFKQMwIgIgAUIBhiIEVK19IQEgAiAEfQshAiAFQRBqIAMgEkIDQgAQQCAFIAMgEkIFQgAQQCALIAogAyAKQgGDIgMgAnwiAlQgASACIANUrXwiASASViABIBJRG618IgMgClStfCIEIAMgAyAEQoCAgICAgMD//wBUIAIgBSkDEFYgASAFKQMYIgRWIAEgBFEbca18IgNWrXwiBCADIARCgICAgICAwP//AFQgAiAFKQMAViABIAUpAwgiAlYgASACURtxrXwiASADVK18IAyEIQwLIAAgATcDACAAIAw3AwggBUHQAmokAAu/AgEBfyMAQdAAayIEJAACQCADQYCAAU4EQCAEQSBqIAEgAkIAQoCAgICAgID//wAQLyAEKQMoIQIgBCkDICEBIANB//8BSQRAIANB//8AayEDDAILIARBEGogASACQgBCgICAgICAgP//ABAvQf3/AiADIANB/f8CTxtB/v8BayEDIAQpAxghAiAEKQMQIQEMAQsgA0GBgH9KDQAgBEFAayABIAJCAEKAgICAgICAORAvIAQpA0ghAiAEKQNAIQEgA0H0gH5LBEAgA0GN/wBqIQMMAQsgBEEwaiABIAJCAEKAgICAgICAORAvQeiBfSADIANB6IF9TRtBmv4BaiEDIAQpAzghAiAEKQMwIQELIAQgASACQgAgA0H//wBqrUIwhhAvIAAgBCkDCDcDCCAAIAQpAwA3AwAgBEHQAGokAAs8ACAAIAE3AwAgACACQv///////z+DIAJCgICAgICAwP//AINCMIinIANCMIinQYCAAnFyrUIwhoQ3AwgLwAECAX8CfkF/IQMCQCAAQgBSIAFC////////////AIMiBEKAgICAgIDA//8AViAEQoCAgICAgMD//wBRGw0AIAJC////////////AIMiBUKAgICAgIDA//8AViAFQoCAgICAgMD//wBScQ0AIAAgBCAFhIRQBEBBAA8LIAEgAoNCAFkEQCABIAJSIAEgAlNxDQEgACABIAKFhEIAUg8LIABCAFIgASACVSABIAJRGw0AIAAgASAChYRCAFIhAwsgAws0AQF/IAFBgICAgARPBEAQjAEACyAAIAEQswIiAjYCBCAAIAI2AgAgACACIAFBAnRqNgIICwoAIABBMGtBCkkLFwAgAEEwa0EKSSAAQSByQeEAa0EGSXILEwAgAEEgciAAIABBwQBrQRpJGwspAQF/IAAoAgAiAQRAIAEQvQNBf0cEQCAAKAIARQ8LIABBADYCAAtBAQspAQF/IAAoAgAiAQRAIAEQwwNBf0cEQCAAKAIARQ8LIABBADYCAAtBAQsUACACIAAgASAAayIAEE0gACACagskAQJ/IwBBEGsiAiQAIAEgABDTASEDIAJBEGokACABIAAgAxsLDAAgAEEAIABBf0cbCywBAX8gAUEASARAEIwBAAsgACABEFMiAjYCBCAAIAI2AgAgACABIAJqNgIIC5EBAQN/AkAgASACEIoCIQQjAEEQayIDJAAgBEH3////B00EQAJAIAQQ1AEEQCAAIAQQUCAAIQUMAQsgA0EIaiAEEJ8BQQFqEJ4BIAMoAgwaIAAgAygCCCIFNgIAIAAgAygCDBBcIAAgBDYCBAsgASACIAUQtAMgA0EAOgAHIANBB2oQXSADQRBqJAAMAQsQWwALCw8AIAAgACgCGCABajYCGAsXACAAIAI2AhwgACABNgIUIAAgATYCGAtUAQJ/AkAgACgCACICRQ0AAn8gAigCGCIDIAIoAhxGBEAgAiABIAIoAgAoAjQRBAAMAQsgAiADQQRqNgIYIAMgATYCACABC0F/Rw0AIABBADYCAAsLMQEBfyAAKAIMIgEgACgCEEYEQCAAIAAoAgAoAigRAAAPCyAAIAFBBGo2AgwgASgCAAsnAQF/IAAoAgwiASAAKAIQRgRAIAAgACgCACgCJBEAAA8LIAEoAgALLgEBfyMAQRBrIgEkACABIAA2AgBB6gsgARByEH9BoPEAKAIAEGEaIAFBEGokAAskAQF/AkAgACgCACICRQ0AIAIgARDCA0F/Rw0AIABBADYCAAsLPQEBfyADBEAgACADELcDIAAoAgQhAyACIAFrIgRFIAEgAkZyRQRAIAMgASAE/AoAAAsgACADIARqNgIECwsJACAAEI8CEC0LPQEBfyAAKAIYIgIgACgCHEYEQCAAIAEQowEgACgCACgCNBEEAA8LIAAgAkEBajYCGCACIAE6AAAgARCjAQsqAQF/IAAoAgwiASAAKAIQRgRAIAAgACgCACgCJBEAAA8LIAEsAAAQowELDwAgACAAKAIAKAIYEQAAC6wCAQJ/IwBBEGsiASQAIAAgACgCAEEMaygCAGooAhgEQCABIAA2AgwgAUEAOgAIIAAgACgCAEEMaygCAGoQ2QEEQCAAIAAoAgBBDGsoAgBqKAJIIgIEQCACEMUDCyABQQE6AAgLAkAgAS0ACEUNACAAIAAoAgBBDGsoAgBqKAIYEMQDQX9HDQAgACAAKAIAQQxrKAIAakEBENUBCwJAIAEoAgwiACAAKAIAQQxrKAIAaigCGEUNACABKAIMIgAgACgCAEEMaygCAGoQ2QFFDQAgASgCDCIAIAAoAgBBDGsoAgBqKAIEQYDAAHFFDQAgASgCDCIAIAAoAgBBDGsoAgBqKAIYEMQDQX9HDQAgASgCDCIAIAAoAgBBDGsoAgBqQQEQ1QELCyABQRBqJAALCQAgABCQAhAtCy0AIABByABqEDogAEE8ahA6IABBMGoQOiAAQSRqEDogAEEYahA6IABBDGoQOgsEAEF/C3wBAn8gACAAKAJIIgFBAWsgAXI2AkggACgCFCAAKAIcRwRAIABBAEEAIAAoAiQRAwAaCyAAQQA2AhwgAEIANwMQIAAoAgAiAUEEcQRAIAAgAUEgcjYCAEF/DwsgACAAKAIsIAAoAjBqIgI2AgggACACNgIEIAFBG3RBH3ULBQAQFwALLQAgAEHMAGoQOiAAQUBrEDogAEE0ahA6IABBKGoQOiAAQRxqEDogAEEQahA6CxIAIABFBEBBAA8LIAAgARCWAgsPACAAIAEgAkE0QTUQ0QMLvAIAAkACQAJAAkACQAJAAkACQAJAAkACQCABQQlrDhIACAkKCAkBAgMECgkKCggJBQYHCyACIAIoAgAiAUEEajYCACAAIAEoAgA2AgAPCyACIAIoAgAiAUEEajYCACAAIAEyAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEzAQA3AwAPCyACIAIoAgAiAUEEajYCACAAIAEwAAA3AwAPCyACIAIoAgAiAUEEajYCACAAIAExAAA3AwAPCyACIAIoAgBBB2pBeHEiAUEIajYCACAAIAErAwA5AwAPCyAAIAIgAxEBAAsPCyACIAIoAgAiAUEEajYCACAAIAE0AgA3AwAPCyACIAIoAgAiAUEEajYCACAAIAE1AgA3AwAPCyACIAIoAgBBB2pBeHEiAUEIajYCACAAIAEpAwA3AwALbwEFfyAAKAIAIgMsAABBMGsiAUEJSwRAQQAPCwNAQX8hBCACQcyZs+YATQRAQX8gASACQQpsIgVqIAEgBUH/////B3NLGyEECyAAIANBAWoiBTYCACADLAABIAQhAiAFIQNBMGsiAUEKSQ0ACyACC/oSAhN/An4jAEFAaiIIJAAgCCABNgI8IAhBKWohFyAIQSdqIRggCEEoaiERAkACQAJAAkADQEEAIQcDQCABIQ0gByAOQf////8Hc0oNAiAHIA5qIQ4CQAJAAkACQCABIgctAAAiCwRAA0ACQAJAIAtB/wFxIgFFBEAgByEBDAELIAFBJUcNASAHIQsDQCALLQABQSVHBEAgCyEBDAILIAdBAWohByALLQACIAtBAmoiASELQSVGDQALCyAHIA1rIgcgDkH/////B3MiGUoNCSAABEAgACANIAcQQgsgBw0HIAggATYCPCABQQFqIQdBfyEQAkAgASwAAUEwayIKQQlLDQAgAS0AAkEkRw0AIAFBA2ohB0EBIRIgCiEQCyAIIAc2AjxBACEMAkAgBywAACILQSBrIgFBH0sEQCAHIQoMAQsgByEKQQEgAXQiAUGJ0QRxRQ0AA0AgCCAHQQFqIgo2AjwgASAMciEMIAcsAAEiC0EgayIBQSBPDQEgCiEHQQEgAXQiAUGJ0QRxDQALCwJAIAtBKkYEQAJ/AkAgCiwAAUEwayIBQQlLDQAgCi0AAkEkRw0AAn8gAEUEQCAEIAFBAnRqQQo2AgBBAAwBCyADIAFBA3RqKAIACyEPIApBA2ohAUEBDAELIBINBiAKQQFqIQEgAEUEQCAIIAE2AjxBACESQQAhDwwDCyACIAIoAgAiB0EEajYCACAHKAIAIQ9BAAshEiAIIAE2AjwgD0EATg0BQQAgD2shDyAMQYDAAHIhDAwBCyAIQTxqEM8DIg9BAEgNCiAIKAI8IQELQQAhB0F/IQkCf0EAIAEtAABBLkcNABogAS0AAUEqRgRAAn8CQCABLAACQTBrIgpBCUsNACABLQADQSRHDQAgAUEEaiEBAn8gAEUEQCAEIApBAnRqQQo2AgBBAAwBCyADIApBA3RqKAIACwwBCyASDQYgAUECaiEBQQAgAEUNABogAiACKAIAIgpBBGo2AgAgCigCAAshCSAIIAE2AjwgCUEATgwBCyAIIAFBAWo2AjwgCEE8ahDPAyEJIAgoAjwhAUEBCyEUA0AgByEVQRwhCiABIhMsAAAiB0H7AGtBRkkNCyABQQFqIQEgByAVQTpsakHv8ABqLQAAIgdBAWtB/wFxQQhJDQALIAggATYCPAJAIAdBG0cEQCAHRQ0MIBBBAE4EQCAARQRAIAQgEEECdGogBzYCAAwMCyAIIAMgEEEDdGopAwA3AzAMAgsgAEUNCCAIQTBqIAcgAiAGEM4DDAELIBBBAE4NC0EAIQcgAEUNCAsgAC0AAEEgcQ0LIAxB//97cSILIAwgDEGAwABxGyEMQQAhEEHuCCEWIBEhCgJAAkACfwJAAkACQAJAAkACQAJ/AkACQAJAAkACQAJAAkAgEy0AACIHwCITQVNxIBMgB0EPcUEDRhsgEyAVGyIHQdgAaw4hBBYWFhYWFhYWEBYJBhAQEBYGFhYWFgIFAxYWChYBFhYEAAsCQCAHQcEAaw4HEBYLFhAQEAALIAdB0wBGDQsMFQsgCCkDMCEbQe4IDAULQQAhBwJAAkACQAJAAkACQAJAIBUOCAABAgMEHAUGHAsgCCgCMCAONgIADBsLIAgoAjAgDjYCAAwaCyAIKAIwIA6sNwMADBkLIAgoAjAgDjsBAAwYCyAIKAIwIA46AAAMFwsgCCgCMCAONgIADBYLIAgoAjAgDqw3AwAMFQtBCCAJIAlBCE0bIQkgDEEIciEMQfgAIQcLIBEhASAHQSBxIQsgCCkDMCIbIhpQRQRAA0AgAUEBayIBIBqnQQ9xLQCAdSALcjoAACAaQg9WIBpCBIghGg0ACwsgASENIAxBCHFFIBtQcg0DIAdBBHZB7ghqIRZBAiEQDAMLIBEhASAIKQMwIhsiGlBFBEADQCABQQFrIgEgGqdBB3FBMHI6AAAgGkIHViAaQgOIIRoNAAsLIAEhDSAMQQhxRQ0CIAkgFyABayIBIAEgCUgbIQkMAgsgCCkDMCIbQgBTBEAgCEIAIBt9Ihs3AzBBASEQQe4IDAELIAxBgBBxBEBBASEQQe8IDAELQfAIQe4IIAxBAXEiEBsLIRYgGyAREKYBIQ0LIBQgCUEASHENESAMQf//e3EgDCAUGyEMIBtCAFIgCXJFBEAgESENQQAhCQwOCyAJIBtQIBEgDWtqIgEgASAJSBshCQwNCyAILQAwIQcMCwsgCCgCMCIBQZUcIAEbIg1BAEH/////ByAJIAlB/////wdPGyIHEOABIgEgDWsgByABGyIBIA1qIQogCUEATgRAIAshDCABIQkMDAsgCyEMIAEhCSAKLQAADQ8MCwsgCCkDMCIaUEUNAUEAIQcMCQsgCQRAIAgoAjAMAgtBACEHIABBICAPQQAgDBBFDAILIAhBADYCDCAIIBo+AgggCCAIQQhqIgc2AjBBfyEJIAcLIQtBACEHA0ACQCALKAIAIg1FDQAgCEEEaiANEMwDIg1BAEgNDyANIAkgB2tLDQAgC0EEaiELIAcgDWoiByAJSQ0BCwtBPSEKIAdBAEgNDCAAQSAgDyAHIAwQRSAHRQRAQQAhBwwBC0EAIQogCCgCMCELA0AgCygCACINRQ0BIAhBBGoiCSANEMwDIg0gCmoiCiAHSw0BIAAgCSANEEIgC0EEaiELIAcgCksNAAsLIABBICAPIAcgDEGAwABzEEUgDyAHIAcgD0gbIQcMCAsgFCAJQQBIcQ0JQT0hCiAAIAgrAzAgDyAJIAwgByAFESAAIgdBAE4NBwwKCyAHLQABIQsgB0EBaiEHDAALAAsgAA0JIBJFDQNBASEHA0AgBCAHQQJ0aigCACIABEAgAyAHQQN0aiAAIAIgBhDOA0EBIQ4gB0EBaiIHQQpHDQEMCwsLIAdBCk8EQEEBIQ4MCgsDQCAEIAdBAnRqKAIADQFBASEOIAdBAWoiB0EKRw0ACwwJC0EcIQoMBgsgCCAHOgAnQQEhCSAYIQ0gCyEMCyAJIAogDWsiCyAJIAtKGyIBIBBB/////wdzSg0DQT0hCiAPIAEgEGoiCSAJIA9IGyIHIBlLDQQgAEEgIAcgCSAMEEUgACAWIBAQQiAAQTAgByAJIAxBgIAEcxBFIABBMCABIAtBABBFIAAgDSALEEIgAEEgIAcgCSAMQYDAAHMQRSAIKAI8IQEMAQsLC0EAIQ4MAwtBPSEKC0GI6gEgCjYCAAtBfyEOCyAIQUBrJAAgDgvCAgEEfyMAQdABayIFJAAgBSACNgLMASAFQaABaiICQQBBKPwLACAFIAUoAswBNgLIAQJAQQAgASAFQcgBaiAFQdAAaiACIAMgBBDQA0EASARAQX8hBAwBCyAAKAJMQQBIIAAgACgCACIIQV9xNgIAAn8CQAJAIAAoAjBFBEAgAEHQADYCMCAAQQA2AhwgAEIANwMQIAAoAiwhBiAAIAU2AiwMAQsgACgCEA0BC0F/IAAQ3wENARoLIAAgASAFQcgBaiAFQdAAaiAFQaABaiADIAQQ0AMLIQIgBgRAIABBAEEAIAAoAiQRAwAaIABBADYCMCAAIAY2AiwgAEEANgIcIAAoAhQhASAAQgA3AxAgAkF/IAEbIQILIAAgACgCACIAIAhBIHFyNgIAQX8gAiAAQSBxGyEEDQALIAVB0AFqJAAgBAt/AgF/AX4gAL0iA0I0iKdB/w9xIgJB/w9HBHwgAkUEQCABIABEAAAAAAAAAABhBH9BAAUgAEQAAAAAAADwQ6IgARDSAyEAIAEoAgBBQGoLNgIAIAAPCyABIAJB/gdrNgIAIANC/////////4eAf4NCgICAgICAgPA/hL8FIAALCz4BAX8jAEEQayIBJAAgASAANgIMAn8gAEEETwRAQZ0fIAFBDGoQlwJBAAwBCyAAQQJ0KAKILQsgAUEQaiQACwYAIAEQLQsJACABIAJsEDQLJQECfyAAKAIEIgAQqAFBAWoiARA0IgIEfyACIAAgARBxBUEACwsNACAAKAIEIAAoAgBrCzABAX8jAEEQayIEJAAgACgCACEAIAQgAzoADyABIAIgBEEPaiAAEQMAIARBEGokAAuNAgIBfwF8IwBBEGsiAyQAIANBDmogASACIAAoAgARBQAgAyADLwAOOwEMIwBBEGsiASQAAkAgAy0ADUEBRgRAIwBBEGsiAiQAQazgAS0AAEEBcUUEQEECQYQsQQMQDyEAQazgAUEBOgAAQajgASAANgIACyACIAMtAAw2AgggAkEANgIEQajgASgCAEEAQQAgAkEEaiACQQhqEA4hBCACIAIoAgQ2AgAgAUEIaiIAIAT8AzYCBCAAQfzgATYCACACEJ8CIAJBEGokACAAKAIEIQIgAEEANgIEIAAQtQEMAQsgAUEANgIMIAFB/OABNgIIIAFBCGoQtQFBAiECCyABQRBqJAAgA0EQaiQAIAILVAECfyMAQRBrIgQkACABIAAoAgQiBUEBdWohASAAKAIAIQAgBUEBcQRAIAEoAgAgAGooAgAhAAsgBCADOgAPIAEgAiAEQQ9qIAARBQAgBEEQaiQAC1IBAn8jAEEQayIDJAAgASAAKAIEIgRBAXVqIQEgACgCACEAIARBAXEEQCABKAIAIABqKAIAIQALIAMgAjoADyABIANBD2ogABEBACADQRBqJAALMAEBfyMAQRBrIgQkACAAKAIAIQAgBCADOAIMIAEgAiAEQQxqIAARAwAgBEEQaiQAC40CAgF/AXwjAEEQayIDJAAgA0EIaiABIAIgACgCABEFACADIAMpAgg3AwAjAEEQayIBJAACQCADLQAEQQFGBEAjAEEQayICJABBoOABLQAAQQFxRQRAQQJBxCZBAxAPIQBBoOABQQE6AABBnOABIAA2AgALIAIgAyoCADgCCCACQQA2AgRBnOABKAIAQQBBACACQQRqIAJBCGoQDiEEIAIgAigCBDYCACABQQhqIgAgBPwDNgIEIABB/OABNgIAIAIQnwIgAkEQaiQAIAAoAgQhAiAAQQA2AgQgABC1AQwBCyABQQA2AgwgAUH84AE2AgggAUEIahC1AUECIQILIAFBEGokACADQRBqJAAgAgtUAQJ/IwBBEGsiBCQAIAEgACgCBCIFQQF1aiEBIAAoAgAhACAFQQFxBEAgASgCACAAaigCACEACyAEIAM4AgwgASACIARBDGogABEFACAEQRBqJAALUgECfyMAQRBrIgMkACABIAAoAgQiBEEBdWohASAAKAIAIQAgBEEBcQRAIAEoAgAgAGooAgAhAAsgAyACOAIMIAEgA0EMaiAAEQEAIANBEGokAAsbACAAIAEoAgggBRA7BEAgASACIAMgBBDnAQsLOAAgACABKAIIIAUQOwRAIAEgAiADIAQQ5wEPCyAAKAIIIgAgASACIAMgBCAFIAAoAgAoAhQRCgALkgIBBn8gACABKAIIIAUQOwRAIAEgAiADIAQQ5wEPCyABLQA1IAAoAgwhBiABQQA6ADUgAS0ANCABQQA6ADQgAEEQaiIJIAEgAiADIAQgBRDlASABLQA0IgpyIQggAS0ANSILciEHAkAgBkECSQ0AIAkgBkEDdGohCSAAQRhqIQYDQCABLQA2DQECQCAKQQFxBEAgASgCGEEBRg0DIAAtAAhBAnENAQwDCyALQQFxRQ0AIAAtAAhBAXFFDQILIAFBADsBNCAGIAEgAiADIAQgBRDlASABLQA1IgsgB3JBAXEhByABLQA0IgogCHJBAXEhCCAGQQhqIgYgCUkNAAsLIAEgB0EBcToANSABIAhBAXE6ADQLkgEAIAAgASgCCCAEEDsEQCABIAIgAxDmAQ8LAkAgACABKAIAIAQQO0UNAAJAIAEoAhAgAkcEQCACIAEoAhRHDQELIANBAUcNASABQQE2AiAPCyABIAI2AhQgASADNgIgIAEgASgCKEEBajYCKAJAIAEoAiRBAUcNACABKAIYQQJHDQAgAUEBOgA2CyABQQQ2AiwLC/YBACAAIAEoAgggBBA7BEAgASACIAMQ5gEPCwJAIAAgASgCACAEEDsEQAJAIAEoAhAgAkcEQCACIAEoAhRHDQELIANBAUcNAiABQQE2AiAPCyABIAM2AiACQCABKAIsQQRGDQAgAUEAOwE0IAAoAggiACABIAIgAkEBIAQgACgCACgCFBEKACABLQA1QQFGBEAgAUEDNgIsIAEtADRFDQEMAwsgAUEENgIsCyABIAI2AhQgASABKAIoQQFqNgIoIAEoAiRBAUcNASABKAIYQQJHDQEgAUEBOgA2DwsgACgCCCIAIAEgAiADIAQgACgCACgCGBELAAsLrwQBA38gACABKAIIIAQQOwRAIAEgAiADEOYBDwsCQAJAIAAgASgCACAEEDsEQAJAIAEoAhAgAkcEQCACIAEoAhRHDQELIANBAUcNAyABQQE2AiAPCyABIAM2AiAgASgCLEEERg0BIABBEGoiBSAAKAIMQQN0aiEHQQAhAwNAAkACQCABAn8CQCAFIAdPDQAgAUEAOwE0IAUgASACIAJBASAEEOUBIAEtADYNACABLQA1QQFHDQMgAS0ANEEBRgRAIAEoAhhBAUYNA0EBIQNBASEGIAAtAAhBAnFFDQMMBAtBASEDIAAtAAhBAXENA0EDDAELQQNBBCADGws2AiwgBg0FDAQLIAFBAzYCLAwECyAFQQhqIQUMAAsACyAAKAIMIQUgAEEQaiIGIAEgAiADIAQQtwEgBUECSQ0BIAYgBUEDdGohBiAAQRhqIQUCQCAAKAIIIgBBAnFFBEAgASgCJEEBRw0BCwNAIAEtADYNAyAFIAEgAiADIAQQtwEgBUEIaiIFIAZJDQALDAILIABBAXFFBEADQCABLQA2DQMgASgCJEEBRg0DIAUgASACIAMgBBC3ASAFQQhqIgUgBkkNAAwDCwALA0AgAS0ANg0CIAEoAiRBAUYEQCABKAIYQQFGDQMLIAUgASACIAMgBBC3ASAFQQhqIgUgBkkNAAsMAQsgASACNgIUIAEgASgCKEEBajYCKCABKAIkQQFHDQAgASgCGEECRw0AIAFBAToANgsLjgUBBH8jAEFAaiIEJAACQCABQaDZAUEAEDsEQCACQQA2AgBBASEFDAELAkAgACABIAAtAAhBGHEEf0EBBSABRQ0BIAFB9NYBEFIiA0UNASADLQAIQRhxQQBHCxA7IQYLIAYEQEEBIQUgAigCACIARQ0BIAIgACgCADYCAAwBCwJAIAFFDQAgAUGk1wEQUiIGRQ0BIAIoAgAiAQRAIAIgASgCADYCAAsgBigCCCIDIAAoAggiAUF/c3FBB3EgA0F/cyABcUHgAHFyDQFBASEFIAAoAgwgBigCDEEAEDsNASAAKAIMQZTZAUEAEDsEQCAGKAIMIgBFDQIgAEHU1wEQUkUhBQwCCyAAKAIMIgNFDQBBACEFIANBpNcBEFIiAQRAIAAtAAhBAXFFDQICfyAGKAIMIQBBACECAkADQEEAIABFDQIaIABBpNcBEFIiA0UNASADKAIIIAEoAghBf3NxDQFBASABKAIMIAMoAgxBABA7DQIaIAEtAAhBAXFFDQEgASgCDCIARQ0BIABBpNcBEFIiAQRAIAMoAgwhAAwBCwsgAEGI2AEQUiIARQ0AIAAgAygCDBCpAiECCyACCyEFDAILIANBiNgBEFIiAQRAIAAtAAhBAXFFDQIgASAGKAIMEKkCIQUMAgsgA0HE1gEQUiIBRQ0BIAYoAgwiAEUNASAAQcTWARBSIgBFDQEgAigCACEDIARBCGpBAEE4/AsAIAQgA0EARzoAOyAEQX82AhAgBCABNgIMIAQgADYCBCAEQQE2AjQgACAEQQRqIANBASAAKAIAKAIcEQgAIAQoAhwiAEEBRgRAIAIgBCgCFEEAIAMbNgIACyAAQQFGIQUMAQtBACEFCyAEQUBrJAAgBQtvAQJ/IAAgASgCCEEAEDsEQCABIAIgAxDpAQ8LIAAoAgwhBCAAQRBqIgUgASACIAMQqwICQCAEQQJJDQAgBSAEQQN0aiEEIABBGGohAANAIAAgASACIAMQqwIgAS0ANg0BIABBCGoiACAESQ0ACwsLMgAgACABKAIIQQAQOwRAIAEgAiADEOkBDwsgACgCCCIAIAEgAiADIAAoAgAoAhwRCAALGQAgACABKAIIQQAQOwRAIAEgAiADEOkBCwvIAQECfyMAQdAAayIDJAACQAJ/QQEgACABQQAQOw0AGkEAIAFFDQAaQQAgAUHE1gEQUiIBRQ0AGiACKAIAIgRFDQEgA0EYakEAQTj8CwAgA0EBOgBLIANBfzYCICADIAA2AhwgAyABNgIUIANBATYCRCABIANBFGogBEEBIAEoAgAoAhwRCAAgAygCLCIAQQFGBEAgAiADKAIkNgIACyAAQQFGCyADQdAAaiQADwsgA0GeFjYCCCADQecDNgIEIANBig02AgAQPQALAwAACxEBAX9BBBBTIgBBADYCACAACwkAQaD0ARA5GgslAEGs9AEtAABFBEBBoPQBQdisARCRAUGs9AFBAToAAAtBoPQBCwkAQZD0ARAgGgskAEGc9AEtAABFBEBBkPQBQc4NELABQZz0AUEBOgAAC0GQ9AELCQBBgPQBEDkaCyUAQYz0AS0AAEUEQEGA9AFBhKwBEJEBQYz0AUEBOgAAC0GA9AELCQBB8PMBECAaCyQAQfzzAS0AAEUEQEHw8wFBmRUQsAFB/PMBQQE6AAALQfDzAQsJAEHg8wEQORoLqQIBBH8gAiABIAAoAgBqIgBHBEACQCACKAIEIgQgAigCACIBa0ECdSIGIAAoAgggACgCACICa0ECdU0EQCAGIAAoAgQiAyACayIFQQJ1SwRAIAIgA0cEQCAFBEAgAiABIAX8CgAACyAAKAIEIQMLIAQgASAFaiIBayICRSABIARGckUEQCADIAEgAvwKAAALIAAgAiADajYCBAwCCyAEIAFrIgNFIAEgBEZyRQRAIAIgASAD/AoAAAsgACACIANqNgIEDAELIAAoAgAiAgRAIAAgAjYCBCAAKAIIGiACEC0gAEEANgIIIABCADcCAAsgACAAIAYQtgEQrgMgACgCBCECIAQgAWsiA0UgASAERnJFBEAgAiABIAP8CgAACyAAIAIgA2o2AgQLCwslAEHs8wEtAABFBEBB4PMBQeCrARCRAUHs8wFBAToAAAtB4PMBCwkAQeTeARAgGgsaAEHd8wEtAABFBEBB3fMBQQE6AAALQeTeAQsJAEHQ8wEQORoLJQBB3PMBLQAARQRAQdDzAUG8qwEQkQFB3PMBQQE6AAALQdDzAQsJAEHY3gEQIBoLGgBBzfMBLQAARQRAQc3zAUEBOgAAC0HY3gELGwBBqPwBIQADQCAAQQxrEDkiAEGQ/AFHDQALC1QAQczzAS0AAARAQcjzASgCAA8LQaj8AS0AAEUEQEGo/AFBAToAAAtBkPwBQfjUARApQZz8AUGE1QEQKUHM8wFBAToAAEHI8wFBkPwBNgIAQZD8AQsbAEGI/AEhAANAIABBDGsQICIAQfD7AUcNAAsLFQAgASAAKAIAaiEAQQwQUyAAEIEBC1IAQcTzAS0AAARAQcDzASgCAA8LQYj8AS0AAEUEQEGI/AFBAToAAAtB8PsBQdEVECpB/PsBQc4VECpBxPMBQQE6AABBwPMBQfD7ATYCAEHw+wELGwBB4PsBIQADQCAAQQxrEDkiAEHA+QFHDQALC7ACAEG88wEtAAAEQEG48wEoAgAPC0Hg+wEtAABFBEBB4PsBQQE6AAALQcD5AUHw0AEQKUHM+QFBkNEBEClB2PkBQbTRARApQeT5AUHM0QEQKUHw+QFB5NEBEClB/PkBQfTRARApQYj6AUGI0gEQKUGU+gFBnNIBEClBoPoBQbjSARApQaz6AUHg0gEQKUG4+gFBgNMBEClBxPoBQaTTARApQdD6AUHI0wEQKUHc+gFB2NMBEClB6PoBQejTARApQfT6AUH40wEQKUGA+wFB5NEBEClBjPsBQYjUARApQZj7AUGY1AEQKUGk+wFBqNQBEClBsPsBQbjUARApQbz7AUHI1AEQKUHI+wFB2NQBEClB1PsBQejUARApQbzzAUEBOgAAQbjzAUHA+QE2AgBBwPkBCxsAQbD5ASEAA0AgAEEMaxAgIgBBkPcBRw0ACwuYAgBBtPMBLQAABEBBsPMBKAIADwtBsPkBLQAARQRAQbD5AUEBOgAAC0GQ9wFBmwgQKkGc9wFBkggQKkGo9wFBzQ8QKkG09wFBnA4QKkHA9wFB4QgQKkHM9wFBhxEQKkHY9wFBowgQKkHk9wFBkwkQKkHw9wFB1QwQKkH89wFBxAwQKkGI+AFBzAwQKkGU+AFB3wwQKkGg+AFB6g0QKkGs+AFBlRUQKkG4+AFBhg0QKkHE+AFB9gsQKkHQ+AFB4QgQKkHc+AFB3g0QKkHo+AFBkA4QKkH0+AFB0w8QKkGA+QFByg0QKkGM+QFBngoQKkGY+QFBiwkQKkGk+QFB+BQQKkG08wFBAToAAEGw8wFBkPcBNgIAQZD3AQsbAEGI9wEhAANAIABBDGsQOSIAQeD1AUcNAAsLzAEAQazzAS0AAARAQajzASgCAA8LQYj3AS0AAEUEQEGI9wFBAToAAAtB4PUBQZzOARApQez1AUG4zgEQKUH49QFB1M4BEClBhPYBQfTOARApQZD2AUGczwEQKUGc9gFBwM8BEClBqPYBQdzPARApQbT2AUGA0AEQKUHA9gFBkNABEClBzPYBQaDQARApQdj2AUGw0AEQKUHk9gFBwNABEClB8PYBQdDQARApQfz2AUHg0AEQKUGs8wFBAToAAEGo8wFB4PUBNgIAQeD1AQsbAEHY9QEhAANAIABBDGsQICIAQbD0AUcNAAsLvgEAQaTzAS0AAARAQaDzASgCAA8LQdj1AS0AAEUEQEHY9QFBAToAAAtBsPQBQcwIECpBvPQBQdMIECpByPQBQbEIECpB1PQBQbkIECpB4PQBQagIECpB7PQBQdoIECpB+PQBQcMIECpBhPUBQdoNECpBkPUBQeINECpBnPUBQeoQECpBqPUBQasTECpBtPUBQY8JECpBwPUBQbIPECpBzPUBQcIKECpBpPMBQQE6AABBoPMBQbD0ATYCAEGw9AELDwAgASAAKAIAaiACOgAACwsAIABBpKsBEJEBCwoAIABB7hAQsAELCwAgAEGQqwEQkQELCgAgAEHlEBCwAQsMACAAIAFBEGoQ5AELDAAgACABQQxqEOQBCwcAIAAsAAkLBwAgACwACAsJACAAEMMCEC0LDQAgASAAKAIAai0AAAsJACAAEMQCEC0LFQAgACgCCCIARQRAQQEPCyAAEMwCC44BAQZ/A0ACQCACIANGIAQgCE1yDQBBASEGIAAoAgghByMAQRBrIgUkACAFIAc2AgwgBUEIaiAFQQxqEGNBACACIAMgAmsgAUH07wEgARsQ0gEhChBiIAVBEGokAAJAAkAgCiIFQQJqDgMCAgEACyAFIQYLIAhBAWohCCAGIAlqIQkgAiAGaiECDAELCyAJC0YBAn8gACgCCCECIwBBEGsiASQAIAEgAjYCDCABQQhqIAFBDGoQYxBiIAFBEGokACAAKAIIIgBFBEBBAQ8LIAAQzAJBAUYLiQEBAn8jAEEQayIGJAAgBCACNgIAAn9BAiAGQQxqIgVBACAAKAIIEO4BIgBBAWpBAkkNABpBASAAQQFrIgIgAyAEKAIAa0sNABoDfyACBH8gBS0AACEAIAQgBCgCACIBQQFqNgIAIAEgADoAACACQQFrIQIgBUEBaiEFDAEFQQALCwsgBkEQaiQAC7kGAQ1/IwBBEGsiESQAIAIhCANAAkAgAyAIRgRAIAMhCAwBCyAILQAARQ0AIAhBAWohCAwBCwsgByAFNgIAIAQgAjYCAANAAkACfwJAIAIgA0YgBSAGRnINACARIAEpAgA3AwggACgCCCEJIwBBEGsiECQAIBAgCTYCDCAQQQhqIBBBDGoQYyAIIAJrIQ5BACELIwBBkAhrIgwkACAMIAQoAgAiCTYCDCAFIAxBEGogBRshDwJAAkACQCAJRSAGIAVrQQJ1QYACIAUbIg1FckUEQANAIA5BgwFLIA5BAnYiCiANT3JFBEAgCSEKDAQLIA8gDEEMaiAKIA0gCiANSRsgARCbAyESIAwoAgwhCiASQX9GBEBBACENQX8hCwwDCyANIBJBACAPIAxBEGpHGyIUayENIA8gFEECdGohDyAJIA5qIAprQQAgChshDiALIBJqIQsgCkUNAiAKIQkgDQ0ADAILAAsgCSEKCyAKRQ0BCyANRSAORXINACALIQkDQAJAAkAgDyAKIA4gARDSASILQQJqQQJNBEACQAJAIAtBAWoOAgYAAQsgDEEANgIMDAILIAFBADYCAAwBCyAMIAwoAgwgC2oiCjYCDCAJQQFqIQkgDUEBayINDQELIAkhCwwCCyAPQQRqIQ8gDiALayEOIAkhCyAODQALCyAFBEAgBCAMKAIMNgIACyAMQZAIaiQAEGIgEEEQaiQAAkACQAJAAkAgCyIJQX9GBEADQCAHIAU2AgAgAiAEKAIARg0GQQEhBgJAAkACQCAFIAIgCCACayARQQhqIAAoAggQzQIiAUECag4DBwACAQsgBCACNgIADAQLIAEhBgsgAiAGaiECIAcoAgBBBGohBQwACwALIAcgBygCACAJQQJ0aiIFNgIAIAUgBkYNAyAEKAIAIQIgAyAIRg0GIAUgAkEBIAEgACgCCBDNAkUNAQtBAgwECyAHIAcoAgBBBGoiBTYCACAEIAQoAgBBAWoiAjYCACACIQgDQCADIAhGDQUgCC0AAEUNBiAIQQFqIQgMAAsACyAEIAI2AgBBAQwCCyAEKAIAIQILIAIgA0cLIBFBEGokAA8LIAMhCAwACwALpgUBDH8jAEEQayIPJAAgAiEIA0ACQCADIAhGBEAgAyEIDAELIAgoAgBFDQAgCEEEaiEIDAELCyAHIAU2AgAgBCACNgIAAkADQAJAAkAgAiADRiAFIAZGcgR/IAIFIA8gASkCADcDCEEBIRAgBSEJIAYgBWshCyAAKAIIIQpBACENIwBBEGsiDiQAIA4gCjYCDCAOQQhqIA5BDGoQYyMAQRBrIhEkAAJAIAQoAgAiCkUgCCACa0ECdSISRXINACALQQAgBRshCwNAIBFBDGogCSALQQRJGyAKKAIAEJYCIgxBf0YEQEF/IQ0MAgsgCQR/IAtBA00EQCALIAxJDQMgCSARQQxqIAwQcRoLIAsgDGshCyAJIAxqBUEACyEJIAooAgBFBEBBACEKDAILIAwgDWohDSAKQQRqIQogEkEBayISDQALCyAJBEAgBCAKNgIACyARQRBqJAAQYiAOQRBqJAACQAJAAkACQCANIglBAWoOAgAIAQsgByAFNgIAA0AgAiAEKAIARg0CIAUgAigCACAAKAIIEO4BIgFBf0YNAiAHIAcoAgAgAWoiBTYCACACQQRqIQIMAAsACyAHIAcoAgAgCWoiBTYCACAFIAZGDQEgAyAIRgRAIAQoAgAhAiADIQgMBgsgD0EEaiICQQAgACgCCBDuASIIQX9GDQQgBiAHKAIAayAISQ0GA0AgCARAIAItAAAhBSAHIAcoAgAiCUEBajYCACAJIAU6AAAgCEEBayEIIAJBAWohAgwBCwsgBCAEKAIAQQRqIgI2AgAgAiEIA0AgAyAIRgRAIAMhCAwFCyAIKAIARQ0EIAhBBGohCAwACwALIAQgAjYCAAwDCyAEKAIACyADRyEQDAMLIAcoAgAhBQwBCwtBAiEQCyAPQRBqJAAgEAsJACAAENsCEC0LMwAjAEEQayIAJAAgACAENgIMIAAgAyACazYCCCAAQQxqIABBCGoQtQMoAgAgAEEQaiQACzsAA0AgASACRkUEQCADIQAgBCABLAAAEEwEfyABLQAABSAACzoAACAEQQFqIQQgAUEBaiEBDAELCyABCwsAIAEgAiABEEwbCyoAA0AgASACRkUEQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohAQwBCwsgAQsPACAAIAEgAkGgkAEQpgILHQAgARBMBH9BoJABKAIAIAFBAnRqKAIABSABC8ALDwAgACABIAJBmIQBEKYCCyEAIAEQTAR/QZiEASgCACABQf8BcUECdGooAgAFIAELwAsJACAAENACEC0LOwADQCABIAJGRQRAIAMhACAEIAEoAgAQTAR/IAEoAgAFIAALOgAAIARBAWohBCABQQRqIQEMAQsLIAELDAAgASACIAEQTBvACyoAA0AgASACRkUEQCADIAEsAAA2AgAgA0EEaiEDIAFBAWohAQwBCwsgAQsPACAAIAEgAkGgkAEQpwILHAAgARBMBH9BoJABKAIAIAFBAnRqKAIABSABCwsPACAAIAEgAkGYhAEQpwILHAAgARBMBH9BmIQBKAIAIAFBAnRqKAIABSABCwsQACAABEAgABDHAwsgABAtCzoAA0ACQCACIANGDQAgAigCABBMRQ0AIAIoAgBBAnRBkKIBaigCACABcUUNACACQQRqIQIMAQsLIAILOQADQAJAIAIgA0YNACACKAIAEEwEQCACKAIAQQJ0QZCiAWooAgAgAXENAQsgAkEEaiECDAELCyACC0YAA0AgASACRkUEQEEAIQAgAyABKAIAEEwEfyABKAIAQQJ0QZCiAWooAgAFQQALNgIAIANBBGohAyABQQRqIQEMAQsLIAELIwBBACEAIAIQTAR/IAJBAnRBkKIBaigCACABcUEARwVBAAsLDwAgACAAKAIAKAIEEQIACwkAIAAQ1gIQLQsVAQF/QdQAEFMiAEEAQdQA/AsAIAALFAAgACgCACABaiACLQAAOgAAQQELrgEAAkAgBRBHRQRAIAAgBSkCADcCACAAIAUoAgg2AgggABBeGgwBCyAFKAIAIQQgBSgCBCECIwBBEGsiAyQAAkACQAJAIAIQvQEEQCAAIgEgAhBQDAELIAJB9////wNLDQEgA0EIaiACEJABQQFqEI8BIAMoAgwaIAAgAygCCCIBNgIAIAAgAygCDBBcIAAgAjYCBAsgASAEIAJBAWoQZSADQRBqJAAMAQsQWwALCwsJACAAIAUQ5AELhAMBCH8jAEHgA2siACQAIABB3ANqIgYgAxAnIAYQSCEKIAUQHwRAIAVBABDMASgCACAKQS0QS0YhCwsgAiALIABB3ANqIABB2ANqIABB1ANqIABB0ANqIABBxANqECQiDCAAQbgDahAkIgYgAEGsA2oQJCIHIABBqANqEN8CIABB4wA2AhAgAEEIakEAIABBEGoiAhA2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KAK8ASAEEI8DOQMAIABBzAFqIABBEGogACgCDCAEEEMgAEHcAmogAEHYAmoQKwRAIAQgBCgCAEECcjYCAAsgACgC3AIgARAgGiAAQcwBahAgGiAAQeACaiQADAMLQQEhAwsgAEHcAmoQPhoMAAsACwvKBAEDfwJ/IwBB4AJrIgAkACAAIAI2AtgCIAAgATYC3AIgAEHMAWogAyAAQeABaiAAQdwBaiAAQdgBahD7ASAAQcABahAkIgEgARAoECEgACABQQAQIiICNgK8ASAAIABBEGo2AgwgAEEANgIIIABBAToAByAAQcUAOgAGQQAhAwNAAkACQAJAIABB3AJqIABB2AJqECsNACAAKAK8ASABEB8gAmpGBEAgARAfIQYgASABEB9BAXQQISABIAEQKBAhIAAgBiABQQAQIiICajYCvAELIABB3AJqEDcgAEEHaiAAQQZqIAIgAEG8AWogACgC3AEgACgC2AEgAEHMAWogAEEQaiAAQQxqIABBCGogAEHgAWoQ+gENACADDQFBACEDIAAoArwBIAJrIgdBAEwNAgJAAkAgAi0AACIGQStrIggOAwEAAQALIAZBLkYNAkEBIQMgBkEwa0H/AXFBCkkNAwwBCyAHQQFGDQICQCAIDgMAAwADCyACLQABIgZBLkYNAUEBIQMgBkEwa0H/AXFBCU0NAgsCQCAAQcwBahAfRQ0AIAAtAAdBAXFFDQAgACgCDCIDIABBEGprQZ8BSg0AIAAgA0EEajYCDCADIAAoAgg2AgALIAUgAiAAKAK8ASAEEJEDOAIAIABBzAFqIABBEGogACgCDCAEEEMgAEHcAmogAEHYAmoQKwRAIAQgBCgCAEECcjYCAAsgACgC3AIgARAgGiAAQcwBahAgGiAAQeACaiQADAMLQQEhAwsgAEHcAmoQPhoMAAsACwuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtBnwFKDQAgACADQQRqNgIMIAMgACgCCDYCAAsgBSACIAAoArQBIAQgBhCSAzcDACAAQcQBaiAAQRBqIAAoAgwgBBBDIABBzAJqIABByAJqECsEQCAEIAQoAgBBAnI2AgALIAAoAswCIAEQIBogAEHEAWoQIBogAEHQAmokAAuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtBnwFKDQAgACADQQRqNgIMIAMgACgCCDYCAAsgBSACIAAoArQBIAQgBhCVAzsBACAAQcQBaiAAQRBqIAAoAgwgBBBDIABBzAJqIABByAJqECsEQCAEIAQoAgBBAnI2AgALIAAoAswCIAEQIBogAEHEAWoQIBogAEHQAmokAAuWAwECfyMAQdACayIAJAAgACACNgLIAiAAIAE2AswCIAMQaiEGIAMgAEHQAWoQrgEhByAAQcQBaiADIABBxAJqEK0BIABBuAFqECQiASABECgQISAAIAFBABAiIgI2ArQBIAAgAEEQajYCDCAAQQA2AggDQAJAIABBzAJqIABByAJqECsNACAAKAK0ASABEB8gAmpGBEAgARAfIQMgASABEB9BAXQQISABIAEQKBAhIAAgAyABQQAQIiICajYCtAELIABBzAJqIgMQNyAGIAIgAEG0AWogAEEIaiAAKALEAiAAQcQBaiAAQRBqIABBDGogBxCYAQ0AIAMQPhoMAQsLAkAgAEHEAWoQH0UNACAAKAIMIgMgAEEQamtB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DCECDAYLIANBIHIhAyABQQRqIQIgBEEEayEEIAEtAAMgCHQgB2ohBwsCQCAFQQRxRQ0AIAcgBigCIEYNACAKQd4ONgIYIAZB0f4ANgIEIAIhASAGKAIEIQUMAQsLIAIhAUEAIQdBACEDCyAGQdD+ADYCBAtBASECDAELQQAhBCAMIQILIAogDzYCECAKIBA2AgwgCiAENgIEIAogATYCACAGIAM2AkAgBiAHNgI8AkACQCAGKAIsRQRAIA8gFUYNASAGKAIEQdD+AEsNAQsCfyAVIA9rIQMCQAJAIAooAhwiASgCOCIMRQRAQQEhBSABIAooAihBASABKAIodEEBIAooAiARAwAiDDYCOCAMRQ0BCyABKAIsIgRFBEAgAUIANwIwIAFBASABKAIodCIENgIsCyADIARPBEAgBARAIAwgECAEayAE/AoAAAsgAUEANgI0DAILIAQgASgCNCIIayIFIAMgAyAFSxsiBARAIAggDGogECADayAE/AoAAAsgAyAFSwRAIAMgBGsiAwRAIAEoAjggECADayAD/AoAAAsgASADNgI0DAILQQAhBSABIAEoAjQgBGoiA0EAIAMgASgCLCIMRxs2AjQgDCABKAIwIgNNDQAgASADIARqNgIwCyAFDAELIAEgASgCLDYCMEEACw0BIAooAhAhDyAKKAIEIQQLIAogCigCCCAkIARrajYCCCAKIBUgD2siASAKKAIUajYCFCAGIAYoAiAgAWo2AiAgBi0ADEEEcUUgDyAVRnJFBEAgCigCDCABayEDIAYoAhwhBSAGAn8gBigCFARAIAUgAyABEFEMAQsgBSADIAEQswELIgE2AhwgCiABNgIwCyAKIAYoAkBBwABBACAGKAIIG2pBgAFBACAGKAIEIgFBv/4ARhtqQYACQYACQQAgAUHC/gBGGyABQcf+AEYbajYCLCACQXsgAhsgAiAPIBVGGyACIAQgJEYbIRwMAgsgBkHS/gA2AgQLQXwhHAsgF0EQaiQAIBxBAUsNASATQagBaiEBIBMoAqwBIQMgGigCACEJIBooAgQgEygCFGshDCMAQSBrIggkAAJAIAwgCWsiBUEATA0AIAEoAgggASgCBCICayAFTgRAIAIgA2siBCAFSARAIAwgBCAJaiIHayILRSAHIAxGckUEQCACIAcgC/wKAAALIAEgAiALajYCBCAE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eQAtKyAgIDBYMHgALTBYKzBYIDBYLTB4KzB4IDB4AE5vdgBUaHUAQXVndXN0AHVuc2lnbmVkIHNob3J0AHVuc2lnbmVkIGludABpbnZhbGlkIGxpdGVyYWwvbGVuZ3RocyBzZXQAaW52YWxpZCBjb2RlIGxlbmd0aHMgc2V0AHVua25vd24gaGVhZGVyIGZsYWdzIHNldABpbnZhbGlkIGRpc3RhbmNlcyBzZXQAZ2V0AE9jdABmbG9hdABpbnZhbGlkIGJpdCBsZW5ndGggcmVwZWF0AFNhdABudW1Qb2ludHMAY29sb3JzAFVucGFja09wdGlvbnMAcG9zaXRpb25zAHJvdGF0aW9ucwB0b28gbWFueSBsZW5ndGggb3IgZGlzdGFuY2Ugc3ltYm9scwBpbnZhbGlkIHN0b3JlZCBibG9jayBsZW5ndGhzAHNjYWxlcwBhbHBoYXMAW1NQWjogRVJST1JdIENoZWNrIGZhaWxlZDogJXM6JWQ6ICVzAHZmMzJfcHRyAEFwcgB2ZWN0b3IAbW9uZXlfZ2V0IGVycm9yAFtTUFogRVJST1JdIGRlc2VyaWFsaXplUGFja2VkR2F1c3NpYW5zOiByZWFkIGVycm9yAE9jdG9iZXIATm92ZW1iZXIAU2VwdGVtYmVyAERlY2VtYmVyAHVuc2lnbmVkIGNoYXIAaW9zX2Jhc2U6OmNsZWFyAE1hcgAvZW1zZGsvZW1zY3JpcHRlbi9zeXN0ZW0vbGliL2xpYmN4eGFiaS9zcmMvcHJpdmF0ZV90eXBlaW5mby5jcHAAU2VwACVJOiVNOiVTICVwAFN1bgBKdW4ATW9uAG5hbgBKYW4AY29vcmRpbmF0ZVN5c3RlbQBDb29yZGluYXRlU3lzdGVtAEp1bABib29sAGxsAEFwcmlsAGludmFsaWQgY29kZSAtLSBtaXNzaW5nIGVuZC1vZi1ibG9jawBpbmNvcnJlY3QgaGVhZGVyIGNoZWNrAGluY29ycmVjdCBsZW5ndGggY2hlY2sAaW5jb3JyZWN0IGRhdGEgY2hlY2sAcHVzaF9iYWNrAGludmFsaWQgZGlzdGFuY2UgdG9vIGZhciBiYWNrAEZyaQBzaABoZWFkZXIgY3JjIG1pc21hdGNoAE1hcmNoAEF1ZwB1bnNpZ25lZCBsb25nIGxvbmcAdW5zaWduZWQgbG9uZwBzdGQ6OndzdHJpbmcAYmFzaWNfc3RyaW5nAHN0ZDo6c3RyaW5nAHN0ZDo6dTE2c3RyaW5nAHN0ZDo6dTMyc3RyaW5nAGluZgAlLjBMZgAlTGYAcmVzaXplAGludmFsaWQgd2luZG93IHNpemUAdHJ1ZQBUdWUAZmFsc2UAaW52YWxpZCBibG9jayB0eXBlAEp1bmUAZG91YmxlAHNoRGVncmVlAGJhZF9hcnJheV9uZXdfbGVuZ3RoIHdhcyB0aHJvd24gaW4gLWZuby1leGNlcHRpb25zIG1vZGUAaW52YWxpZCBsaXRlcmFsL2xlbmd0aCBjb2RlAGludmFsaWQgZGlzdGFuY2UgY29kZQBSYXdHYXVzc2lhbkNsb3VkAHVua25vd24gY29tcHJlc3Npb24gbWV0aG9kAFtTUFogRVJST1JdIGRlc2VyaWFsaXplUGFja2VkR2F1c3NpYW5zOiBoZWFkZXIgbm90IGZvdW5kACUwKmxsZAAlKmxsZAArJWxsZAAlKy40bGQAdm9pZABsb2NhbGUgbm90IHN1cHBvcnRlZABhbnRpYWxpYXNlZABXZWQAJVktJW0tJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IFRvbyBtYW55IHBvaW50czogJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IFVuc3VwcG9ydGVkIFNIIGRlZ3JlZTogJWQAW1NQWiBFUlJPUl0gZGVzZXJpYWxpemVQYWNrZWRHYXVzc2lhbnM6IHZlcnNpb24gbm90IHN1cHBvcnRlZDogJWQARGVjAC4vc3B6L3NyYy9jYy9sb2FkLXNwei5jYwBGZWIAJWEgJWIgJWQgJUg6JU06JVMgJVkAUE9TSVgAVmVjdG9yVUludDhUACVIOiVNOiVTAE5BTgBQTQBBTQAlSDolTQBMQ19BTEwAQVNDSUkATEFORwBSVUYATFVGAElORgBSREYATERGAFVOU1BFQ0lGSUVEAEMAUlVCAExVQgBSREIATERCAGNhdGNoaW5nIGEgY2xhc3Mgd2l0aG91dCBhbiBvYmplY3Q/AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNob3J0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBzaG9ydD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBpbnQ+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGZsb2F0PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50OF90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQ4X3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxpbnQxNl90PgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8aW50NjRfdD4AZW1zY3JpcHRlbjo6bWVtb3J5X3ZpZXc8dWludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGludDMyX3Q+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHVuc2lnbmVkIGNoYXI+AGVtc2NyaXB0ZW46Om1lbW9yeV92aWV3PHNpZ25lZCBjaGFyPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzx1bnNpZ25lZCBsb25nPgBlbXNjcmlwdGVuOjptZW1vcnlfdmlldzxkb3VibGU+ADAxMjM0NTY3ODkAQy5VVEYtOABWZWN0b3JGbG9hdDMyADEuMy4xAC4ALQAocGFja2VkLmFscGhhcy5zaXplKCkpID09IChudW1Qb2ludHMpAChudWxsKQAocGFja2VkLmNvbG9ycy5zaXplKCkpID09IChudW1Qb2ludHMgKiAzKQAocGFja2VkLnNjYWxlcy5zaXplKCkpID09IChudW1Qb2ludHMgKiAzKQAocGFja2VkLnNoLnNpemUoKSkgPT0gKG51bVBvaW50cyAqIHNoRGltICogMykAKHBhY2tlZC5yb3RhdGlvbnMuc2l6ZSgpKSA9PSAobnVtUG9pbnRzICogKHBhY2tlZC51c2VzUXVhdGVybmlvblNtYWxsZXN0VGhyZWUgPyA0IDogMykpAChwYWNrZWQucG9zaXRpb25zLnNpemUoKSkgPT0gKG51bVBvaW50cyAqIDMgKiAodXNlc0Zsb2F0MTYgPyAyIDogMykpACUAbGVuZ3RoX2Vycm9yIHdhcyB0aHJvd24gaW4gLWZuby1leGNlcHRpb25zIG1vZGUgd2l0aCBtZXNzYWdlICIlcyIAUHVyZSB2aXJ0dWFsIGZ1bmN0aW9uIGNhbGxlZCEAW1NQWjogRVJST1JdIFVuc3VwcG9ydGVkIFNIIGRlZ3JlZTogJWQKAAkAAAAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwAAgD8AAIA/AACAPwBBkCALthMgEAAA9GwAAPRsAABAEAAAqG0AACgQAABOM3NwejEzR2F1c3NpYW5DbG91ZEUAAACobQAASBAAAE4zc3B6MTNVbnBhY2tPcHRpb25zRQBwcGlpcAD0bAAAbBAAAKhtAAB0EAAATlN0M19fMjZ2ZWN0b3JJZk5TXzlhbGxvY2F0b3JJZkVFRUUAaXBwACxuAADEEAAAAAAAAAMAAADcEAAAAAAAACgSAAAAAAAAWBIAAAAAAABOU3QzX18yOG9wdGlvbmFsSWZFRQAAAADQbQAA6BAAABgRAABOU3QzX18yMjdfX29wdGlvbmFsX21vdmVfYXNzaWduX2Jhc2VJZkxiMUVFRQAAAADQbQAAJBEAAFQRAABOU3QzX18yMjdfX29wdGlvbmFsX2NvcHlfYXNzaWduX2Jhc2VJZkxiMUVFRQAAAADQbQAAYBEAAIgRAABOU3QzX18yMjBfX29wdGlvbmFsX21vdmVfYmFzZUlmTGIxRUVFAAAA0G0AAJQRAAC8EQAATlN0M19fMjIwX19vcHRpb25hbF9jb3B5X2Jhc2VJZkxiMUVFRQAAANBtAADIEQAA9BEAAE5TdDNfXzIyM19fb3B0aW9uYWxfc3RvcmFnZV9iYXNlSWZMYjBFRUUAAAAAqG0AAPwRAABOU3QzX18yMjRfX29wdGlvbmFsX2Rlc3RydWN0X2Jhc2VJZkxiMUVFRQAAAKhtAAAwEgAATlN0M19fMjE4X19zZmluYWVfY3Rvcl9iYXNlSUxiMUVMYjFFRUUAAKhtAABgEgAATlN0M19fMjIwX19zZmluYWVfYXNzaWduX2Jhc2VJTGIxRUxiMUVFRQAAAACIbgAAnBIAAAAAAABsEAAAUE5TdDNfXzI2dmVjdG9ySWZOU185YWxsb2NhdG9ySWZFRUVFAAAAAIhuAADUEgAAAQAAAGwQAABQS05TdDNfXzI2dmVjdG9ySWZOU185YWxsb2NhdG9ySWZFRUVFAHBwAHYAdnAAAACMEgAAcHAAAJRsAACMEgAAPG0AAHZwcGQAAAAAlGwAAIwSAAAYbQAAPG0AAHZwcHBkAAAAGG0AAMQSAABwcHAATBMAADxtAACobQAAVBMAAE4xMGVtc2NyaXB0ZW4zdmFsRQAAnBAAAGwQAAAYbQAAcHBwcAAAAAAAAAAArGwAAGwQAAAYbQAAPG0AAGlwcHBkAAAALG4AAMATAAAAAAAAAwAAANgTAAAAAAAAKBIAAAAAAABYEgAAAAAAAE5TdDNfXzI4b3B0aW9uYWxJaEVFAAAAANBtAADkEwAAFBQAAE5TdDNfXzIyN19fb3B0aW9uYWxfbW92ZV9hc3NpZ25fYmFzZUloTGIxRUVFAAAAANBtAAAgFAAAUBQAAE5TdDNfXzIyN19fb3B0aW9uYWxfY29weV9hc3NpZ25fYmFzZUloTGIxRUVFAAAAANBtAABcFAAAhBQAAE5TdDNfXzIyMF9fb3B0aW9uYWxfbW92ZV9iYXNlSWhMYjFFRUUAAADQbQAAkBQAALgUAABOU3QzX18yMjBfX29wdGlvbmFsX2NvcHlfYmFzZUloTGIxRUVFAAAA0G0AAMQUAADwFAAATlN0M19fMjIzX19vcHRpb25hbF9zdG9yYWdlX2Jhc2VJaExiMEVFRQAAAACobQAA+BQAAE5TdDNfXzIyNF9fb3B0aW9uYWxfZGVzdHJ1Y3RfYmFzZUloTGIxRUVFAAAAqG0AACwVAABOU3QzX18yNnZlY3RvckloTlNfOWFsbG9jYXRvckloRUVFRQCIbgAAYBUAAAAAAAAkFQAAUE5TdDNfXzI2dmVjdG9ySWhOU185YWxsb2NhdG9ySWhFRUVFAAAAAIhuAACYFQAAAQAAACQVAABQS05TdDNfXzI2dmVjdG9ySWhOU185YWxsb2NhdG9ySWhFRUVFAHBwAHZwAFAVAABwcAAAlGwAAFAVAADEbAAAdnBwaQAAAACUbAAAUBUAABhtAADEbAAAdnBwcGkAAAAYbQAAiBUAAHBwcABMEwAAxGwAAJgTAAAkFQAAGG0AAHBwcHAAAAAArGwAACQVAAAYbQAAxGwAAGlwcHBpAHAAdnAAaXBwAHZwcGkAaXBwAHZwcGkAcHBwAHZwcHAAAABcbQAAYBYAAE4zc3B6MTZDb29yZGluYXRlU3lzdGVtRQBwAHZwAGlwcAB2cHBpAAAAAAAAAwAAAAgAAAAPAAAAqG0AAKAWAABOU3QzX18yMTJiYXNpY19zdHJpbmdJY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAAqG0AAOgWAABOU3QzX18yMTJiYXNpY19zdHJpbmdJd05TXzExY2hhcl90cmFpdHNJd0VFTlNfOWFsbG9jYXRvckl3RUVFRQAAqG0AADAXAABOU3QzX18yMTJiYXNpY19zdHJpbmdJRHNOU18xMWNoYXJfdHJhaXRzSURzRUVOU185YWxsb2NhdG9ySURzRUVFRQAAAKhtAAB8FwAATlN0M19fMjEyYmFzaWNfc3RyaW5nSURpTlNfMTFjaGFyX3RyYWl0c0lEaUVFTlNfOWFsbG9jYXRvcklEaUVFRUUAAACobQAAyBcAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWNFRQAAqG0AAPAXAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lhRUUAAKhtAAAYGAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaEVFAACobQAAQBgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXNFRQAAqG0AAGgYAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l0RUUAAKhtAACQGAAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJaUVFAACobQAAuBgAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SWpFRQAAqG0AAOAYAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0lsRUUAAKhtAAAIGQAATjEwZW1zY3JpcHRlbjExbWVtb3J5X3ZpZXdJbUVFAACobQAAMBkAAE4xMGVtc2NyaXB0ZW4xMW1lbW9yeV92aWV3SXhFRQAAqG0AAFgZAABOMTBlbXNjcmlwdGVuMTFtZW1vcnlfdmlld0l5RUUAAKhtAACAGQAATjEwZW1zY3Jp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AAAJqAAACAQAAAiEAAAIRAAACegAEAcIAAAIXAAACBwAAAmYABQHUwAACHwAAAg8AAAJ2AASBxcAAAhsAAAILAAACbgAAAgMAAAIjAAACEwAAAn4ABAHAwAACFIAAAgSABUIowATByMAAAhyAAAIMgAACcQAEQcLAAAIYgAACCIAAAmkAAAIAgAACIIAAAhCAAAJ5AAQBwcAAAhaAAAIGgAACZQAFAdDAAAIegAACDoAAAnUABIHEwAACGoAAAgqAAAJtAAACAoAAAiKAAAISgAACfQAEAcFAAAIVgAACBYAQAgAABMHMwAACHYAAAg2AAAJzAARBw8AAAhmAAAIJgAACawAAAgGAAAIhgAACEYAAAnsABAHCQAACF4AAAgeAAAJnAAUB2MAAAh+AAAIPgAACdwAEgcbAAAIbgAACC4AAAm8AAAIDgAACI4AAAhOAAAJ/ABgBwAAAAhRAAAIEQAVCIMAEgcfAAAIcQAACDEAAAnCABAHCgAACGEAAAghAAAJogAACAEAAAiBAAAIQQAACeIAEAcGAAAIWQAACBkAAAmSABMHOwAACHkAAAg5AAAJ0gARBxEAAAhpAAAIKQAACbIAAAgJAAAIiQAACEkAAAnyABAHBAAACFUAAAgVABAIAgETBysAAAh1AAAINQAACcoAEQcNAAAIZQAACCUAAAmqAAAIBQAACIUAAAhFAAAJ6gAQBwgAAAhdAAAIHQAACZoAFAdTAAAIfQAACD0AAAnaABIHFwAACG0AAAgtAAAJugAACA0AAAiNAAAITQAACfoAEAcDAAAIUwAACBMAFQjDABMHIwAACHMAAAgzAAAJxgARBwsAAAhjAAAIIwAACaYAAAgDAAAIgwAACEMAAAnmABAHBwAACFsAAAgbAAAJlgAUB0MAAAh7AAAIOwAACdYAEgcTAAAIawAACCsAAAm2AAAICwAACIsAAAhLAAAJ9gAQBwUAAAhXAAAIFwBACAAAEwczAAAIdwAACDcAAAnOABEHDwAACGcAAAgnAAAJrgAACAcAAAiHAAAIRwAACe4AEAcJAAAIXwAACB8AAAmeABQHYwAACH8AAAg/AAAJ3gASBxsAAAhvAAAILwAACb4AAAgPAAAIjwAACE8AAAn+AGAHAAAACFAAAAgQABQIcwASBx8AAAhwAAAIMAAACcEAEAcKAAAIYAAACCAAAAmhAAAIAAAACIAAAAhAAAAJ4QAQBwYAAAhYAAAIGAAACZEAEwc7AAAIeAAACDgAAAnRABEHEQAACGgAAAgoAAAJsQAACAgAAAiIAAAISAAACfEAEAcEAAAIVAAACBQAFQjjABMHKwAACHQAAAg0AAAJyQARBw0AAAhkAAAIJAAACakAAAgEAAAIhAAACEQAAAnpABAHCAAACFwAAAgcAAAJmQAUB1MAAAh8AAAIPAAACdkAEgcXAAAIbAAACCwAAAm5AAAIDAAACIwAAAhMAAAJ+QAQBwMAAAhSAAAIEgAVCKMAEwcjAAAIcgAACDIAAAnFABEHCwAACGIAAAgiAAAJpQAACAIAAAiCAAAIQgAACeUAEAcHAAAIWgAACBoAAAmVABQHQwAACHoAAAg6AAAJ1QASBxMAAAhqAAAIKgAACbUAAAgKAAAIigAACEoAAAn1ABAHBQAACFYAAAgWAEAIAAATBzMAAAh2AAAINgAACc0AEQcPAAAIZgAACCYAAAmtAAAIBgAACIYAAAhGAAAJ7QAQBwkAAAheAAAIHgAACZ0AFAdjAAAIfgAACD4AAAndABIHGwAACG4AAAguAAAJvQAACA4AAAiOAAAITgAACf0AYAcAAAAIUQAACBEAFQiDABIHHwAACHEAAAgxAAAJwwAQBwoAAAhhAAAIIQAACaMAAAgBAAAIgQAACEEAAAnjABAHBgAACFkAAAgZAAAJkwATBzsAAAh5AAAIOQAACdMAEQcRAAAIaQAACCkAAAmzAAAICQAACIkAAAhJAAAJ8wAQBwQAAAhVAAAIFQAQCAIBEwcrAAAIdQAACDUAAAnLABEHDQAACGUAAAglAAAJqwAACAUAAAiFAAAIRQAACesAEAcIAAAIXQAACB0AAAmbABQHUwAACH0AAAg9AAAJ2wASBxcAAAhtAAAILQAACbsAAAgNAAAIjQAACE0AAAn7ABAHAwAACFMAAAgTABUIwwATByMAAAhzAAAIMwAACccAEQcLAAAIYwAACCMAAAmnAAAIAwAACIMAAAhDAAAJ5wAQBwcAAAhbAAAIGwAACZcAFAdDAAAIewAACDsAAAnXABIHEwAACGsAAAgrAAAJtwAACAsAAAiLAAAISwAACfcAEAcFAAAIVwAACBcAQAgAABMHMwAACHcAAAg3AAAJzwARBw8AAAhnAAAIJwAACa8AAAgH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Y05TXzExY2hhcl90cmFpdHNJY0VFRUUA0G0AAHg9AAAAPAAATlN0M19fMjE1YmFzaWNfc3RyaW5nYnVmSWNOU18xMWNoYXJfdHJhaXRzSWNFRU5TXzlhbGxvY2F0b3JJY0VFRUUAAABAAAAAAAAAAKw+AABZAAAAWgAAADgAAAD4////rD4AAFsAAABcAAAAwP///8D///+sPgAAXQAAAF4AAADIPQAALD4AAGg+AAB8PgAAkD4AAKQ+AABUPgAAQD4AAPA9AADcPQAAQAAAAAAAAAAcPQAATAAAAE0AAAA4AAAA+P///xw9AABOAAAATwAAAMD////A////HD0AAFAAAABRAAAAQAAAAAAAAAA8PAAARAAAAEUAAADA////wP///zw8AABGAAAARwAAADgAAAAAAAAAhDwAAEgAAABJAAAAyP///8j///+EPAAASgAAAEsAAADQbQAAuD4AABw9AABOU3QzX18yMThiYXNpY19zdHJpbmdzdHJlYW1JY05TXzExY2hhcl90cmFpdHNJY0VFTlNfOWFsbG9jYXRvckljRUVFRQAAAAAAAAAAED8AAF8AAABgAAAAqG0AABg/AABOU3QzX18yOGlvc19iYXNlRQAAAAAAAADRdJ4AV529KoBwUg///z4nCgAAAGQAAADoAwAAECcAAKCGAQBAQg8AgJaYAADh9QUYAAAANQAAAHEAAABr////zvv//5K///8AAAAAAAAAAP////////////////////////////////////////////////////////////////8AAQIDBAUGBwgJ/////////woLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIj////////CgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiP/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAECBAcDBgUAAAAAAAAAAgAAwAMAAMAEAADABQAAwAYAAMAHAADACAAAwAkAAMAKAADACwAAwAwAAMANAADADgAAwA8AAMAQAADAEQAAwBIAAMATAADA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")),ne((await Y(Ie)).instance))})();function j5(){function ae(){var ne;if(i.calledRun=!0,!_){if(B=!0,AI.G(),C?.(i),(ne=i.onRuntimeInitialized)==null||ne.call(i),i.postRun)for(typeof i.postRun=="function"&&(i.postRun=[i.postRun]);i.postRun.length;){var Ie=i.postRun.shift();W.push(Ie)}$(W)}}if(0<O)G=j5;else{if(i.preRun)for(typeof i.preRun=="function"&&(i.preRun=[i.preRun]);i.preRun.length;)Z();$(K),0<O?G=j5:i.setStatus?(i.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>i.setStatus(""),1),ae()},1)):ae()}}if(i.preInit)for(typeof i.preInit=="function"&&(i.preInit=[i.preInit]);0<i.preInit.length;)i.preInit.shift()();return j5(),B?n=i:n=new Promise((ae,ne)=>{C=ae,E=ne}),n}var Fb=(e,t,n=i=>i)=>{let i=e.vf32_ptr(t),o=t.size();return new Float32Array(e.HEAPF32.buffer,i,o).map(n)},fHe=e=>1/(1+Math.exp(-e)),dHe=e=>t=>t*e+.5,hHe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:Fb(e,t.positions),scales:Fb(e,t.scales,Math.exp),rotations:Fb(e,t.rotations),alphas:Fb(e,t.alphas,fHe),colors:Fb(e,t.colors,dHe(i)),sh:Fb(e,t.sh)}},mHe=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},jce=async(e,t)=>{var n;let i=await uHe(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let a=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],s=i.load_spz(r,o.length,{coordinateSystem:a}),c=hHe(i,s,t);return mHe(i,s),c}catch(a){throw a}finally{r!==null&&i._free(r)}};var pHe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var AHe=[0,9,24,45],gHe=14,_He=1.6*1024*1024*1024;function yHe(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let o=e?.accessors?.[i];if(!l(o)||o.count<=0)return;let r=0;for(let a in n)if(Object.prototype.hasOwnProperty.call(n,a)){let s=/SH_DEGREE_(\d+)_COEF_/.exec(a);s&&(r=Math.max(r,parseInt(s[1],10)))}return{numPoints:o.count,shDegree:r}}function CHe(e,t){let n=gHe+(AHe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var MY=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.spz,a=t.gltfResource,s=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=a,this._baseResource=s,this._gltf=i,this._primitive=o,this._spz=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=EHe(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(l(this._spzError)&&NY(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=yHe(this._gltf,this._primitive);if(l(n)){let o=CHe(n.numPoints,n.shDegree);if(o>_He){let r=Math.round(o/1048576);return NY(this,new ue(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${r} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=jce(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=IHe(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function EHe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:0,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;NY(e,n)}}function NY(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load SPZ",t)}async function IHe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var $F=MY;function kB(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}kB.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=IA.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new kB({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(kB.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}}});kB.BATCH_TABLE_CLASS_NAME="_batchTable";var Hm=kB;function eQ(e){e=e??V.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}eQ.fromJson=function(e){return new eQ({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(eQ.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 tQ=eQ;function nQ(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let s=0;s<r;++s){let c=n[s];i[c.value]=c.name,o[c.name]=c.value}let a=e.valueType??Qt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=a,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}nQ.fromJson=function(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(o){return tQ.fromJson(o)});return new nQ({id:t,values:i,valueType:Qt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(nQ.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 iQ=nQ;function oQ(e){e=e??V.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ye(e.extras,!0),this._extensions=Ye(e.extensions,!0)}oQ.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=iQ.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Hm.fromJson({id:i,class:e.classes[i],enums:t}));return new oQ({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(oQ.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 au=oQ;var LY=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.schema,i=t.resource,o=t.cacheKey;this._schema=l(n)?au.fromJson(n):void 0,this._resource=i,this._cacheKey=o,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=bHe(this),this._promise)}unload(){this._schema=void 0}};async function bHe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=au.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var hE=LY;var Zf={};function Qb(e){return tA(e.url)}function UB(e){let{byteOffset:t,byteLength:n}=e;if(Si(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function xHe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function Yce(e,t){return`${Qb(e)}-buffer-id-${t}`}function kb(e,t,n,i){if(l(e.uri)){let o=i.getDerivedResource({url:e.uri});return Qb(o)}return Yce(n,t)}function OY(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],a=r.buffer,s=e.buffers[a],c=kb(s,a,n,i),u=UB(r);return`${c}-range-${u}`}function qce(e,t,n,i){let r=e.bufferViews[0],a=r.buffer,s=e.buffers[a],c=kb(s,a,n,i),u=UB(r);return`${c}-range-${u}`}function Kce(e,t,n,i){let o=e.images[t],r=o.bufferView,a=o.uri;if(l(a)){let p=i.getDerivedResource({url:a});return Qb(p)}let s=e.bufferViews[r],c=s.buffer,u=e.buffers[c],f=kb(u,c,n,i),h=UB(s);return`${f}-range-${h}`}function THe(e,t){let n=Xu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Zf.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${Qb(n)}`};Zf.getExternalBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${Qb(t)}`};Zf.getEmbeddedBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${Yce(t,n)}`};Zf.getGltfCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${Qb(t)}`};Zf.getBufferViewCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=t.bufferViews[n],a=r.buffer,s=t.buffers[a];Si(r,"EXT_meshopt_compression")&&(a=r.extensions.EXT_meshopt_compression.buffer);let c=kb(s,a,i,o),u=UB(r);return`buffer-view:${c}-range-${u}`};Zf.getDracoCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return`draco:${OY(t,n,i,o)}`};Zf.getSpzCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,gltfResource:i,baseResource:o}=e;return`spz:${qce(t,n,i,o)}`};Zf.getVertexBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,spz:s,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:h=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${o.context.id}`),h&&(p+="-typed-array"),l(a))return`vertex-buffer:${OY(t,a,n,i)}-draco-${c}${p}`;if(s)return`vertex-buffer:${qce(t,s,n,i)}-spz-${c}${p}`;let A=t.bufferViews[r],m=A.buffer,_=t.buffers[m],y=kb(_,m,n,i),C=UB(A);return`vertex-buffer:${y}-range-${C}${p}`};Zf.getIndexBufferCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:s=!1,loadTypedArray:c=!1}=e,u="";if(s&&(u+="-buffer",u+=`-context-${r.context.id}`),c&&(u+="-typed-array"),l(a))return`index-buffer:${OY(t,a,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],A=p.buffer,m=t.buffers[A],_=kb(m,A,i,o),y=xHe(f,p);return`index-buffer:${_}-accessor-${y}${u}`};Zf.getImageCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return`image:${Kce(t,n,i,o)}`};Zf.getTextureCacheKey=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a}=e,s=n.index,c=Xu.getImageIdFromTexture({gltf:t,textureId:s,supportedImageFormats:r}),u=Kce(t,c,i,o),f=THe(t,n);return`texture:${u}-sampler-${f}-context-${a.context.id}`};var su=Zf;function zB(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}zB.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};zB.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;l(n)&&(o+=n.sizeInBytes),l(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};zB.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};zB.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var rQ=zB;function Fn(){}Fn.cacheEntries={};Fn.statistics=new rQ;function SHe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Fn.get=function(e){let t=Fn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Fn.add=function(e){let t=e.cacheKey;return Fn.cacheEntries[t]=new SHe(e),e};Fn.unload=function(e){let t=e.cacheKey,n=Fn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Fn.statistics.removeLoader(e),e.destroy(),delete Fn.cacheEntries[t])};Fn.getSchemaLoader=function(e){e=e??V.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=su.getSchemaCacheKey({schema:t,resource:n}),o=Fn.get(i);return l(o)?o:(o=new hE({schema:t,resource:n,cacheKey:i}),Fn.add(o))};Fn.getEmbeddedBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,o=su.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Fn.get(o);return l(r)?r:(r=new Db({typedArray:i,cacheKey:o}),Fn.add(r))};Fn.getExternalBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{resource:t}=e,n=su.getExternalBufferCacheKey({resource:t}),i=Fn.get(n);return l(i)?i:(i=new Db({resource:t,cacheKey:n}),Fn.add(i))};Fn.getGltfJsonLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e,r=su.getGltfCacheKey({gltfResource:t}),a=Fn.get(r);return l(a)?a:(a=new OB({resourceCache:Fn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Fn.add(a))};Fn.getBufferViewLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e,r=su.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),a=Fn.get(r);return l(a)?a:(a=new vB({resourceCache:Fn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(a))};Fn.getDracoLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e,a=su.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),s=Fn.get(a);return l(s)?s:(s=new PB({resourceCache:Fn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:a}),Fn.add(s))};Fn.getSpzLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r}=e,a=su.getSpzCacheKey({gltf:t,primitive:n,gltfResource:o,baseResource:r}),s=Fn.get(a);return l(s)?s:(s=new $F({resourceCache:Fn,gltf:t,primitive:n,spz:i,gltfResource:o,baseResource:r,cacheKey:a}),Fn.add(s))};Fn.getVertexBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,asynchronous:h=!0,dequantize:p=!1,loadBuffer:A=!1,loadTypedArray:m=!1}=e,_=su.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:A,loadTypedArray:m}),y=Fn.get(_);return l(y)?y:(y=new QB({resourceCache:Fn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:a,draco:s,spz:c,attributeSemantic:u,accessorId:f,cacheKey:_,asynchronous:h,dequantize:p,loadBuffer:A,loadTypedArray:m}),Fn.add(y))};Fn.getIndexBufferLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:a,draco:s,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,h=su.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:u,loadTypedArray:f}),p=Fn.get(h);return l(p)?p:(p=new NB({resourceCache:Fn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:a,draco:s,cacheKey:h,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Fn.add(p))};Fn.getImageLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e,r=su.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),a=Fn.get(r);return l(a)?a:(a=new MB({resourceCache:Fn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Fn.add(a))};Fn.getTextureLoader=function(e){e=e??V.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a,asynchronous:s=!0}=e,c=su.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a}),u=Fn.get(c);return l(u)?u:(u=new FB({resourceCache:Fn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:c,asynchronous:s}),Fn.add(u))};Fn.clearForSpecs=function(){let e=[QB,NB,PB,FB,MB,vB,Db,hE,OB],t,n=Fn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,a){let s=e.indexOf(r.resourceLoader.constructor),c=e.indexOf(a.resourceLoader.constructor);return s-c});let o=i.length;for(let r=0;r<o;++r){let a=i[r];t=a.resourceLoader.cacheKey,l(n[t])&&(a.resourceLoader.destroy(),delete n[t])}Fn.statistics.clear()};var Pi=Fn;function Ws(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Ws.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}}});Ws.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Ws.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Ws.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Ws.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Ws.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Ws.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Ws.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Ws.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===ka.OCTREE&&(t=3),e>>t};Ws.fromSubtreeJson=async function(e,t,n,i,o){let r=new Ws(e,i,o),a;l(t)?a={json:t,binary:void 0}:a=wHe(n);let s=a.json;r._subtreeJson=s;let c;if(Si(s,"3DTILES_metadata"))c=s.extensions["3DTILES_metadata"];else if(l(s.tileMetadata)){let E=s.tileMetadata;c=s.propertyTables[E]}let u=[];if(l(s.contentMetadata)){let E=s.contentMetadata.length;for(let I=0;I<E;I++){let x=s.contentMetadata[I];u.push(s.propertyTables[x])}}let f,h=i.metadataSchema,p=s.subtreeMetadata;if(l(p)){let E=p.class,I=h.classes[E];f=new DF({subtreeMetadata:p,class:I})}r._metadata=f,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=u;let A={constant:0};s.contentAvailabilityHeaders=[],Si(s,"3DTILES_multiple_contents")?s.contentAvailabilityHeaders=s.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(s.contentAvailability)?s.contentAvailabilityHeaders=s.contentAvailability:s.contentAvailabilityHeaders.push(s.contentAvailability??A);let m=BHe(s.buffers),_=DHe(s.bufferViews,m);vHe(s,_),l(c)&&Xce(c,_);for(let E=0;E<u.length;E++){let I=u[E];Xce(I,_)}let y=await PHe(r,m,a.binary),C=MHe(_,y);return NHe(r,s,i,C),l(c)&&(LHe(r,i,C),FHe(r)),OHe(r,i,C),QHe(r),r._ready=!0,r};function wHe(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 a=Pr(e,i,o);i+=o;let s=e.subarray(i,i+r);return{json:a,binary:s}}function BHe(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function DHe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function vHe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let a=0;a<o.length;a++)n=void 0,l(o[a].bitstream)?n=t[o[a].bitstream]:l(o[a].bufferView)&&(n=t[o[a].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function Xce(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],a=r.values??r.bufferView;i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0;let s=r.stringOffsets??r.stringOffsetBufferView;l(s)&&(i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0);let c=r.arrayOffsets??r.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function PHe(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 a=RHe(e,r);i.push(a)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let a=0;a<o.length;a++){let s=o[a];l(s)&&(r[a]=s)}return r})}async function RHe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Pi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function MHe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,a=r+o.byteLength,c=t[o.buffer].subarray(r,a);n[i]=c}return n}function NHe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,a=(Math.pow(o,r)-1)/(o-1),s=Math.pow(o,r),c=Si(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=FY(t.tileAvailability,i,a,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let A=FY(t.contentAvailabilityHeaders[p],i,a,f);e._contentAvailabilityBitstreams.push(A)}e._childSubtreeAvailability=FY(t.childSubtreeAvailability,i,s)}function FY(e,t,n,i){if(l(e.constant))return new wB({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new wB({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function LHe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,a=i.class,s=r.classes[a];e._tileMetadataTable=new dh({class:s,count:o,properties:i.properties,bufferViews:n})}function OHe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,a=e._contentMetadataTables;for(let s=0;s<i.length;s++){let c=i[s],f=o[s].availableCount,h=c.class,p=r.classes[h],A=new dh({class:p,count:f,properties:c.properties,bufferViews:n});a.push(A)}}function Jce(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 FHe(e){let t=Jce(e._tileAvailability);e._tileJumpBuffer=t}function QHe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=Jce(o);t.push(r)}}Ws.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ue("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Ws.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ue("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function kHe(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function UHe(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],a=e.getTileIndex(t);if(r.getBit(a))return e._contentJumpBuffers[n][a]}Ws.prototype.getTileMetadataView=function(e){let t=kHe(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new BB({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Ws.prototype.getContentMetadataView=function(e,t){let n=UHe(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new BB({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};Ws.prototype.isDestroyed=function(){return!1};Ws.prototype.destroy=function(){return l(this._bufferLoader)&&Pi.unload(this._bufferLoader),fe(this)};var T_=Ws;var zHe={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"},mh=Object.freeze(zHe);var S_={};S_.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:S_.parseBoundingVolumeSemantic(e,t),minimumHeight:S_._parseMinimumHeight(e,t),maximumHeight:S_._parseMaximumHeight(e,t)}};S_.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let a=`${e}_BOUNDING_SPHERE`,s=t.getPropertyBySemantic(a);if(l(s))return{sphere:s}};S_._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};S_._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var mE=S_;function El(e,t,n){let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=a.getUrlComponent(!0),this._ready=!1}Object.defineProperties(El.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});El.fromSubtreeJson=async function(e,t,n,i,o,r){r=r??0;let a;l(o)&&(a=new Uint8Array(o,r));let s=t.implicitTileset,c=t.implicitCoordinates,u=await T_.fromSubtreeJson(n,i,a,s,c),f=new El(e,t,n);return f._implicitSubtree=u,GHe(f,u),f._ready=!0,f};function GHe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=HHe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let a=VHe(e,t,o.bottomRow);for(let s=0;s<a.length;s++){let c=a[s],u=c.tile,f=$He(e,u,c.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function VHe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let a=n[r];if(l(a))for(let s=0;s<o;s++){let c=r*o+s;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:a,childIndex:s})}}return i}function HHe(e,t,n,i){let a=Zce(e,t,n,i,0,!0),s=e._tileset.statistics,c=[a],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),A=f.branchingFactor*c.length;for(let m=0;m<A;m++){let _=p+m;if(!t.tileIsAvailableAtIndex(_)){u.push(void 0);continue}let y=t.getParentMortonIndex(m),C=c[y],E=m%f.branchingFactor,I=Zce(e,t,C,E,_);C.children.push(I),s.numberOfTilesTotal++,u.push(I)}c=u,u=[]}return{rootTile:a,bottomRow:c}}function $ce(e,t,n){let i=mh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Zce(e,t,n,i,o,r){let a=e._implicitTileset,s;r??!1?s=n.implicitCoordinates:s=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(s),u=mE.parseAllBoundingVolumeSemantics("TILE",c));let h=t.contentPropertyTableJsons.length,p=!1;for(let S=0;S<h;S++)if(t.contentIsAvailableAtCoordinates(s,S)){p=!0;break}let A=YHe(a,s,i,r,n,u),m=[];for(let S=0;S<a.contentCount;S++){if(!t.contentIsAvailableAtIndex(o,S))continue;let R={uri:a.contentUriTemplates[S].getDerivedResource({templateValues:s.getTemplateValues()}).url},N;if(t.contentPropertyTableJsons.length>0){let g=t.getContentMetadataView(s,S);N=mE.parseAllBoundingVolumeSemantics("CONTENT",g)}let L=qHe(A,N);l(L)&&(R.boundingVolume=L),m.push(Pt(R,a.contentHeaders[S]))}let _=$ce(c,a,s),y={boundingVolume:A,geometricError:_,refine:a.refine,contents:m},C=!0,E=Ye(a.tileHeader,C);delete E.boundingVolume,delete E.transform,delete E.metadata;let I=Pt(y,E,C),x=ole(e,a.baseResource,I,n);return x.implicitCoordinates=s,x.implicitSubtree=t,x.metadata=c,x.hasImplicitContentMetadata=p,x}function aQ(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(Si(e,"3DTILES_bounding_volume_S2")||l(e.region))}function kY(e,t){l(t)&&(Si(e,"3DTILES_bounding_volume_S2")?jHe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&WHe(e.region,t.minimumHeight,t.maximumHeight))}function WHe(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function jHe(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function YHe(e,t,n,i,o,r){let a;return!l(r)||!l(r.boundingVolume)||!aQ(r.boundingVolume,r)&&aQ(e.boundingVolume,r)?a=ele(e,t,n,i??!1,o):a=r.boundingVolume,kY(a,r),a}function qHe(e,t){let n;return l(t)&&(n=t.boundingVolume),aQ(n,t)?kY(n,t):aQ(e,t)&&(n=Ye(e,!0),kY(n,t)),n}function ele(e,t,n,i,o){let r=e.boundingVolume;return Si(r,"3DTILES_bounding_volume_S2")?tle(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:ile(r.region,t.level,t.x,t.y,t.z)}:{box:nle(r.box,t.level,t.x,t.y,t.z)}}function tle(e,t,n,i,o,r,a){let s=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:__.getTokenFromId(s.s2Cell._cellId),minimumHeight:s.minimumHeight,maximumHeight:s.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?SB.encode2D(i,o,r):SB.encode2D(i,r,o),f=__.fromFacePositionLevel(c,BigInt(u),i),h,p;if(l(a)){let A=(s.maximumHeight+s.minimumHeight)/2;h=n<4?s.minimumHeight:A,p=n<4?A:s.maximumHeight}else h=s.minimumHeight,p=s.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:__.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var KHe=new d,XHe=new d,QY=new d,JHe=new J;function nle(e,t,n,i,o){if(t===0)return e;let r=d.unpack(e,0,XHe),a=J.unpack(e,3,JHe),s=Math.pow(2,-t),c=-1+(2*n+1)*s,u=-1+(2*i+1)*s,f=0,h=d.fromElements(s,s,1,KHe);l(o)&&(f=-1+(2*o+1)*s,h.z=s);let p=d.fromElements(c,u,f,QY);p=J.multiplyByVector(a,p,QY),p=d.add(p,r,QY);let A=J.clone(a);A=J.multiplyByScale(A,h,A);let m=new Array(12);return d.pack(p,m),J.pack(A,m,3),m}var ZHe=new ce;function ile(e,t,n,i,o){if(t===0)return e.slice();let r=ce.unpack(e,0,ZHe),a=e[4],s=e[5],c=Math.pow(2,-t),u=c*r.width,f=D.negativePiToPi(r.west+n*u),h=D.negativePiToPi(f+u),p=c*r.height,A=D.negativePiToPi(r.south+i*p),m=D.negativePiToPi(A+p),_=a,y=s;if(l(o)){let C=c*(s-a);_+=o*C,y=_+C}return[f,A,h,m,_,y]}function $He(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=ele(i,o,n,!1,t),a=$ce(void 0,i,o),s=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:a,refine:i.refine,contents:[{uri:s}]},u=ole(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function ole(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}El.prototype.hasProperty=function(e,t){return!1};El.prototype.getFeature=function(e){};El.prototype.applyDebugSettings=function(e,t){};El.prototype.applyStyle=function(e){};El.prototype.update=function(e,t){};El.prototype.pick=function(e,t,n){};El.prototype.isDestroyed=function(){return!1};El.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),fe(this)};El._deriveBoundingBox=nle;El._deriveBoundingRegion=ile;El._deriveBoundingVolumeS2=tle;var GB=El;var e4e={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},Ju=Object.freeze(e4e);function Ub(e,t){this._distance=t,this._normal=new rle(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(Ub.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});Ub.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new Ub(e.normal,e.distance),t};Ub.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new Ub(e.normal,e.distance)};function rle(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(rle.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var os=Ub;function Gc(e){e=e??V.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.edgeColor=U.clone(e.edgeColor??U.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new _e,this.planeRemoved=new _e,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?ule:fle,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function ule(e){return e===Xt.OUTSIDE}function fle(e){return e===Xt.INSIDE}Object.defineProperties(Gc.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?ule:fle)}},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 ale(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Gc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){ale(n,i)},e.index=t,ale(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Gc.prototype.get=function(e){return this._planes[e]};function dle(e,t){let n=e.length;for(let i=0;i<n;++i)if(cn.equals(e[i],t))return i;return-1}Gc.prototype.contains=function(e){return dle(this._planes,e)!==-1};Gc.prototype.remove=function(e){let t=this._planes,n=dle(t,e);if(n===-1)return!1;e instanceof os&&(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 os&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Gc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof os&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var t4e=new ie,n4e=new ie;function sle(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let a=t;a<n;++a){let s=o[a],c=tn.octEncodeToCartesian4(s.normal,n4e);i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=c.w;let u=ie.packFloat(s.distance,t4e);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function cle(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let a=t;a<n;++a){let s=o[a],c=s.normal;i[r]=c.x,i[r+1]=c.y,i[r+2]=c.z,i[r+3]=s.distance,r+=4}}function hle(e,t){let n=Nt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var i4e=new Q;Gc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Gc.useFloatTexture(n),o=i?this.length:this.length*2;if(l(t)){let a=t.width*t.height;(a<o||o<.25*a)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let a=hle(o,i4e);a.y*=2,i?(t=new vt({context:n,width:a.x,height:a.y,pixelFormat:Ke.RGBA,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4)):(t=new vt({context:n,width:a.x,height:a.y,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(a.x*a.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(cle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(sle(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let a=0,s=0;i?(s=Math.floor(r/t.width),a=Math.floor(r-s*t.width),cle(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:a,yOffset:s})):(s=Math.floor(r*2/t.width),a=Math.floor(r*2-s*t.width),sle(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:a,yOffset:s}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var o4e=new P,lle=new cn(d.UNIT_X,0);Gc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;l(t)&&(o=P.multiply(t,o,o4e));let r=Xt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Xt.OUTSIDE);for(let a=0;a<i;++a){let s=n[a];cn.transform(s,o,lle);let c=e.intersectPlane(lle);if(c===Xt.INTERSECTING)r=c;else if(this._testIntersection(c))return c}return r};Gc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Gc.useFloatTexture=function(e){return e.floatingPointTexture};Gc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=Gc.useFloatTexture(t)?e.length:e.length*2,r=hle(o,n);return r.y*=2,r};Gc.prototype.isDestroyed=function(){return!1};Gc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var Ca=Gc;function GY(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=ple(e,0,o,n,!0),a=[];if(!r||r.next===r.prev)return a;let s,c,u;if(i&&(r=l4e(e,t,r,n)),e.length>80*n){s=1/0,c=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let A=e[p],m=e[p+1];A<s&&(s=A),m<c&&(c=m),A>f&&(f=A),m>h&&(h=m)}u=Math.max(f-s,h-c),u=u!==0?32767/u:0}return VB(r,a,n,s,c,u,0),a}function ple(e,t,n,i,o){let r;if(o===C4e(e,t,n,i)>0)for(let a=t;a<n;a+=i)r=mle(a/i|0,e[a],e[a+1],r);else for(let a=n-i;a>=t;a-=i)r=mle(a/i|0,e[a],e[a+1],r);return r&&lQ(r,r.next)&&(WB(r),r=r.next),r}function pE(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(lQ(n,n.next)||ia(n.prev,n,n.next)===0)){if(WB(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function VB(e,t,n,i,o,r,a){if(!e)return;!a&&r&&m4e(e,i,o,r);let s=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(r?a4e(e,i,o,r):r4e(e)){t.push(c.i,e.i,u.i),WB(e),e=u.next,s=u.next;continue}if(e=u,e===s){a?a===1?(e=s4e(pE(e),t),VB(e,t,n,i,o,r,2)):a===2&&c4e(e,t,n,i,o,r):VB(pE(e),t,n,i,o,r,1);break}}}function r4e(e){let t=e.prev,n=e,i=e.next;if(ia(t,n,i)>=0)return!1;let o=t.x,r=n.x,a=i.x,s=t.y,c=n.y,u=i.y,f=o<r?o<a?o:a:r<a?r:a,h=s<c?s<u?s:u:c<u?c:u,p=o>r?o>a?o:a:r>a?r:a,A=s>c?s>u?s:u:c>u?c:u,m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=A&&zb(o,s,r,c,a,u,m.x,m.y)&&ia(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function a4e(e,t,n,i){let o=e.prev,r=e,a=e.next;if(ia(o,r,a)>=0)return!1;let s=o.x,c=r.x,u=a.x,f=o.y,h=r.y,p=a.y,A=s<c?s<u?s:u:c<u?c:u,m=f<h?f<p?f:p:h<p?h:p,_=s>c?s>u?s:u:c>u?c:u,y=f>h?f>p?f:p:h>p?h:p,C=UY(A,m,t,n,i),E=UY(_,y,t,n,i),I=e.prevZ,x=e.nextZ;for(;I&&I.z>=C&&x&&x.z<=E;){if(I.x>=A&&I.x<=_&&I.y>=m&&I.y<=y&&I!==o&&I!==a&&zb(s,f,c,h,u,p,I.x,I.y)&&ia(I.prev,I,I.next)>=0||(I=I.prevZ,x.x>=A&&x.x<=_&&x.y>=m&&x.y<=y&&x!==o&&x!==a&&zb(s,f,c,h,u,p,x.x,x.y)&&ia(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;I&&I.z>=C;){if(I.x>=A&&I.x<=_&&I.y>=m&&I.y<=y&&I!==o&&I!==a&&zb(s,f,c,h,u,p,I.x,I.y)&&ia(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;x&&x.z<=E;){if(x.x>=A&&x.x<=_&&x.y>=m&&x.y<=y&&x!==o&&x!==a&&zb(s,f,c,h,u,p,x.x,x.y)&&ia(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function s4e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!lQ(i,o)&&Ale(i,n,n.next,o)&&HB(i,o)&&HB(o,i)&&(t.push(i.i,n.i,o.i),WB(n),WB(n.next),n=e=o),n=n.next}while(n!==e);return pE(n)}function c4e(e,t,n,i,o,r){let a=e;do{let s=a.next.next;for(;s!==a.prev;){if(a.i!==s.i&&g4e(a,s)){let c=gle(a,s);a=pE(a,a.next),c=pE(c,c.next),VB(a,t,n,i,o,r,0),VB(c,t,n,i,o,r,0);return}s=s.next}a=a.next}while(a!==e)}function l4e(e,t,n,i){let o=[];for(let r=0,a=t.length;r<a;r++){let s=t[r]*i,c=r<a-1?t[r+1]*i:e.length,u=ple(e,s,c,i,!1);u===u.next&&(u.steiner=!0),o.push(A4e(u))}o.sort(u4e);for(let r=0;r<o.length;r++)n=f4e(o[r],n);return n}function u4e(e,t){return e.x-t.x}function f4e(e,t){let n=d4e(e,t);if(!n)return t;let i=gle(n,e);return pE(i,i.next),pE(n,n.next)}function d4e(e,t){let n=t,i=e.x,o=e.y,r=-1/0,a;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,a=n.x<n.next.x?n:n.next,h===i))return a}n=n.next}while(n!==t);if(!a)return null;let s=a,c=a.x,u=a.y,f=1/0;n=a;do{if(i>=n.x&&n.x>=c&&i!==n.x&&zb(o<u?i:r,o,c,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);HB(n,e)&&(h<f||h===f&&(n.x>a.x||n.x===a.x&&h4e(a,n)))&&(a=n,f=h)}n=n.next}while(n!==s);return a}function h4e(e,t){return ia(e.prev,e,t.prev)<0&&ia(t.next,e,e.next)<0}function m4e(e,t,n,i){let o=e;do o.z===0&&(o.z=UY(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,p4e(o)}function p4e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let a=i,s=0;for(let u=0;u<n&&(s++,a=a.nextZ,!!a);u++);let c=n;for(;s>0||c>0&&a;)s!==0&&(c===0||!a||i.z<=a.z)?(o=i,i=i.nextZ,s--):(o=a,a=a.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=a}r.nextZ=null,n*=2}while(t>1);return e}function UY(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 A4e(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 zb(e,t,n,i,o,r,a,s){return(o-a)*(t-s)>=(e-a)*(r-s)&&(e-a)*(i-s)>=(n-a)*(t-s)&&(n-a)*(r-s)>=(o-a)*(i-s)}function g4e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!_4e(e,t)&&(HB(e,t)&&HB(t,e)&&y4e(e,t)&&(ia(e.prev,e,t.prev)||ia(e,t.prev,t))||lQ(e,t)&&ia(e.prev,e,e.next)>0&&ia(t.prev,t,t.next)>0)}function ia(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function lQ(e,t){return e.x===t.x&&e.y===t.y}function Ale(e,t,n,i){let o=cQ(ia(e,t,n)),r=cQ(ia(e,t,i)),a=cQ(ia(n,i,e)),s=cQ(ia(n,i,t));return!!(o!==r&&a!==s||o===0&&sQ(e,n,t)||r===0&&sQ(e,i,t)||a===0&&sQ(n,e,i)||s===0&&sQ(n,t,i))}function sQ(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 cQ(e){return e>0?1:e<0?-1:0}function _4e(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&&Ale(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function HB(e,t){return ia(e.prev,e,e.next)<0?ia(e,t,e.next)>=0&&ia(e,e.prev,t)>=0:ia(e,t,e.prev)<0||ia(e,e.next,t)<0}function y4e(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 gle(e,t){let n=zY(e.i,e.x,e.y),i=zY(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 mle(e,t,n,i){let o=zY(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 WB(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 zY(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function C4e(e,t,n,i){let o=0;for(let r=t,a=n-i;r<n;r+=i)o+=(e[a]-e[r])*(e[r+1]+e[a+1]),a=r;return o}var E4e=new d,I4e=new d,w_={};w_.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],a=e[o];n+=r.x*a.y-a.x*r.y}return n*.5};w_.computeWindingOrder2D=function(e){return w_.computeArea2D(e)>0?ts.COUNTER_CLOCKWISE:ts.CLOCKWISE};w_.triangulate=function(e,t){let n=Q.packArray(e);return GY(n,t,2)};var Ele=new d,Ile=new d,ble=new d,_le=new d,yle=new d,Cle=new d,xA=new d,xle=new Q,Tle=new Q,Sle=new Q,Gb=new Q;w_.computeSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(s=0;s<c;s++){let I=t[s];if(u[h++]=I.x,u[h++]=I.y,u[h++]=I.z,r){let x=i[s];f[p++]=x.x,f[p++]=x.y}}let A=[],m={},_=e.maximumRadius,y=D.chordLength(o,_),C=y*y;for(;a.length>0;){let I=a.pop(),x=a.pop(),S=a.pop(),w=d.fromArray(u,S*3,Ele),v=d.fromArray(u,x*3,Ile),R=d.fromArray(u,I*3,ble),N,L,g;r&&(N=Q.fromArray(f,S*2,xle),L=Q.fromArray(f,x*2,Tle),g=Q.fromArray(f,I*2,Sle));let b=d.multiplyByScalar(d.normalize(w,_le),_,_le),T=d.multiplyByScalar(d.normalize(v,yle),_,yle),B=d.multiplyByScalar(d.normalize(R,Cle),_,Cle),M=d.magnitudeSquared(d.subtract(b,T,xA)),O=d.magnitudeSquared(d.subtract(T,B,xA)),G=d.magnitudeSquared(d.subtract(B,b,xA)),k=Math.max(M,O,G),z,F,H;k>C?M===k?(z=`${Math.min(S,x)} ${Math.max(S,x)}`,s=m[z],l(s)||(F=d.add(w,v,xA),d.multiplyByScalar(F,.5,F),u.push(F.x,F.y,F.z),s=u.length/3-1,m[z]=s,r&&(H=Q.add(N,L,Gb),Q.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),a.push(S,s,I),a.push(s,x,I)):O===k?(z=`${Math.min(x,I)} ${Math.max(x,I)}`,s=m[z],l(s)||(F=d.add(v,R,xA),d.multiplyByScalar(F,.5,F),u.push(F.x,F.y,F.z),s=u.length/3-1,m[z]=s,r&&(H=Q.add(L,g,Gb),Q.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),a.push(x,s,S),a.push(s,I,S)):G===k&&(z=`${Math.min(I,S)} ${Math.max(I,S)}`,s=m[z],l(s)||(F=d.add(R,w,xA),d.multiplyByScalar(F,.5,F),u.push(F.x,F.y,F.z),s=u.length/3-1,m[z]=s,r&&(H=Q.add(g,N,Gb),Q.multiplyByScalar(H,.5,H),f.push(H.x,H.y))),a.push(I,s,x),a.push(s,S,x)):(A.push(S),A.push(x),A.push(I))}let E={attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:u})},indices:A,primitiveType:Pe.TRIANGLES};return r&&(E.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:f})),new yt(E)};var b4e=new me,x4e=new me,T4e=new me,VY=new me;w_.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??D.RADIANS_PER_DEGREE;let r=l(i),a=n.slice(0),s,c=t.length,u=new Array(c*3),f=new Array(c*2),h=0,p=0;for(s=0;s<c;s++){let S=t[s];if(u[h++]=S.x,u[h++]=S.y,u[h++]=S.z,r){let w=i[s];f[p++]=w.x,f[p++]=w.y}}let A=[],m={},_=e.maximumRadius,y=D.chordLength(o,_),C=new Oc(void 0,void 0,e),E=new Oc(void 0,void 0,e),I=new Oc(void 0,void 0,e);for(;a.length>0;){let S=a.pop(),w=a.pop(),v=a.pop(),R=d.fromArray(u,v*3,Ele),N=d.fromArray(u,w*3,Ile),L=d.fromArray(u,S*3,ble),g,b,T;r&&(g=Q.fromArray(f,v*2,xle),b=Q.fromArray(f,w*2,Tle),T=Q.fromArray(f,S*2,Sle));let B=e.cartesianToCartographic(R,b4e),M=e.cartesianToCartographic(N,x4e),O=e.cartesianToCartographic(L,T4e);C.setEndPoints(B,M);let G=C.surfaceDistance;E.setEndPoints(M,O);let k=E.surfaceDistance;I.setEndPoints(O,B);let z=I.surfaceDistance,F=Math.max(G,k,z),H,Y,$,W,K;F>y?G===F?(H=`${Math.min(v,w)} ${Math.max(v,w)}`,s=m[H],l(s)||(Y=C.interpolateUsingFraction(.5,VY),$=(B.height+M.height)*.5,W=d.fromRadians(Y.longitude,Y.latitude,$,e,xA),u.push(W.x,W.y,W.z),s=u.length/3-1,m[H]=s,r&&(K=Q.add(g,b,Gb),Q.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),a.push(v,s,S),a.push(s,w,S)):k===F?(H=`${Math.min(w,S)} ${Math.max(w,S)}`,s=m[H],l(s)||(Y=E.interpolateUsingFraction(.5,VY),$=(M.height+O.height)*.5,W=d.fromRadians(Y.longitude,Y.latitude,$,e,xA),u.push(W.x,W.y,W.z),s=u.length/3-1,m[H]=s,r&&(K=Q.add(b,T,Gb),Q.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),a.push(w,s,v),a.push(s,S,v)):z===F&&(H=`${Math.min(S,v)} ${Math.max(S,v)}`,s=m[H],l(s)||(Y=I.interpolateUsingFraction(.5,VY),$=(O.height+B.height)*.5,W=d.fromRadians(Y.longitude,Y.latitude,$,e,xA),u.push(W.x,W.y,W.z),s=u.length/3-1,m[H]=s,r&&(K=Q.add(T,g,Gb),Q.multiplyByScalar(K,.5,K),f.push(K.x,K.y))),a.push(S,s,w),a.push(s,v,w)):(A.push(v),A.push(w),A.push(S))}let x={attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:u})},indices:A,primitiveType:Pe.TRIANGLES};return r&&(x.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:f})),new yt(x)};w_.scaleToGeodeticHeight=function(e,t,n,i){n=n??te.default;let o=E4e,r=I4e;if(t=t??0,i=i??!0,l(e)){let a=e.length;for(let s=0;s<a;s+=3)d.fromArray(e,s,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[s]=r.x,e[s+1]=r.y,e[s+2]=r.z}return e};var wi=w_;function B_(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(B_.prototype,{length:{get:function(){return this._length}}});B_.prototype.enqueue=function(e){this._array.push(e),this._length++};B_.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};B_.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};B_.prototype.contains=function(e){return this._array.indexOf(e)!==-1};B_.prototype.clear=function(){this._array.length=this._offset=this._length=0};B_.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var AE=B_;var yr={};yr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,a=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(a)){let s=a.length;for(let c=0;c<s;++c)i.push(a[c])}}return n};yr.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!l(r))continue;let a=r.positions,s=r.holes;if(t[n++]=l(a)?a.length:0,t[n++]=l(s)?s.length:0,l(a)){let c=a.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(a[u],t,n)}if(l(s)){let c=s.length;for(let u=0;u<c;++u)o.push(s[u])}}return n};yr.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),a=o>0?new Array(o):void 0;for(let s=0;s<i;++s,t+=n.packedLength)r[s]=n.unpack(e,t);for(let s=0;s<o;++s)a[s]=yr.unpackPolygonHierarchy(e,t,n),t=a[s].startingIndex,delete a[s].startingIndex;return{positions:r,holes:a,startingIndex:t}};var gE=new Q;function Dle(e,t,n,i){return Q.subtract(t,e,gE),Q.multiplyByScalar(gE,n/i,gE),Q.add(e,gE,gE),[gE.x,gE.y]}var D_=new d;function S4e(e,t,n,i){return d.subtract(t,e,D_),d.multiplyByScalar(D_,n/i,D_),d.add(e,D_,D_),[D_.x,D_.y,D_.z]}yr.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(D.log2(o)));return Math.pow(2,r)};var fQ=new me,dQ=new me,w4e=new me,B4e=new d,uQ=new Oc;yr.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,fQ),r=e.cartesianToCartographic(n,dQ),s=new Oc(o,r,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(s)));return Math.pow(2,c)};yr.subdivideTexcoordLine=function(e,t,n,i,o,r){let a=yr.subdivideLineCount(n,i,o),s=Q.distance(e,t),c=s/a,u=r;u.length=a*2;let f=0;for(let h=0;h<a;h++){let p=Dle(e,t,h*c,s);u[f++]=p[0],u[f++]=p[1]}return u};yr.subdivideLine=function(e,t,n,i){let o=yr.subdivideLineCount(e,t,n),r=d.distance(e,t),a=r/o;l(i)||(i=[]);let s=i;s.length=o*3;let c=0;for(let u=0;u<o;u++){let f=S4e(e,t,u*a,r);s[c++]=f[0],s[c++]=f[1],s[c++]=f[2]}return s};yr.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,a){let s=n.cartesianToCartographic(i,fQ),c=n.cartesianToCartographic(o,dQ);uQ.setEndPoints(s,c);let u=uQ.surfaceDistance/r,f=Math.max(0,Math.ceil(D.log2(u))),h=Math.pow(2,f),p=Q.distance(e,t),A=p/h,m=a;m.length=h*2;let _=0;for(let y=0;y<h;y++){let C=Dle(e,t,y*A,p);m[_++]=C[0],m[_++]=C[1]}return m};yr.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,fQ),a=e.cartesianToCartographic(n,dQ),s=new Oc(r,a,e);if(l(o)||(o=[]),s.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let c=s.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),h=s.surfaceDistance/f,p=o;p.length=f*3;let A=0;for(let m=0;m<f;m++){let _=s.interpolateUsingSurfaceDistance(m*h,w4e),y=e.cartographicToCartesian(_,B4e);p[A++]=y.x,p[A++]=y.y,p[A++]=y.z}return p};var D4e=new d,v4e=new d,P4e=new d,R4e=new d;yr.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??te.default;let r=D4e,a=v4e,s=P4e,c=R4e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,s),i.geodeticSurfaceNormal(s,r),c=i.scaleToGeodeticSurface(s,c),a=d.multiplyByScalar(r,n,a),a=d.add(c,a,a),u[h+f]=a.x,u[h+1+f]=a.y,u[h+2+f]=a.z,o&&(c=d.clone(s,c)),a=d.multiplyByScalar(r,t,a),a=d.add(c,a,a),u[h]=a.x,u[h+1]=a.y,u[h+2]=a.z}return e};yr.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new AE;o.enqueue(e);let r,a,s;for(;o.length!==0;){let c=o.dequeue(),u=c.positions;if(t)for(s=u.length,r=0;r<s;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=jo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(r=0;r<f;r++){let h=c.holes[r],p=h.positions;if(t)for(s=p.length,a=0;a<s;++a)n.scaleToGeodeticSurface(p[a],p[a]);if(p=jo(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let A=0;for(l(h.holes)&&(A=h.holes.length),a=0;a<A;a++)o.enqueue(h.holes[a])}i.push(u)}return i};var M4e=new me;function N4e(e,t,n){let i=n.cartesianToCartographic(e,fQ),o=n.cartesianToCartographic(t,dQ);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;uQ.setEndPoints(i,o);let r=uQ.findIntersectionWithLatitude(0,M4e);if(!l(r))return;let a=Math.min(i.longitude,o.longitude),s=Math.max(i.longitude,o.longitude);if(Math.abs(s-a)>D.PI){let c=a;a=s,s=c}if(!(r.longitude<a||r.longitude>s))return n.cartographicToCartesian(r)}function L4e(e,t,n,i){if(i===un.RHUMB)return N4e(e,t,n);let o=di.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var O4e=new me;function F4e(e,t,n){let i=[],o,r,a,s,c,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],a=D.sign(o.z),s=D.sign(r.z);let f=h=>t.cartesianToCartographic(h,O4e).longitude;if(a===0)i.push({position:u,type:a,visited:!1,next:s,theta:f(o)});else if(s!==0){if(c=L4e(o,r,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:a,visited:!1,next:s,theta:f(c)})}++u}return i}function vle(e,t,n,i,o,r,a){let s=[],c=r,u=h=>p=>p.position===h,f=[];do{let h=n[c];s.push(h);let p=i.findIndex(u(c)),A=i[p];if(!l(A)){++c;continue}let{visited:m,type:_,next:y}=A;if(A.visited=!0,_===0){if(y===0){let x=i[p-(a?1:-1)];if(x?.position===c+1)x.visited=!0;else{++c;continue}}if(!m&&a&&y>0||r===c&&!a&&y<0){++c;continue}}if(!(a?_>=0:_<=0)){++c;continue}m||f.push(c);let E=p+(a?1:-1),I=i[E];if(!l(I)){++c;continue}c=I.position}while(c<n.length&&c>=0&&c!==r&&s.length<n.length);e.splice(t,o,s);for(let h of f)t=vle(e,++t,n,i,0,h,!a);return t}yr.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],a=r.slice();if(r.length<3){i[o]=a,++o;continue}let s=F4e(a,t,n);if(a.length===r.length||s.length<=1){i[o]=a,++o;continue}s.sort((u,f)=>u.theta-f.theta);let c=a[0].z>=0;o=vle(i,o,a,s,1,0,c)}return i};yr.polygonsFromHierarchy=function(e,t,n,i,o,r){let a=[],s=[],c=new AE;c.enqueue(e);let u=l(r);for(;c.length!==0;){let f=c.dequeue(),h=f.positions,p=f.holes,A,m;if(i)for(m=h.length,A=0;A<m;A++)o.scaleToGeodeticSurface(h[A],h[A]);if(t||(h=jo(h,d.equalsEpsilon,!0)),h.length<3)continue;let _=n(h);if(!l(_))continue;let y=[],C=wi.computeWindingOrder2D(_);if(C===ts.CLOCKWISE&&(_.reverse(),h=h.slice().reverse()),u){u=!1;let w=[h];if(w=r(w,w),w.length>1){for(let v of w)c.enqueue(new Fc(v,p));continue}}let E=h.slice(),I=l(p)?p.length:0,x=[],S;for(A=0;A<I;A++){let w=p[A],v=w.positions;if(i)for(m=v.length,S=0;S<m;++S)o.scaleToGeodeticSurface(v[S],v[S]);if(t||(v=jo(v,d.equalsEpsilon,!0)),v.length<3)continue;let R=n(v);if(!l(R))continue;C=wi.computeWindingOrder2D(R),C===ts.CLOCKWISE&&(R.reverse(),v=v.slice().reverse()),x.push(v),y.push(E.length),E=E.concat(v),_=_.concat(R);let N=0;for(l(w.holes)&&(N=w.holes.length),S=0;S<N;S++)c.enqueue(w.holes[S])}a.push({outerRing:h,holes:x}),s.push({positions:E,positions2D:_,holes:y})}return{hierarchy:a,polygons:s}};var Q4e=new Q,k4e=new d,U4e=new Qe,z4e=new J;yr.computeBoundingRectangle=function(e,t,n,i,o){let r=Qe.fromAxisAngle(e,i,U4e),a=J.fromQuaternion(r,z4e),s=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let A=d.clone(n[p],k4e);J.multiplyByVector(a,A,A);let m=t(A,Q4e);l(m)&&(s=Math.min(s,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=s,o.y=u,o.width=c-s,o.height=f-u,o};yr.createGeometryFromPositions=function(e,t,n,i,o,r,a){let s=wi.triangulate(t.positions2D,t.holes);s.length<3&&(s=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(o){let h=c.length,p=new Array(h*3),A=0;for(let y=0;y<h;y++){let C=c[y];p[A++]=C.x,p[A++]=C.y,p[A++]=C.z}let m={attributes:{position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:p})},indices:s,primitiveType:Pe.TRIANGLES};u&&(m.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:Q.packArray(f)}));let _=new yt(m);return r.normal?jn.computeNormal(_):_}if(a===un.GEODESIC)return wi.computeSubdivision(e,c,s,f,i);if(a===un.RHUMB)return wi.computeRhumbLineSubdivision(e,c,s,f,i)};var wle=[],Ble=[],G4e=new d,V4e=new d;yr.computeWallGeometry=function(e,t,n,i,o,r){let a,s,c,u,f,h,p,A,m,_=e.length,y=0,C=0,E=l(t),I=E?t.positions:void 0;if(o)for(s=_*3*2,a=new Array(s*2),E&&(m=_*2*2,A=new Array(m*2)),c=0;c<_;c++)u=e[c],f=e[(c+1)%_],a[y]=a[y+s]=u.x,++y,a[y]=a[y+s]=u.y,++y,a[y]=a[y+s]=u.z,++y,a[y]=a[y+s]=f.x,++y,a[y]=a[y+s]=f.y,++y,a[y]=a[y+s]=f.z,++y,E&&(h=I[c],p=I[(c+1)%_],A[C]=A[C+m]=h.x,++C,A[C]=A[C+m]=h.y,++C,A[C]=A[C+m]=p.x,++C,A[C]=A[C+m]=p.y,++C);else{let R=D.chordLength(i,n.maximumRadius),N=0;if(r===un.GEODESIC)for(c=0;c<_;c++)N+=yr.subdivideLineCount(e[c],e[(c+1)%_],R);else if(r===un.RHUMB)for(c=0;c<_;c++)N+=yr.subdivideRhumbLineCount(n,e[c],e[(c+1)%_],R);for(s=(N+_)*3,a=new Array(s*2),E&&(m=(N+_)*2,A=new Array(m*2)),c=0;c<_;c++){u=e[c],f=e[(c+1)%_];let L,g;E&&(h=I[c],p=I[(c+1)%_]),r===un.GEODESIC?(L=yr.subdivideLine(u,f,R,Ble),E&&(g=yr.subdivideTexcoordLine(h,p,u,f,R,wle))):r===un.RHUMB&&(L=yr.subdivideRhumbLine(n,u,f,R,Ble),E&&(g=yr.subdivideTexcoordRhumbLine(h,p,n,u,f,R,wle)));let b=L.length;for(let T=0;T<b;++T,++y)a[y]=L[T],a[y+s]=L[T];if(a[y]=f.x,a[y+s]=f.x,++y,a[y]=f.y,a[y+s]=f.y,++y,a[y]=f.z,a[y+s]=f.z,++y,E){let T=g.length;for(let B=0;B<T;++B,++C)A[C]=g[B],A[C+m]=g[B];A[C]=p.x,A[C+m]=p.x,++C,A[C]=p.y,A[C+m]=p.y,++C}}}_=a.length;let x=Ue.createTypedArray(_/3,_-e.length*6),S=0;for(_/=6,c=0;c<_;c++){let R=c,N=R+1,L=R+_,g=L+1;u=d.fromArray(a,R*3,G4e),f=d.fromArray(a,N*3,V4e),!d.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(x[S++]=R,x[S++]=L,x[S++]=N,x[S++]=N,x[S++]=L,x[S++]=g)}let w={attributes:new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})}),indices:x,primitiveType:Pe.TRIANGLES};return E&&(w.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:A})),new yt(w)};var ni=yr;function oa(e,t){this.position=e,l(this.position)||(this.position=new Q),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=oa.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(oa.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=Q.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var Vb=new me,H4e=new d;oa.prototype.getLatitude=function(e){l(e)||(e=te.default),Vb.latitude=this.conformalLatitude,Vb.longitude=this.longitude,Vb.height=0;let t=this.ellipsoid.cartographicToCartesian(Vb,H4e);return e.cartesianToCartographic(t,Vb),Vb.latitude};var W4e=new In,j4e=new d,Y4e=new d;oa.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=oa.NORTH_POLE_TANGENT_PLANE,o=oa.SOUTH_POLE;n<0&&(i=oa.SOUTH_POLE_TANGENT_PLANE,o=oa.NORTH_POLE);let r=W4e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,j4e),d.normalize(r.direction,r.direction);let a=di.rayPlane(r,i.plane,Y4e),s=d.subtract(a,o,a),c=d.dot(i.xAxis,s),u=n*d.dot(i.yAxis,s);return l(t)?(t.position=new Q(c,u),t.tangentPlane=i,t):new oa(new Q(c,u),i)};oa.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=oa.fromCartesian(e[i],t[i]);return t};oa.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new oa(e.position,e.tangentPlane)};oa.HALF_UNIT_SPHERE=Object.freeze(new te(.5,.5,.5));oa.NORTH_POLE=Object.freeze(new d(0,0,.5));oa.SOUTH_POLE=Object.freeze(new d(0,0,-.5));oa.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Fa(oa.NORTH_POLE,oa.HALF_UNIT_SPHERE));oa.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Fa(oa.SOUTH_POLE,oa.HALF_UNIT_SPHERE));var Il=oa;var q4e=new me,Ple=new me;function K4e(e,t,n,i){let r=i.cartesianToCartographic(e,q4e).height,a=i.cartesianToCartographic(t,Ple);a.height=r,i.cartographicToCartesian(a,t);let s=i.cartesianToCartographic(n,Ple);s.height=r-100,i.cartographicToCartesian(s,n)}var Rle=new et,X4e=new d,J4e=new d,Z4e=new d,$4e=new d,e9e=new d,t9e=new d,hQ=new d,Wm=new d,Hb=new d,n9e=new Q,i9e=new Q,o9e=new d,Mle=new Qe,r9e=new J,a9e=new J;function HY(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=l(n.attributes.st)?n.attributes.st.values:void 0,a=o.length,s=e.wall,c=e.top||s,u=e.bottom||s;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,A=e.ellipsoid,m=e.stRotation,_=e.perPositionHeight,y=n9e;y.x=f.x,y.y=f.y;let C=t.st?new Float32Array(2*(a/3)):void 0,E;t.normal&&(_&&c&&!s?E=n.attributes.normal.values:E=new Float32Array(a));let I=t.tangent?new Float32Array(a):void 0,x=t.bitangent?new Float32Array(a):void 0,S=i?new Float32Array(a):void 0,w=0,v=0,R=J4e,N=Z4e,L=$4e,g=!0,b=r9e,T=a9e;if(m!==0){let O=Qe.fromAxisAngle(h,m,Mle);b=J.fromQuaternion(O,b),O=Qe.fromAxisAngle(h,-m,Mle),T=J.fromQuaternion(O,T)}else b=J.clone(J.IDENTITY,b),T=J.clone(J.IDENTITY,T);let B=0,M=0;c&&u&&(B=a/2,M=a/3,a/=2);for(let O=0;O<a;O+=3){let G=d.fromArray(o,O,o9e);if(t.st&&!l(r)){let k=J.multiplyByVector(b,G,X4e);k=A.scaleToGeodeticSurface(k,k);let z=p([k],i9e)[0];Q.subtract(z,y,z);let F=D.clamp(z.x/f.width,0,1),H=D.clamp(z.y/f.height,0,1);u&&(C[w+M]=F,C[w+1+M]=H),c&&(C[w]=F,C[w+1]=H),w+=2}if(t.normal||t.tangent||t.bitangent||i){let k=v+1,z=v+2;if(s){if(O+3<a){let F=d.fromArray(o,O+3,e9e);if(g){let H=d.fromArray(o,O+a,t9e);_&&K4e(G,F,H,A),d.subtract(F,G,F),d.subtract(H,G,H),R=d.normalize(d.cross(H,F,R),R),g=!1}d.equalsEpsilon(F,G,D.EPSILON10)&&(g=!0)}(t.tangent||t.bitangent)&&(L=A.geodeticSurfaceNormal(G,L),t.tangent&&(N=d.normalize(d.cross(L,R,N),N)))}else R=A.geodeticSurfaceNormal(G,R),(t.tangent||t.bitangent)&&(_&&(hQ=d.fromArray(E,v,hQ),Wm=d.cross(d.UNIT_Z,hQ,Wm),Wm=d.normalize(J.multiplyByVector(T,Wm,Wm),Wm),t.bitangent&&(Hb=d.normalize(d.cross(hQ,Wm,Hb),Hb))),N=d.cross(d.UNIT_Z,R,N),N=d.normalize(J.multiplyByVector(T,N,N),N),t.bitangent&&(L=d.normalize(d.cross(R,N,L),L)));t.normal&&(e.wall?(E[v+B]=R.x,E[k+B]=R.y,E[z+B]=R.z):u&&(E[v+B]=-R.x,E[k+B]=-R.y,E[z+B]=-R.z),(c&&!_||s)&&(E[v]=R.x,E[k]=R.y,E[z]=R.z)),i&&(s&&(R=A.geodeticSurfaceNormal(G,R)),S[v+B]=-R.x,S[k+B]=-R.y,S[z+B]=-R.z),t.tangent&&(e.wall?(I[v+B]=N.x,I[k+B]=N.y,I[z+B]=N.z):u&&(I[v+B]=-N.x,I[k+B]=-N.y,I[z+B]=-N.z),c&&(_?(I[v]=Wm.x,I[k]=Wm.y,I[z]=Wm.z):(I[v]=N.x,I[k]=N.y,I[z]=N.z))),t.bitangent&&(u&&(x[v+B]=L.x,x[k+B]=L.y,x[z+B]=L.z),c&&(_?(x[v]=Hb.x,x[k]=Hb.y,x[z]=Hb.z):(x[v]=L.x,x[k]=L.y,x[z]=L.z))),v+=3}}t.st&&!l(r)&&(n.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:C})),t.normal&&(n.attributes.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:E})),t.tangent&&(n.attributes.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:I})),t.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:x})),i&&(n.attributes.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:S}))}if(e.extrude&&l(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===mn.TOP)c&&u||s?h=h.fill(1,0,f/2):c&&(h=h.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var Nle=[];function s9e(e,t,n,i,o,r,a,s,c,u){let f={walls:[]},h;if(a||s){let E=ni.createGeometryFromPositions(e,t,n,i,r,c,u),I=E.attributes.position.values,x=E.indices,S,w;if(a&&s){let v=I.concat(I);S=v.length/3,w=Ue.createTypedArray(S,x.length*2),w.set(x);let R=x.length,N=S/2;for(h=0;h<R;h+=3){let L=w[h]+N,g=w[h+1]+N,b=w[h+2]+N;w[h+R]=b,w[h+1+R]=g,w[h+2+R]=L}if(E.attributes.position.values=v,r&&c.normal){let L=E.attributes.normal.values;E.attributes.normal.values=new Float32Array(v.length),E.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=E.attributes.st.values;E.attributes.st.values=new Float32Array(S*2),E.attributes.st.values=L.concat(L)}E.indices=w}else if(s){for(S=I.length/3,w=Ue.createTypedArray(S,x.length),h=0;h<x.length;h+=3)w[h]=x[h+2],w[h+1]=x[h+1],w[h+2]=x[h];E.indices=w}f.topAndBottom=new Lt({geometry:E})}let p=o.outerRing,A=Fa.fromPoints(p,e),m=A.projectPointsOntoPlane(p,Nle),_=wi.computeWindingOrder2D(m);_===ts.CLOCKWISE&&(p=p.slice().reverse());let y=ni.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new Lt({geometry:y}));let C=o.holes;for(h=0;h<C.length;h++){let E=C[h];m=A.projectPointsOntoPlane(E,Nle),_=wi.computeWindingOrder2D(m),_===ts.COUNTER_CLOCKWISE&&(E=E.slice().reverse()),y=ni.computeWallGeometry(E,n,e,i,r,u),f.walls.push(new Lt({geometry:y}))}return f}function ed(e){let t=e.polygonHierarchy,n=e.vertexFormat??ke.DEFAULT,i=e.ellipsoid??te.default,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.stRotation??0,a=e.textureCoordinates,s=e.perPositionHeight??!1,c=s&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=ke.clone(n),this._ellipsoid=te.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=s,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??un.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=a,this.packedLength=ni.computeHierarchyPackedLength(t,d)+te.packedLength+ke.packedLength+(a?ni.computeHierarchyPackedLength(a,Q):1)+12}ed.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new ed(t)};ed.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,Q):t[n++]=-1,t[n++]=e.packedLength,t};var c9e=te.clone(te.UNIT_SPHERE),l9e=new ke,u9e={polygonHierarchy:{}};ed.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,c9e);t+=te.packedLength;let r=ke.unpack(e,t,l9e);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,A=e[t++]===1,m=e[t++]===1,_=e[t++],y=e[t++],C=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,Q);l(C)?(t=C.startingIndex,delete C.startingIndex):t++;let E=e[t++];return l(n)||(n=new ed(u9e)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._height=a,n._extrudedHeight=s,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=A,n._shadowVolume=m,n._offsetAttribute=_===-1?void 0:_,n._arcType=y,n._textureCoordinates=C,n.packedLength=E,n};var f9e=new Q,d9e=new Q,h9e=new Il;function Lle(e,t,n,i,o,r){let a=e.longitude,s=a>=0?a:a+D.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,s),o.eastOverIdl=Math.max(o.eastOverIdl,s),r.west=Math.min(r.west,a),r.east=Math.max(r.east,a);let c=e.getLatitude(n),u=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==un.RHUMB){let p=Q.subtract(t.position,e.position,f9e),A=Q.dot(t.position,p)/Q.dot(p,p);if(A>0&&A<1){let m=Q.add(t.position,Q.multiplyByScalar(p,-A,p),d9e),_=Il.clone(t,h9e);_.position=m;let y=_.getLatitude(n);r.south=Math.min(r.south,y),r.north=Math.max(r.north,y),Math.abs(c)>Math.abs(y)&&(u=y)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=Q.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var Ole=new Il,m9e=new Il,$f={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};ed.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ce),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,$f.northAngle=0,$f.southAngle=0,$f.westOverIdl=Number.POSITIVE_INFINITY,$f.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Il.fromCartesian(e[0],m9e);for(let a=1;a<o;a++){let s=Il.fromCartesian(e[a],Ole);Lle(s,r,t,n,$f,i),r=Il.clone(s,r)}return Lle(Il.fromCartesian(e[0],Ole),r,t,n,$f,i),i.east-i.west>$f.eastOverIdl-$f.westOverIdl&&(i.west=$f.westOverIdl,i.east=$f.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs($f.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs($f.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var p9e=new Il;function A9e(e,t,n){return e.height>=D.PI||e.width>=D.PI?Il.fromCartesian(t[0],p9e).tangentPlane:Fa.fromPoints(t,n)}var Fle=new me;function g9e(e,t,n){return(i,o)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let a=0;a<i.length;++a){let s=n.cartesianToCartographic(i[a],Fle);o[a]=new Q(s.longitude/D.PI,s.latitude/D.PI_OVER_TWO)}return o.length=i.length,o}return Il.fromCartesianArray(i,o)}return Fa.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function _9e(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(o,r)=>{if(e.south<0&&e.north>0){let a=n.cartesianToCartographic(o,Fle);return l(r)||(r=new Q),r.x=a.longitude/D.PI,r.y=a.latitude/D.PI_OVER_TWO,r}return Il.fromCartesian(o,r)};let i=Fa.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function y9e(e,t,n,i){return(o,r)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?ni.splitPolygonsOnEquator(o,t,n,r):o}function C9e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,Rle);let o=e,r=Fa.fromPoints(o,n);return ni.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Rle)}ed.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,a=e._perPositionHeight,s=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=l(f),p=r.positions;if(p.length<3)return;let A=e.rectangle,m=ni.polygonsFromHierarchy(r,h,g9e(A,p,n),!a,n,y9e(A,n,u,a)),_=m.hierarchy,y=m.polygons,C=function(B){return B},E=h?ni.polygonsFromHierarchy(f,!0,C,!1,n).polygons:void 0;if(_.length===0)return;let I=_[0].outerRing,x=C9e(I,A,n,o),S=[],w=e._height,v=e._extrudedHeight,R=e._perPositionHeightExtrude||!D.equalsEpsilon(w,v,0,D.EPSILON2),N={perPositionHeight:a,vertexFormat:t,geometry:void 0,rotationAxis:A9e(A,I,n).plane.normal,projectTo2d:_9e(A,I,n),boundingRectangle:x,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(N.extrude=!0,N.top=s,N.bottom=c,N.shadowVolume=e._shadowVolume,N.offsetAttribute=e._offsetAttribute,L=0;L<y.length;L++){let B=s9e(n,y[L],h?E[L]:void 0,i,_[L],a,s,c,t,u),M;s&&c?(M=B.topAndBottom,N.geometry=ni.scaleToGeodeticHeightExtruded(M.geometry,w,v,n,a)):s?(M=B.topAndBottom,M.geometry.attributes.position.values=wi.scaleToGeodeticHeight(M.geometry.attributes.position.values,w,n,!a),N.geometry=M.geometry):c&&(M=B.topAndBottom,M.geometry.attributes.position.values=wi.scaleToGeodeticHeight(M.geometry.attributes.position.values,v,n,!0),N.geometry=M.geometry),(s||c)&&(N.wall=!1,M.geometry=HY(N),S.push(M));let O=B.walls;N.wall=!0;for(let G=0;G<O.length;G++){let k=O[G];N.geometry=ni.scaleToGeodeticHeightExtruded(k.geometry,w,v,n,a),k.geometry=HY(N),S.push(k)}}else for(L=0;L<y.length;L++){let B=new Lt({geometry:ni.createGeometryFromPositions(n,y[L],h?E[L]:void 0,i,a,t,u)});if(B.geometry.attributes.position.values=wi.scaleToGeodeticHeight(B.geometry.attributes.position.values,w,n,!a),N.geometry=B.geometry,B.geometry=HY(N),l(e._offsetAttribute)){let M=B.geometry.attributes.position.values.length,O=e._offsetAttribute===mn.NONE?0:1,G=new Uint8Array(M/3).fill(O);B.geometry.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:G})}S.push(B)}let g=jn.combineInstances(S)[0];g.attributes.position.values=new Float64Array(g.attributes.position.values),g.indices=Ue.createTypedArray(g.attributes.position.values.length/3,g.indices);let b=g.attributes,T=le.fromVertices(b.position.values);return t.position||delete b.position,new yt({attributes:b,indices:g.indices,primitiveType:g.primitiveType,boundingSphere:T,offsetAttribute:e._offsetAttribute})};ed.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new ed({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function E9e(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 yt._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(ed.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=ed.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=E9e(this)),this._textureCoordinateRotationPoints}}});var v_=ed;function _E(e){this._ellipsoid=e.ellipsoid??te.default,this._positions=kle(e.positions),this._cachedPositions=void 0,this._cachedRectangle=void 0}function kle(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=d.clone(e[i]);return n}function I9e(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t[i];if(!d.equals(o,r))return!1}return!0}Object.defineProperties(_E.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});_E.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new _E({positions:e.positions,ellipsoid:e.ellipsoid})};_E.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};_E.prototype.computeRectangle=function(e){if(I9e(this._positions,this._cachedPositions))return ce.clone(this._cachedRectangle,e);let t=v_.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e);return this._cachedPositions=kle(this._positions),this._cachedRectangle=ce.clone(t),t};var b9e=new ce,Qle=new d;_E.prototype.computeSphericalExtents=function(e){l(e)||(e=new ce);let t=this.computeRectangle(b9e),n=me.toCartesian(ce.southwest(t),this.ellipsoid,Qle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=me.toCartesian(ce.northeast(t),this.ellipsoid,Qle),i=Math.sqrt(n.x*n.x+n.y*n.y),o=D.fastApproximateAtan2(i,n.z),r=D.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var jB=_E;var mQ=`in vec2 v_textureCoordinates;
|
|
|
|
uniform int u_polygonsLength;
|
|
uniform int u_extentsLength;
|
|
uniform highp sampler2D u_polygonTexture;
|
|
uniform highp sampler2D u_extentsTexture;
|
|
|
|
int getPolygonIndex(float dimension, vec2 coord) {
|
|
vec2 uv = coord.xy * dimension;
|
|
return int(floor(uv.y) * dimension + floor(uv.x));
|
|
}
|
|
|
|
vec2 getLookupUv(ivec2 dimensions, int i) {
|
|
int pixY = i / dimensions.x;
|
|
int pixX = i - (pixY * dimensions.x);
|
|
float pixelWidth = 1.0 / float(dimensions.x);
|
|
float pixelHeight = 1.0 / float(dimensions.y);
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
return vec2(u, v);
|
|
}
|
|
|
|
vec4 getExtents(int i) {
|
|
return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
|
|
}
|
|
|
|
ivec2 getPositionsLengthAndExtentsIndex(int i) {
|
|
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
|
|
vec4 value = texture(u_polygonTexture, uv);
|
|
return ivec2(int(value.x), int(value.y));
|
|
}
|
|
|
|
vec2 getPolygonPosition(int i) {
|
|
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
|
|
return texture(u_polygonTexture, uv).xy;
|
|
}
|
|
|
|
vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
|
|
float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
|
|
float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
|
|
return vec2(latitude, longitude);
|
|
}
|
|
|
|
void main() {
|
|
int lastPolygonIndex = 0;
|
|
out_FragColor = vec4(1.0);
|
|
|
|
// Get the relevant region of the texture
|
|
float dimension = float(u_extentsLength);
|
|
if (u_extentsLength > 2) {
|
|
dimension = ceil(log2(float(u_extentsLength)));
|
|
}
|
|
int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);
|
|
|
|
if (regionIndex >= u_extentsLength) {
|
|
return; // done (no polygons in this region)
|
|
}
|
|
|
|
for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
|
|
ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
|
|
int positionsLength = positionsLengthAndExtents.x;
|
|
int polygonExtentsIndex = positionsLengthAndExtents.y;
|
|
lastPolygonIndex += 1;
|
|
|
|
// Read the individual polygon extent (2 pixels: south/west, latRange/lonRange)
|
|
vec2 extentsSouthWest = getPolygonPosition(lastPolygonIndex);
|
|
vec2 extentsRange = getPolygonPosition(lastPolygonIndex + 1);
|
|
vec4 polygonExtent = vec4(extentsSouthWest, extentsRange);
|
|
lastPolygonIndex += 2;
|
|
|
|
if (polygonExtentsIndex < regionIndex) {
|
|
lastPolygonIndex += positionsLength;
|
|
continue; // skip to next (TODO: could optimize further if we knew how many polygons to skip)
|
|
} else if (polygonExtentsIndex > regionIndex) {
|
|
break; // done (we know polygons are sorted by regionIndex)
|
|
}
|
|
|
|
// Only compute signed distance for the relevant part of the atlas
|
|
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); // current pixel position
|
|
|
|
// Only consider polygons whos boundingbox includes current pixel (with a slight padding)
|
|
float padding = 0.05; // 5% of polygon extents
|
|
float polygonNorth = polygonExtent.x + polygonExtent.z;
|
|
float polygonEast = polygonExtent.y + polygonExtent.w;
|
|
float latPadding = padding * polygonExtent.z; // padding as fraction of latitude range
|
|
float lonPadding = padding * polygonExtent.w; // padding as fraction of longitude range
|
|
if (p.x < polygonExtent.x - latPadding || p.x > polygonNorth + latPadding ||
|
|
p.y < polygonExtent.y - lonPadding || p.y > polygonEast + lonPadding) {
|
|
lastPolygonIndex += positionsLength;
|
|
continue; // skip to next
|
|
}
|
|
|
|
float s = 1.0;
|
|
|
|
// Check each edge for absolute distance.
|
|
// Cache the previous vertex to halve the texture reads per iteration.
|
|
vec2 prev = getPolygonPosition(lastPolygonIndex + positionsLength - 1);
|
|
for (int i = 0; i < positionsLength; i++) {
|
|
vec2 a = getPolygonPosition(lastPolygonIndex + i);
|
|
vec2 b = prev;
|
|
prev = a;
|
|
|
|
vec2 ab = b - a;
|
|
vec2 pa = p - a;
|
|
float t = dot(pa, ab) / dot(ab, ab);
|
|
t = clamp(t, 0.0, 1.0);
|
|
|
|
vec2 pq = pa - t * ab;
|
|
float d = length(pq);
|
|
|
|
// Inside / outside computation to determine sign
|
|
bvec3 cond = bvec3(p.y >= a.y,
|
|
p.y < b.y,
|
|
ab.x * pa.y > ab.y * pa.x);
|
|
if (all(cond) || all(not(cond))) s = -s;
|
|
if (abs(d) < abs(clipAmount)) {
|
|
clipAmount = d;
|
|
}
|
|
}
|
|
|
|
// Normalize the range to [0,1]
|
|
vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
|
|
// In the case where we've iterated through multiple polygons, take the minimum
|
|
out_FragColor = min(out_FragColor, result);
|
|
|
|
lastPolygonIndex += positionsLength;
|
|
}
|
|
}`;function Ea(e){e=e??V.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.quality=e.quality??1,this.polygonAdded=new _e,this.polygonRemoved=new _e,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(Ea.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+3*this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});Ea.prototype.add=function(e){let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Ea.prototype.get=function(e){return this._polygons[e]};Ea.prototype.contains=function(e){return this._polygons.some(t=>jB.equals(t,e))};Ea.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(i=>jB.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};function x9e(e,t,n){let i=Math.max(e.height*t,0),o=Math.max(e.width*t,0),r=ce.clone(e,n);return r.south-=i,r.west-=o,r.north+=i,r.east+=o,r.south=Math.max(r.south,-Math.PI),r.west=Math.max(r.west,-Math.PI),r.north=Math.min(r.north,Math.PI),r.east=Math.min(r.east,Math.PI),r}function T9e(e,t){let i=[],o=e.length;for(let s=0;s<o;++s){let c=x9e(t[s],2.5),u=-1;for(let f=0;f<i.length;++f)if(l(ce.simpleIntersection(i[f].extent,c))){u=f;break}if(u===-1)i.push({extent:c,polygonIndices:[s]});else{let f=i[u];f.polygonIndices.push(s),ce.union(f.extent,c,f.extent);for(let h=0;h<i.length;++h)h!==u&&l(ce.simpleIntersection(i[h].extent,f.extent))&&(f.polygonIndices.push(...i[h].polygonIndices),ce.union(f.extent,i[h].extent,f.extent),i.splice(h,1),h<u&&u--,h=-1)}}let r=i.map(s=>s.extent),a=new Map;return i.forEach((s,c)=>s.polygonIndices.forEach(u=>a.set(u,c))),{extentsList:r,extentsIndexByPolygon:a}}Ea.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 S9e(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,o=i.map(f=>f.computeSphericalExtents()),{extentsList:r,extentsIndexByPolygon:a}=T9e(i,o),s=Array.from(i.keys()).sort((f,h)=>a.get(f)-a.get(h)),c=0;for(let f of s){let h=i[f],p=h.length;t[c++]=p,t[c++]=a.get(f);let A=o[f];t[c++]=A.south,t[c++]=A.west,t[c++]=A.north-A.south,t[c++]=A.east-A.west;for(let m=0;m<p;++m){let _=h.positions[m],y=Math.hypot(_.x,_.y),C=D.fastApproximateAtan2(y,_.z),E=D.fastApproximateAtan2(_.x,_.y);t[c++]=C,t[c++]=E}}let u=0;for(let f of r){let h=1/(f.east-f.west),p=1/(f.north-f.south);n[u++]=f.south,n[u++]=f.west,n[u++]=p,n[u++]=h}e._extentsCount=r.length}var WY=new Q;Ea.prototype.update=function(e){let t=e.context;if(!Ea.isSupported(e))throw new ue("ClippingPolygonCollections are only supported for WebGL 2.");this.debugShowDistanceTexture&&l(this._signedDistanceTexture)&&(l(this.debugCommand)||(this.debugCommand=w9e(this._signedDistanceTexture,e.context)),e.commandList.push(this.debugCommand));let n=this._polygons.reduce((a,s)=>a+s.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(l(i)){let a=i.width*i.height;(a<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*a)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!l(i)){let a=Ea.getTextureResolution(i,this.pixelsNeededForPolygonPositions,WY);i=new vt({context:t,width:a.x,height:a.y,pixelFormat:Ke.RG,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*2),this._polygonsTexture=i}if(l(o)){let a=o.width*o.height;(a<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*a)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!l(o)){let a=Ea.getTextureResolution(o,this.pixelsNeededForExtents,WY);o=new vt({context:t,width:a.x,height:a.y,pixelFormat:Ke.RGBA,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(a.x*a.y*4),this._extentsTexture=o}if(S9e(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!l(r)){let a=Ea.getClippingDistanceTextureResolution(this,WY);r=new vt({context:t,width:a.x,height:a.y,pixelFormat:t.webgl2?Ke.RED:Ke.LUMINANCE,pixelDatatype:He.FLOAT,sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:si.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=B9e(this)};function w9e(e,t){let i=t.createViewportQuadCommand(`uniform highp sampler2D billboard_texture;
|
|
in vec2 v_textureCoordinates;
|
|
float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
|
|
float signedDistance = texture(clippingDistance, uv).r;
|
|
return (signedDistance - 0.5) * 2.0;
|
|
}
|
|
void main()
|
|
{
|
|
float dist = texture(billboard_texture, v_textureCoordinates).r;
|
|
if (dist > 0.5) {
|
|
out_FragColor = vec4(dist, 0.0, 0.0, 1.0);
|
|
} else {
|
|
out_FragColor = vec4(0.0, dist, 0.0, 1.0);
|
|
}
|
|
}
|
|
`,{uniformMap:{billboard_texture:function(){return e}}});return i.pass=Be.OVERLAY,i}Ea.prototype.queueCommands=function(e){l(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function B9e(e){let t=e._polygonsTexture,n=e._extentsTexture;return new Vl({fragmentShaderSource:mQ,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var Ule=new ce,D9e=new ce,v9e=new ce;Ea.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Xt.OUTSIDE;this.inverse&&(o=Xt.INSIDE);let r=e.rectangle;if(!l(r)&&l(e.boundingVolume?.computeCorners)){let a=e.boundingVolume.computeCorners();r=ce.fromCartesianArray(a,t,Ule)}l(r)||(r=ce.fromBoundingSphere(e.boundingSphere,t,Ule));for(let a=0;a<i;++a){let c=n[a].computeRectangle(v9e),u=ce.simpleIntersection(r,c,D9e);if(l(u))return Xt.INTERSECTING}return o};Ea.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ea.isSupported=function(e){return e?.context.webgl2};Ea.getTextureResolution=function(e,t,n){if(l(e))return n.x=e.width,n.y=e.height,n;let i=Nt.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Ea.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;if(l(n))return t.x=n.width,t.y=n.height,t;let i=e.quality,o=Math.max(128,Math.ceil(4096*i));return t.x=Math.min(Nt.maximumTextureSize,o),t.y=Math.min(Nt.maximumTextureSize,o),t};Ea.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return l(n)?(t.x=n.width,t.y=n.height,t):Ea.getTextureResolution(n,e.pixelsNeededForExtents,t)};Ea.prototype.isDestroyed=function(){return!1};Ea.prototype.destroy=function(){return l(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),fe(this)};var jm=Ea;var YB={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};YB.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?YB.SUNLIGHT:YB.SCENE_LIGHT:YB.NONE};var P_=Object.freeze(YB);function zle(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=P_.NONE}zle.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var Wb=zle;var Ym=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
|
|
|
|
uniform float u_atmosphereLightIntensity;
|
|
uniform float u_atmosphereRayleighScaleHeight;
|
|
uniform float u_atmosphereMieScaleHeight;
|
|
uniform float u_atmosphereMieAnisotropy;
|
|
uniform vec3 u_atmosphereRayleighCoefficient;
|
|
uniform vec3 u_atmosphereMieCoefficient;
|
|
|
|
const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters.
|
|
const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
/**
|
|
* This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as
|
|
* the transmittance value for the ray.
|
|
*
|
|
* @param {czm_ray} primaryRay The ray from the camera to the position.
|
|
* @param {float} primaryRayLength The length of the primary ray.
|
|
* @param {vec3} lightDirection The direction of the light to calculate the scattering from.
|
|
* @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to.
|
|
* @param {vec3} mieColor The variable the Mie scattering will be written to.
|
|
* @param {float} opacity The variable the transmittance will be written to.
|
|
* @glslFunction
|
|
*/
|
|
void computeScattering(
|
|
czm_ray primaryRay,
|
|
float primaryRayLength,
|
|
vec3 lightDirection,
|
|
float atmosphereInnerRadius,
|
|
out vec3 rayleighColor,
|
|
out vec3 mieColor,
|
|
out float opacity
|
|
) {
|
|
|
|
// Initialize the default scattering amounts to 0.
|
|
rayleighColor = vec3(0.0);
|
|
mieColor = vec3(0.0);
|
|
opacity = 0.0;
|
|
|
|
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
|
|
|
|
vec3 origin = vec3(0.0);
|
|
|
|
// Calculate intersection from the camera to the outer ring of the atmosphere.
|
|
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
|
|
|
|
// Return empty colors if no intersection with the atmosphere geometry.
|
|
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
|
|
return;
|
|
}
|
|
|
|
// To deal with smaller values of PRIMARY_STEPS (e.g. 4)
|
|
// we implement a split strategy: sky or horizon.
|
|
// For performance reasons, instead of a if/else branch
|
|
// a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0
|
|
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
|
|
// Value close to 0.0: close to the horizon
|
|
// Value close to 1.0: above in the sky
|
|
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
|
|
|
|
// The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere.
|
|
float start_0 = primaryRayAtmosphereIntersect.start;
|
|
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
|
|
// The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller.
|
|
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
|
|
|
|
// For the number of ray steps, distinguish inside or outside atmosphere (outer space)
|
|
// (1) from outer space we have to use more ray steps to get a realistic rendering
|
|
// (2) within atmosphere we need fewer steps for faster rendering
|
|
float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters
|
|
float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
|
|
int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled.
|
|
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray.
|
|
|
|
// Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere.
|
|
float rayPositionLength = primaryRayAtmosphereIntersect.start;
|
|
// (1) Outside the atmosphere: constant rayStepLength
|
|
// (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps
|
|
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
|
|
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
|
|
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
|
|
|
|
vec3 rayleighAccumulation = vec3(0.0);
|
|
vec3 mieAccumulation = vec3(0.0);
|
|
vec2 opticalDepth = vec2(0.0);
|
|
vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
|
|
|
|
// Sample positions on the primary ray.
|
|
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
|
|
|
|
// The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (i >= PRIMARY_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along viewpoint ray.
|
|
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
|
|
|
|
// Calculate height of sample position above ellipsoid.
|
|
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate and accumulate density of particles at the sample position.
|
|
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
|
|
opticalDepth += sampleDensity;
|
|
|
|
// Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere.
|
|
czm_ray lightRay = czm_ray(samplePosition, lightDirection);
|
|
czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
|
|
|
|
float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
|
|
float lightPositionLength = 0.0;
|
|
|
|
vec2 lightOpticalDepth = vec2(0.0);
|
|
|
|
// Sample positions along the light ray, to accumulate incidence of light on the latest sample segment.
|
|
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
|
|
|
|
// The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (j >= LIGHT_STEPS) {
|
|
break;
|
|
}
|
|
|
|
// Calculate sample position along light ray.
|
|
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
|
|
|
|
// Calculate height of the light sample position above ellipsoid.
|
|
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
|
|
|
|
// Calculate density of photons at the light sample position.
|
|
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
|
|
|
|
// Increment distance on light ray.
|
|
lightPositionLength += lightStepLength;
|
|
}
|
|
|
|
// Compute attenuation via the primary ray and the light ray.
|
|
vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
|
|
|
|
// Accumulate the scattering.
|
|
rayleighAccumulation += sampleDensity.x * attenuation;
|
|
mieAccumulation += sampleDensity.y * attenuation;
|
|
|
|
// Increment distance on primary ray.
|
|
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
|
|
}
|
|
|
|
// Compute the scattering amount.
|
|
rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
|
|
mieColor = u_atmosphereMieCoefficient * mieAccumulation;
|
|
|
|
// Compute the transmittance i.e. how much light is passing through the atmosphere.
|
|
opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
|
|
}
|
|
|
|
vec4 computeAtmosphereColor(
|
|
vec3 positionWC,
|
|
vec3 lightDirection,
|
|
vec3 rayleighColor,
|
|
vec3 mieColor,
|
|
float opacity
|
|
) {
|
|
// Setup the primary ray: from the camera position to the vertex position.
|
|
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
|
|
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
|
|
|
|
float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
|
|
float cosAngleSq = cosAngle * cosAngle;
|
|
|
|
float G = u_atmosphereMieAnisotropy;
|
|
float GSq = G * G;
|
|
|
|
// The Rayleigh phase function.
|
|
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
|
|
// The Mie phase function.
|
|
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
|
|
|
|
// The final color is generated by combining the effects of the Rayleigh and Mie scattering.
|
|
vec3 rayleigh = rayleighPhase * rayleighColor;
|
|
vec3 mie = miePhase * mieColor;
|
|
|
|
vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
|
|
|
|
return vec4(color, opacity);
|
|
}
|
|
`;var pQ=`uniform samplerCube u_radianceMap;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
|
|
const float twoSqrtPi = 2.0 * sqrt(czm_pi);
|
|
|
|
// Coutesy of https://www.ppsloan.org/publications/StupidSH36.pdf
|
|
float computeShBasis(int index, vec3 s) {
|
|
if (index == 0) { // l = 0, m = 0
|
|
return 1.0 / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 1) { // l = 1, m = -1
|
|
return -sqrt(3.0) * s.y / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 2) { // l = 1, m = 0
|
|
return sqrt(3.0) * s.z / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 3) { // l = 1, m = 1
|
|
return -sqrt(3.0) * s.x / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 4) { // l = 2, m = -2
|
|
return sqrt(15.0) * s.y * s.x / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 5) { // l = 2, m = -1
|
|
return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 6) { // l = 2, m = 0
|
|
return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 7) { // l = 2, m = 1
|
|
return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
|
|
}
|
|
|
|
if (index == 8) { // l = 2, m = 2
|
|
return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
|
|
}
|
|
|
|
return 0.0;
|
|
}
|
|
|
|
float vdcRadicalInverse(int i)
|
|
{
|
|
float r;
|
|
float base = 2.0;
|
|
float value = 0.0;
|
|
float invBase = 1.0 / base;
|
|
float invBi = invBase;
|
|
for (int x = 0; x < 100; x++)
|
|
{
|
|
if (i <= 0)
|
|
{
|
|
break;
|
|
}
|
|
r = mod(float(i), base);
|
|
value += r * invBi;
|
|
invBi *= invBase;
|
|
i = int(float(i) * invBase);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
vec2 hammersley2D(int i, int N)
|
|
{
|
|
return vec2(float(i) / float(N), vdcRadicalInverse(i));
|
|
}
|
|
|
|
// Sample count is relatively low for the sake of performance, but should still be enough to capture directionality needed for third-order harmonics
|
|
const int samples = 256;
|
|
const float solidAngle = 1.0 / float(samples);
|
|
|
|
void main() {
|
|
// Get the current coefficient based on the uv
|
|
vec2 uv = v_textureCoordinates.xy * 3.0;
|
|
int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));
|
|
|
|
for (int i = 0; i < samples; ++i) {
|
|
vec2 xi = hammersley2D(i, samples);
|
|
float phi = czm_twoPi * xi.x;
|
|
float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
|
|
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
|
|
vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));
|
|
|
|
// Generate the spherical harmonics basis from the direction
|
|
float Ylm = computeShBasis(coefficientIndex, direction);
|
|
|
|
vec3 lookupDirection = -direction.xyz;
|
|
lookupDirection.z = -lookupDirection.z;
|
|
|
|
vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
|
|
|
|
// Use the relevant function for this coefficient
|
|
out_FragColor += Ylm * color * solidAngle * sinTheta;
|
|
}
|
|
|
|
}
|
|
`;var AQ=`precision highp float;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
uniform vec3 u_faceDirection; // Current cubemap face
|
|
uniform vec3 u_positionWC;
|
|
uniform mat4 u_enuToFixedFrame;
|
|
uniform vec4 u_brightnessSaturationGammaIntensity;
|
|
uniform vec4 u_groundColor; // alpha component represent albedo
|
|
|
|
vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
|
|
vec2 scaledUV = uv * 2.0 - 1.0;
|
|
|
|
if (faceDir.x != 0.0) {
|
|
return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
|
|
} else if (faceDir.y != 0.0) {
|
|
return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
|
|
} else {
|
|
return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0);
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
float height = length(u_positionWC);
|
|
float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
|
|
float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);
|
|
|
|
// Scale the position to ensure the sky color is present, even when underground.
|
|
vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);
|
|
|
|
float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
|
|
float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;
|
|
|
|
vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
|
|
vec3 normalizedDirection = normalize(direction);
|
|
|
|
czm_ray ray = czm_ray(positionWC, normalizedDirection);
|
|
czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
|
|
if (!czm_isEmpty(intersection)) {
|
|
intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
|
|
}
|
|
|
|
bool onEllipsoid = intersection.start >= 0.0;
|
|
float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);
|
|
|
|
// Compute sky color for each position on a sphere at radius centered around the provided position's origin
|
|
vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;
|
|
|
|
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
|
|
vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
|
|
vec3 mieColor;
|
|
vec3 rayleighColor;
|
|
float opacity;
|
|
czm_computeScattering(
|
|
ray,
|
|
rayLength,
|
|
lightDirectionWC,
|
|
atmosphereInnerRadius,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
|
|
vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);
|
|
|
|
#ifdef ATMOSPHERE_COLOR_CORRECT
|
|
const bool ignoreBlackPixels = true;
|
|
atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
|
|
#endif
|
|
|
|
vec3 lookupDirection = -normalizedDirection;
|
|
// Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z.
|
|
lookupDirection.x = -lookupDirection.x;
|
|
lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
|
|
lookupDirection.x = -lookupDirection.x;
|
|
|
|
// Values outside the atmopshere are rendered as black, when they should be treated as transparent
|
|
float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
|
|
skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha); // Treat black as transparent
|
|
|
|
// Blend starmap with atmopshere scattering
|
|
float intensity = u_brightnessSaturationGammaIntensity.w;
|
|
vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
|
|
vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
|
|
vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);
|
|
|
|
// Compute ground color based on amount of reflected light, then blend it with ground atmosphere based on height
|
|
vec3 up = normalize(positionWC);
|
|
float occlusion = max(dot(lightDirectionWC, up), 0.05);
|
|
vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
|
|
vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));
|
|
|
|
vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);
|
|
|
|
float brightness = u_brightnessSaturationGammaIntensity.x;
|
|
float saturation = u_brightnessSaturationGammaIntensity.y;
|
|
float gamma = u_brightnessSaturationGammaIntensity.z;
|
|
|
|
#ifdef ENVIRONMENT_COLOR_CORRECT
|
|
color.rgb = mix(vec3(0.0), color.rgb, brightness);
|
|
color.rgb = czm_saturation(color.rgb, saturation);
|
|
#endif
|
|
color.rgb = pow(color.rgb, vec3(gamma)); // Normally this would be in the ifdef above, but there is a precision issue with the atmopshere scattering transmittance (alpha). Having this line is a workaround for that issue, even when gamma is 1.0.
|
|
color.rgb = czm_gammaCorrect(color.rgb);
|
|
|
|
out_FragColor = color;
|
|
}
|
|
`;var gQ=`precision highp float;
|
|
|
|
in vec3 v_textureCoordinates;
|
|
|
|
uniform float u_roughness;
|
|
uniform samplerCube u_radianceTexture;
|
|
uniform vec3 u_faceDirection;
|
|
|
|
float vdcRadicalInverse(int i)
|
|
{
|
|
float r;
|
|
float base = 2.0;
|
|
float value = 0.0;
|
|
float invBase = 1.0 / base;
|
|
float invBi = invBase;
|
|
for (int x = 0; x < 100; x++)
|
|
{
|
|
if (i <= 0)
|
|
{
|
|
break;
|
|
}
|
|
r = mod(float(i), base);
|
|
value += r * invBi;
|
|
invBi *= invBase;
|
|
i = int(float(i) * invBase);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
vec2 hammersley2D(int i, int N)
|
|
{
|
|
return vec2(float(i) / float(N), vdcRadicalInverse(i));
|
|
}
|
|
|
|
vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
|
|
{
|
|
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
|
|
float phi = czm_twoPi * xi.x;
|
|
float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
|
|
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
|
|
vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
|
|
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
vec3 tangentX = normalize(cross(upVector, N));
|
|
vec3 tangentY = cross(N, tangentX);
|
|
return tangentX * H.x + tangentY * H.y + N * H.z;
|
|
}
|
|
|
|
// Sample count is relatively low for the sake of performance, but should still be enough to prevent artifacting in lower roughnesses
|
|
const int samples = 128;
|
|
|
|
void main() {
|
|
vec3 normal = u_faceDirection;
|
|
vec3 V = normalize(v_textureCoordinates);
|
|
float roughness = u_roughness;
|
|
|
|
vec4 color = vec4(0.0);
|
|
float weight = 0.0;
|
|
for (int i = 0; i < samples; ++i) {
|
|
vec2 xi = hammersley2D(i, samples);
|
|
vec3 H = importanceSampleGGX(xi, roughness, V);
|
|
vec3 L = 2.0 * dot(V, H) * H - V; // reflected vector
|
|
|
|
float NdotL = max(dot(V, L), 0.0);
|
|
if (NdotL > 0.0) {
|
|
color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL;
|
|
weight += NdotL;
|
|
}
|
|
}
|
|
out_FragColor = color / weight;
|
|
}
|
|
`;var _Q=`in vec3 position;
|
|
out vec3 v_textureCoordinates;
|
|
|
|
uniform vec3 u_faceDirection;
|
|
|
|
vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
|
|
vec2 scaledUV = uv;
|
|
|
|
if (faceDir.x != 0.0) {
|
|
return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
|
|
} else if (faceDir.y != 0.0) {
|
|
return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
|
|
} else {
|
|
return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z);
|
|
}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
|
|
v_textureCoordinates.y = -v_textureCoordinates.y;
|
|
v_textureCoordinates.z = -v_textureCoordinates.z;
|
|
gl_Position = vec4(position, 1.0);
|
|
}
|
|
`;function pi(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??V.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Nt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=pi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new X;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new Q(i,i),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??pi.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(pi.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});pi._maximumComputeCommandCount=8;pi._activeComputeCommandCount=0;pi._nextFrameCommandQueue=[];pi._queueCommand=(e,t)=>{if(pi._activeComputeCommandCount>=pi._maximumComputeCommandCount){pi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),pi._activeComputeCommandCount++};pi._updateCommandQueue=e=>{if(pi._maximumComputeCommandCount=Math.log2(Nt.maximumCubeMapSize),pi._nextFrameCommandQueue.length>0&&pi._activeComputeCommandCount<pi._maximumComputeCommandCount){let t=pi._nextFrameCommandQueue.shift();for(;l(t)&&pi._activeComputeCommandCount<pi._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=pi._nextFrameCommandQueue.shift();continue}e.commandList.push(t),pi._activeComputeCommandCount++,t=pi._nextFrameCommandQueue.shift()}l(t)&&pi._nextFrameCommandQueue.push(t)}};pi.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};pi.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var P9e=new d,R9e=new d;function M9e(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,R9e),a=1.025,s=P9e,c=l(r)?d.magnitude(r):o.maximumRadius;return s.x=c*a,s.y=c,s.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,s)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(s,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Gle=new d,N9e=new P,L9e=new ie,O9e=new U;function F9e(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ta({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:Ke.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;l(o)||(o=new We({sources:[Ym,AQ]}),e._radianceMapFS=o),Wb.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,a=e._radiiAndDynamicAtmosphereColor,s=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(r,s,N9e),u=L9e;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of ta.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new vt({context:n,width:i.x,height:i.y,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),e._radianceMapTextures[f]=p;let A=f,m=new Vl({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>a,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ta.getDirection(h,Gle),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,O9e)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){pi._activeComputeCommandCount--;return}let _=e._radianceMapComputeCommands;_[A]=void 0;let y=new pa({context:n,colorTextures:[e._radianceMapTextures[A]]});y._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),y._unBind(),y.destroy(),pi._activeComputeCommandCount--,_.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,pi._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function Q9e(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,a=o.y/2,s=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,A,m,_,y)=>()=>{if(e.isDestroyed()||p.canceled){pi._activeComputeCommandCount--;return}let C=e._convolutionComputeCommands;C[A]=void 0,n.copyFace(t,m,_,y),c++,pi._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[A]=void 0,u()},h=0;for(let p=1;p<i;++p){for(let A of ta.faceNames()){l(e._specularMapTextures[h])&&e._specularMapTextures[h].destroy();let m=e._specularMapTextures[h]=new vt({context:s,width:r,height:a,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),_=e._va;l(_)||(_=ta.createVertexArray(s,A),e._va=_);let y=e._convolveSP;l(y)||(y=$t.fromCache({context:s,vertexShaderSource:_Q,fragmentShaderSource:gQ,attributeLocations:{positions:0}}),e._convolveSP=y);let C=new Vl({shaderProgram:y,vertexArray:_,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??s.defaultTexture,u_faceDirection:()=>ta.getDirection(A,Gle)}});C.postExecute=f(C,h,m,A,p),e._convolutionComputeCommands[h]=C,pi._queueCommand(C,t),++h}r/=2,a/=2}u()}var Vle=new Q(3,3);function k9e(e,t){let n=t.context,i=Vle,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new vt({context:n,width:i.x,height:i.y,pixelDatatype:He.FLOAT,pixelFormat:Ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new We({sources:[pQ]}),e._irradianceMapFS=r);let a=new Vl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});a.postExecute=()=>{if(e.isDestroyed()||a.canceled){pi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,pi._activeComputeCommandCount--},e._irradianceComputeCommand=a,pi._queueCommand(a,t),e._irradianceTextureDirty=!0}function U9e(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new pa({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Vle,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let a=0;a<9;++a)e._sphericalHarmonicCoefficients[a]=d.unpack(r,a*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[a],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[a]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}pi.prototype.update=function(e){let t=e.mode;if(!(pi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}pi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=M9e(this,e)||i===P_.SUNLIGHT&&!X.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=X.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(F9e(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Q9e(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(k9e(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){U9e(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};pi.prototype.isDestroyed=function(){return!1};pi.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),fe(this)};pi.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};pi.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(U.fromCssColorString("#717145"));pi.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var R_=pi;var qB={HIGHLIGHT:0,REPLACE:1,MIX:2};qB.getColorBlend=function(e,t){if(e===qB.HIGHLIGHT)return 0;if(e===qB.REPLACE)return 1;if(e===qB.MIX)return D.clamp(t,D.EPSILON4,1)};var bl=Object.freeze(qB);var z9e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},xl=Object.freeze(z9e);var G9e={STEP:0,LINEAR:1,CUBICSPLINE:2},qm=Object.freeze(G9e);var Hle={};function KB(e){this._count=e.count,this._properties=Ye(e.properties,!0)}KB.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,Hle)};KB.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,Hle,e)};KB.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ye(n[e],!0)};KB.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ye(n,!0)};var M_=KB;function pc(e){e=e??V.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy,this._texture=e.texture}Object.defineProperties(pc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}},texture:{get:function(){return this._texture}}});pc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};pc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};pc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};pc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var jY=[];pc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(jY);oi(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,jY);oi(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(jY);oi(t,n)}return t};pc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};pc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new M_({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};pc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};pc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};pc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};pc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};pc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};pc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};pc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};pc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),fe(this)};var cu=pc;function Wle(e){e=e??V.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,o=l(t.channels)?t.channels:[0],r=t,a=Xu.createModelTextureReader({textureInfo:r,channels:V9e(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let s=t.offset,c=t.scale,u=n.hasValueTransform||l(s)||l(c);s=s??n.offset,c=c??n.scale,s=n.unpackVectorAndMatrixTypes(s),c=n.unpackVectorAndMatrixTypes(c),this._offset=s,this._scale=c,this._hasValueTransform=u,this._textureReader=a,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Wle.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}}});function V9e(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var yQ=Wle;function YY(e){e=e??V.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,o=t.extensions,r=t.extras,a={};if(l(t.properties))for(let s in t.properties)t.properties.hasOwnProperty(s)&&(a[s]=new yQ({property:t.properties[s],classProperty:n.properties[s],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=a,this._extras=r,this._extensions=o}Object.defineProperties(YY.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}}});YY.prototype.getProperty=function(e){return this._properties[e]};var N_=YY;function jle(e){e=e??V.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||l(i)||l(o);i=i??n.offset,o=o??n.scale,i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(jle.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 CQ=jle;function qY(e){e=e??V.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new CQ({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(qY.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}}});qY.prototype.getProperty=function(e){return this._properties[e]};var jb=qY;function Yb(e){e=e??V.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t??[],this._propertyTextures=e.propertyTextures??[],this._propertyAttributes=e.propertyAttributes??[],this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(Yb.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});Yb.prototype.getPropertyTable=function(e){return this._propertyTables[e]};Yb.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};Yb.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};Yb.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return fe(this)};var js=Yb;function H9e(e){e=e??V.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let a=0;a<t.propertyTables.length;a++){let s=t.propertyTables[a],c=n.classes[s.class],u=W9e(s,e.bufferViews,c,e.context),f=new dh({count:s.count,properties:s.properties,class:c,bufferViews:e.bufferViews});i.push(new cu({id:a,name:s.name,count:s.count,metadataTable:f,extras:s.extras,extensions:s.extensions,texture:u}))}let o=[];if(l(t.propertyTextures))for(let a=0;a<t.propertyTextures.length;a++){let s=t.propertyTextures[a];o.push(new N_({id:a,name:s.name,propertyTexture:s,class:n.classes[s.class],textures:e.textures}))}let r=[];if(l(t.propertyAttributes))for(let a=0;a<t.propertyAttributes.length;a++){let s=t.propertyAttributes[a];r.push(new jb({id:a,name:s.name,class:n.classes[s.class],propertyAttribute:s}))}return new js({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var XB=4;function W9e(e,t,n,i){let o=e.properties;if(!l(o))return;let r=e.count,a;try{a=j9e(o,t,n,r)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let s=a.length;if(s===0)return;if(r>Nt.maximumTextureSize||s>Nt.maximumTextureSize){bt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Nt.maximumTextureSize}.`);return}let c=q9e(a,r),u=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST});return vt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:r,height:s,arrayBufferView:c}})}function j9e(e,t,n,i){let o=[],r=n.properties;for(let[a,s]of Object.entries(r)){if(!s.isGpuCompatible(XB))continue;let c=e[a],u=l(c)?t[c.values]:Y9e(s,i),f=u.length,h=s.cpuBytesPerElement(),p=f/h;if(p!==i)throw new ue(`Property with ID: "${a}" has (${p}), which does not match number of features in the property table: (${i}).`);o.push({view:u,classProperty:s})}return o}function Y9e(e,t){let n=e.noData,i=It.getComponentCount(e.type),o=e.isArray?e.arrayLength:1;e.type===It.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),o===1&&(n=[n]);let r=e.cpuBytesPerElement(),a=Qt.getSizeInBytes(e.valueType),s=new ArrayBuffer(r*t),c=new DataView(s),u=Qt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let h=0;h<o;h++)for(let p=0;p<i;p++){let A=h*i+p;u.set(r*f+A*a,n[h][p])}return new Uint8Array(s)}function q9e(e,t){let n=e.length,i=new Uint8Array(n*t*XB),o=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let r=0;r<n;r++){let a=e[r],s=a.classProperty,c=r*t*XB,u=s.valueType,f=Qt.gpuComponentType(u);if(u!==f){X9e(a,o,c);continue}K9e(a,i,c)}return i}function K9e(e,t,n){let i=e.view,o=e.classProperty.cpuBytesPerElement(),r=i.length/o;for(let a=0;a<r;a++){let s=a*o,c=n+a*XB;t.set(i.subarray(s,s+o),c)}}function X9e(e,t,n){let i=e.classProperty,o=e.view,r=i.valueType,a=Qt.gpuComponentType(r),s=i.cpuBytesPerElement(),c=o.length/s,u=new DataView(o.buffer,o.byteOffset,o.byteLength),f=Qt.getDataViewAccessors(u,r),h=Qt.getDataViewAccessors(t,a),p=Qt.downcastFunction(r);for(let A=0;A<c;A++){let m=A*s,_=n+A*XB,y=f.get(m);h.set(_,p(y))}}var EQ=H9e;function J9e(e){e=e??V.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,o=[],r;if(l(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let s=r[i],c=t.featureTables[s],u=n.classes[c.class],f=new dh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});o.push(new cu({id:s,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let a=[];if(l(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let s=r[i],c=t.featureTextures[s];a.push(new N_({id:s,propertyTexture:Z9e(c),class:n.classes[c.class],textures:e.textures}))}return new js({schema:n,propertyTables:o,propertyTextures:a,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Z9e(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:$9e(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=Pt(o.texture,r,!0)}return t}function $9e(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 IQ=J9e;var KY=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:o,gltfResource:r,baseResource:a,supportedImageFormats:s,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=r,this._baseResource=a,this._gltf=n,this._extension=i,this._extensionLegacy=o,this._supportedImageFormats=s,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=e5e(this),this._promise)}process(t){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let n=this._textureLoaders,i=n.length,o=!0;for(let c=0;c<i;++c){let f=n[c].process(t);o=o&&f}if(!o)return!1;let r=this._schemaLoader.schema,a={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let h=new Uint8Array(f.typedArray);a[u]=h}}let s={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(s[u]=f.texture)}return l(this._extension)?this._structuralMetadata=EQ({extension:this._extension,schema:r,bufferViews:a,textures:s,context:t.context}):this._structuralMetadata=IQ({extension:this._extensionLegacy,schema:r,bufferViews:a,textures:s}),Yle(this),this._state=gt.READY,!0}unload(){Yle(this),d5e(this),l(this._schemaLoader)&&Pi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function e5e(e){try{let t=r5e(e),n=u5e(e),i=f5e(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}function t5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,a=i.stringOffsets;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(a)&&(t[a]=!0)}}function n5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,a=i.stringOffsetBufferView;l(o)&&(t[o]=!0),l(r)&&(t[r]=!0),l(a)&&(t[a]=!0)}}function i5e(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let o=t[i];t5e(o.properties,n)}return n}function o5e(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;l(r)&&n5e(r,n)}}return n}async function r5e(e){let t;l(e._extension)?t=i5e(e._extension):t=o5e(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Pi.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 a5e(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i].properties;l(r)&&s5e(r,t)}return t}function s5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function c5e(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;l(r)&&l5e(r,t)}}return t}function l5e(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function u5e(e){let t;l(e._extension)?t=a5e(e._extension):t=c5e(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,a=e._frameState,s=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Pi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:a,asynchronous:s});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function f5e(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Pi.getSchemaLoader({resource:i})}else n=Pi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function Yle(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Pi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function d5e(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Pi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var bQ=KY;var qb={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};qb.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return qb.TRANSLATION;case"ROTATION":return qb.ROTATION;case"SCALE":return qb.SCALE;case"_FEATURE_ID":return qb.FEATURE_ID}};var Ua=Object.freeze(qb);var h5e=65534,m5e=255;function xQ(e){e=e??V.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Xle(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],p5e(this)}Object.defineProperties(xQ.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function p5e(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,a={};for(let s=0;s<t.length;s+=3){let c=t[s],u=t[s+1],f=t[s+2],h=!1,p=h||n.hasEdge(c,u),A=h||n.hasEdge(u,f),m=h||n.hasEdge(f,c),_=qle(i,c,u,f,p,A,m);for(;l(_);){let y=a[_];if(!l(y)){y=r+o.length;let C=_;for(;C>=r;)C=o[C-r];o.push(C),a[_]=y}y>h5e&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):y>m5e&&t instanceof Uint8Array&&(t=new Uint16Array(t)),_===c?(c=y,t[s]=y):_===u?(u=y,t[s+1]=y):(f=y,t[s+2]=y),_=qle(i,c,u,f,p,A,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function qle(e,t,n,i,o,r,a){let s=a?1:0,c=o?1:0,u=0,f=XY(e,t,s,c,u);if(f===0)return t;let h=0,p=o?1:0,A=r?1:0,m=XY(e,n,h,p,A);if(m===0)return n;let _=a?1:0,y=0,C=r?1:0,E=XY(e,i,_,y,C);if(E===0)return i;let I=f&m&E,x,S,w;if(I&1)x=0,S=1,w=2;else if(I&2)x=0,w=1,S=2;else if(I&4)S=0,x=1,w=2;else if(I&8)S=0,w=1,x=2;else if(I&16)w=0,x=1,S=2;else if(I&32)w=0,S=1,x=2;else{let L=JY(f),g=JY(m),b=JY(E);return L<g&&L<b?t:g<b?n:i}let v=t*3;e[v+x]=s,e[v+S]=c,e[v+w]=u;let R=n*3;e[R+x]=h,e[R+S]=p,e[R+w]=A;let N=i*3;e[N+x]=_,e[N+S]=y,e[N+w]=C}function XY(e,t,n,i,o){let r=t*3,a=e[r],s=e[r+1],c=e[r+2];return l(a)?(a===n&&s===i&&c===o)<<0|(a===n&&s===o&&c===i)<<1|(a===i&&s===n&&c===o)<<2|(a===i&&s===o&&c===n)<<3|(a===o&&s===n&&c===i)<<4|(a===o&&s===i&&c===n)<<5:63}function JY(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}xQ.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,a=new r(e.length+o*i);a.set(e);for(let s=0;s<o;s++){let c=t[s]*i,u=n+s*i;for(let f=0;f<i;f++)a[u+f]=a[c+f]}return a};xQ.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Nt.maximumTextureSize),i=n,o=Kle(i),r=[];for(;i>1;)i>>=1,r.push(Kle(i));let a=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:Ke.LUMINANCE,sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:si.LINEAR})});return t.outlineTexture=a,a};function Kle(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Xle(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),a=Math.max(i,o),s=r*this._originalVertexCount+a;this._edges.add(s)}}Xle.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var Kb=xQ;function Jle(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function A5e(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function TQ(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}TQ.prototype.postProcess=function(e){this.needsOutlines&&(g5e(this),C5e(this,e)),this.needsGaussianSplats&&y5e(this,e)};function g5e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new Kb({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Ue.fromTypedArray(n.typedArray);let r=_5e(o.outlineCoordinates),a=new Jle(r);a.loadBuffer=!0,a.loadTypedArray=!1,e.attributePlans.push(a),t.outlineCoordinates=a.attribute;let s=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=s[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function _5e(e){let t=new bn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=j.FLOAT,t.type=zt.VEC3,t.normalized=!1,t.count=e.length/3,t}function y5e(e,t){let n=e.attributePlans,i=n.length;for(let o=0;o<i;o++){let r=n[o];r.loadBuffer=!1,r.loadTypedArray=!0}}function C5e(e,t){E5e(e.attributePlans,t),l(e.indicesPlan)&&I5e(e.indicesPlan,t)}function E5e(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,a=r.typedArray;if(o.loadBuffer){let s=tt.createVertexBuffer({typedArray:a,context:t,usage:Re.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}o.loadTypedArray||(r.typedArray=void 0)}}function I5e(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Re.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}TQ.AttributeLoadPlan=Jle;TQ.IndicesLoadPlan=A5e;var Xb=TQ;function b5e(e){e=e??V.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var SQ=b5e;function Zle(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(Zle.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var wQ=Zle;function $le(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties($le.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var BQ=$le;function eue(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(eue.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var DQ=eue;var x5e={Direct:"Direct",Indirect:"Indirect"},yE=Object.freeze(x5e);function tue(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(tue.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 JB=tue;function nue(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(nue.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 vQ=nue;function Jb(){}function iue(e){return new J(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function T5e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new wQ({position:t,adjustmentParams:n})}function S5e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=iue(e.covarianceMatrix);return new BQ({position:t,adjustmentParams:n,covarianceMatrix:i})}function w5e(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let a=new vQ({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(a)}return new DQ({groupFlags:t,rotationThetas:n,params:i})}Jb.load=function(e){let t=e.storageType;if(t===yE.Direct)return Jb.loadDirect(e);if(t===yE.Indirect)return Jb.loadIndirect(e);throw new ue(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};Jb.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let r of n){let a=T5e(r);t.push(a)}let i=iue(e.covarianceDirectUpperTriangle);return new JB({storageType:yE.Direct,anchorPointsDirect:t,covarianceDirect:i})};Jb.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let a of n){let s=S5e(a);t.push(s)}let i=e.intraTileCorrelationGroups,o=[];for(let a of i){let s=w5e(a);o.push(s)}return new JB({storageType:yE.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var PQ=Jb;function oue(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(oue.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 RQ=oue;function rue(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(rue.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var MQ=rue;function aue(e){this._ppeTextures=e}Object.defineProperties(aue.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var NQ=aue;function Gr(e){e=e??V.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,a=e.frameState,s=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=a,this._cacheKey=s,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}l(Object.create)&&(Gr.prototype=Object.create($i.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=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};Gr.prototype.load=function(){return l(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function B5e(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}Gr.prototype._loadTextures=function(){let e;l(this._extension)&&(e=B5e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,a=this._asynchronous,s=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Pi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:a});this._textureLoaders.push(u),this._textureIds.push(c),s.push(u.load())}return Promise.all(s)};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(l(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${Gr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},a=e.ppeTextures;for(let s=0;s<a.length;s++){let c=a[s],u=`ppeTexture_${s}`,f=Gr._createPpeTextureClassJson(c,s);r.classes[u]=f}return i=au.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),a=JSON.stringify(r);t.push(a)}return t};Gr._convertToStructuralMetadata=function(e,t){let n=[],i=Gr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let a=0;a<o.length;a++){let s=o[a],c=`ppeTexture_${a}`,f=s.traits.source,h=i.classes[c],p={class:c,properties:{[f]:{index:s.index,texCoord:s.texCoord}}};n.push(new N_({id:a,name:s.name,propertyTexture:p,class:h,textures:t}))}return new js({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Gr.prototype.process=function(e){if(this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],a=this._extension;if(l(a.ppeTextures)){let u=a.ppeTextures;for(let f of u){let h=f.traits,p=new MQ({min:h.min,max:h.max,source:h.source}),A=new RQ({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(A)}}let s=new NQ(r);this._meshPrimitiveGpmLocal=s;let c=Gr._convertToStructuralMetadata(s,o);return this._structuralMetadata=c,this._state=gt.READY,!0};Gr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Pi.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 LQ=Gr;function D5e(e){let n=(e.extensions??V.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let o=[];oi(o,i);for(let r of n.primitiveGroups){let a=r.primitives[0];if(!l(a)||!i[a])return i;let s={...i[a],indices:r.indices};switch(s.mode){case ee.TRIANGLE_FAN:case ee.TRIANGLE_STRIP:case ee.LINE_STRIP:case ee.LINE_LOOP:break;default:return i}for(let c of r.primitives){let u=o[c];if(!l(u?.indices)||u.mode!==s.mode)return i;o[c]=void 0}o[a]=s}return o.filter(l)}var OQ=D5e;var{Attribute:v5e,Indices:P5e,FeatureIdAttribute:cue,FeatureIdTexture:lue,FeatureIdImplicitRange:uue,MorphTarget:R5e,Primitive:M5e,Instances:N5e,Skin:L5e,Node:O5e,AnimatedPropertyType:F5e,AnimationSampler:Q5e,AnimationTarget:k5e,AnimationChannel:U5e,Animation:z5e,ArticulationStage:G5e,Articulation:V5e,Asset:H5e,Scene:W5e,Components:j5e,MetallicRoughness:Y5e,SpecularGlossiness:q5e,Specular:K5e,Anisotropy:ZY,Clearcoat:$Y,LineStyle:X5e,Material:J5e,Vector:Z5e}=bn,er={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},eq=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:o=!1,asynchronous:r=!0,incrementallyLoadTextures:a=!0,upAxis:s=so.Y,forwardAxis:c=so.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:h=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:A=!0,loadForClassification:m=!1,renameBatchIdSemantic:_=!1}=t,{baseResource:y=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=y,this._typedArray=i,this._releaseGltfJson=o,this._asynchronous=r,this._incrementallyLoadTextures=a,this._upAxis=s,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=h,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=A,this._loadForClassification=m,this._renameBatchIdSemantic=_,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=er.NOT_LOADED,this._textureState=er.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}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=$5e(this),this._promise)}_process(t){return this._state===er.READY?!0:(this._state===er.PROCESSING&&tWe(this,t),this._resourcesLoaded&&this._state===er.POST_PROCESSING&&(nWe(this,t.context),this._state=er.PROCESSED),this._resourcesLoaded&&this._state===er.PROCESSED?(sue(this),this._typedArray=void 0,this._state=er.READY,!0):!1)}_processTextures(t){if(this._textureState===er.READY)return!0;if(this._textureState!==er.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let o=0;o<i.length;++o){let r=i[o].process(t);r&&l(this._textureCallbacks[o])&&(this._textureCallbacks[o](),this._textureCallbacks[o]=void 0),n=n&&r}return n?(this._textureState=er.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===er.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=eWe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=er.FAILED;let r=this._processError;this._processError=void 0,FQ(this,r)}let n=this._textureErrors.pop();if(l(n)){let r=this.getError("Failed to load glTF texture",n);throw r.name="TextureError",r}if(this._state===er.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=er.FAILED,FQ(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=er.FAILED,FQ(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===er.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Pi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,dje(this),sue(this),hje(this),mje(this),pje(this),Aje(this),this._components=void 0,this._typedArray=void 0,this._state=er.UNLOADED}};async function $5e(e){e._state=er.LOADING,e._textureState=er.LOADING;try{let t=Pi.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=er.LOADED,e._textureState=er.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=er.FAILED,e._textureState=er.FAILED,FQ(e,t)}}async function eWe(e,t){hn.supportsWebP.initialized||await hn.supportsWebP.initialize(),e._supportedImageFormats=new SQ({webp:hn.supportsWebP(),basis:t.context.supportsBasis});let n=fje(e,t);return e._state=er.PROCESSING,e._textureState=er.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Pi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function FQ(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function tWe(e,t){let n=!0,i=e._geometryLoaders;for(let a=0;a<i.length;++a){let s=i[a].process(t);s&&l(e._geometryCallbacks[a])&&(e._geometryCallbacks[a](),e._geometryCallbacks[a]=void 0),n=n&&s}let o=e._structuralMetadataLoader;if(l(o)){let a=o.process(t);a&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&a}let r=e._meshPrimitiveGpmLoader;if(l(r)){let a=r.process(t);a&&(l(e._components.structuralMetadata)&&bt("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&&a}n&&(e._state=er.POST_PROCESSING)}function nWe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),(o.needsOutlines||o.needsGaussianSplats)&&iWe(e,o)}}function iWe(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;l(o)&&n.push(o.buffer);let r=i.attributes;for(let s=0;s<r.length;s++){let c=r[s];l(c.buffer)&&n.push(c.buffer)}let a=i.indices;l(a)&&l(a.buffer)&&n.push(a.buffer)}function oWe(e,t,n,i,o,r,a,s,c){let u=e.gltfJson,h=u.accessors[t].bufferView;return Pi.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:a,loadTypedArray:s})}function rWe(e,t,n,i,o,r,a){return Pi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function aWe(e,t){let n=Pi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function fue(e,t,n){let i=t.byteOffset,o=Ku(e,t),r=t.count,a=Jf(t.type),s=t.componentType,c=j.getSizeInBytes(s),u=c*a,f=r*a;if(o===u)return n=new Uint8Array(n),j.createArrayBufferView(s,n.buffer,n.byteOffset+i,f);let h=j.createTypedArray(s,f),p=new DataView(n.buffer),A=new Array(a),m=I_(t.componentType);i=n.byteOffset+i;for(let _=0;_<r;++_){m(p,i,a,c,A);for(let y=0;y<a;++y)h[_*a+y]=A[y];i+=o}return h}function sWe(e,t){let n=e.type;if(n===zt.SCALAR)return t.fill(0);let i=zt.getMathType(n);return t.fill(i.clone(i.ZERO))}function cWe(e,t,n,i){let o=e.type,r=e.count;if(o===zt.SCALAR)for(let a=0;a<r;a++)n[a]=t[a];else if(o===zt.VEC4&&i)for(let a=0;a<r;a++)n[a]=Qe.unpack(t,a*4);else{let a=zt.getMathType(o),s=zt.getNumberOfComponents(o);for(let c=0;c<r;c++)n[c]=a.unpack(t,c*s)}return n}async function lWe(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let a=fue(r,n,t.typedArray);i=i??!1,cWe(n,a,o,i)}function L_(e,t,n){let i=new Array(t.count),o=t.bufferView;if(l(o)){let r=aWe(e,o),a=lWe(e,r,t,n,i);return e._loaderPromises.push(a),i}return sWe(t,i)}function lu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function uWe(e){return e===Number?0:new e}function fWe(e){switch(e){case j.BYTE:return 127;case j.UNSIGNED_BYTE:return 255;case j.SHORT:return 32767;case j.UNSIGNED_SHORT:return 65535;default:return 1}}var dWe={VEC2:new Q(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new ie(-1,-1,-1,-1)};function hWe(e,t){let n=fWe(e.componentDatatype),i=dWe[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function mWe(e,t,n){let i=e.decodeMatrix,o=lu(n,e.decodedMin),r=lu(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let a=new bn.Quantization;a.componentDatatype=t.componentDatatype,a.type=t.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new Q(i[6],i[7]),a.quantizedVolumeStepSize=new Q(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new d(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new d(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new ie(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new ie(i[0],i[6],i[12],i[18])),t.quantization=a}function pWe(e,t,n,i,o){let r=e.accessors[t],a=zt.getMathType(r.type),s=r.normalized??!1,c=new v5e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=uWe(a),c.componentDatatype=r.componentType,c.normalized=s,c.count=r.count,c.type=r.type,c.min=lu(a,r.min),c.max=lu(a,r.max),c.byteOffset=r.byteOffset,c.byteStride=Ku(e,r),Si(r,"WEB3D_quantized_attributes")&&mWe(r.extensions.WEB3D_quantized_attributes,c,a);let u=c.semantic===at.POSITION||c.semantic===at.NORMAL||c.semantic===at.TANGENT||c.semantic===at.TEXCOORD||c.semantic===at.FEATURE_ID||c.semantic===at.SCALE||c.semantic===at.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&s&&u&&hWe(c,a),c}function due(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var AWe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function tq(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=AWe;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function gWe(e){let t=e===at.POSITION,n=e===at.FEATURE_ID,i=e===at.TEXCOORD;return t||n||i}function _We(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=j.createArrayBufferView(o,t.typedArray.buffer)}}function yWe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=j.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===at.POSITION){let o=a=>{let s=1/0,c=-1/0,u=1/0,f=-1/0,h=1/0,p=-1/0;for(let A=0;A<a.length;A+=3){let m=a[A],_=a[A+1],y=a[A+2];s=Math.min(s,m),c=Math.max(c,m),u=Math.min(u,_),f=Math.max(f,_),h=Math.min(h,y),p=Math.max(p,y)}return[new d(s,u,h),new d(c,f,p)]},r=e.typedArray;[e.min,e.max]=o(r)}}function CWe(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let a=i.typedArray;n.typedArray=fue(e,t,a),o||(n.byteOffset=0,n.byteStride=void 0)}}function hue(e,t,n,i,o,r,a,s,c){let u=e.gltfJson,f=u.accessors[t],h=f.bufferView,p=n.gltfSemantic,A=n.renamedSemantic,m=n.modelSemantic,_=l(m)?due(A):void 0,C=pWe(u,t,p,m,_);if(!l(o)&&!l(h)&&!l(r))return C;let E=oWe(e,t,p,i,o,r,a,s,c),I=e._geometryLoaders.length;e._geometryLoaders.push(E);let x=E.load();return e._loaderPromises.push(x),e._geometryCallbacks[I]=()=>{l(o)&&l(o.attributes)&&l(o.attributes[p])?_We(C,E,a,s):l(r)?yWe(C,E,a,s):CWe(u,f,C,E,a,s)},C}function mue(e,t,n,i,o,r,a,s,c){let u=n.modelSemantic,f=u===at.POSITION,h=u===at.FEATURE_ID,p=f&&!a&&e._loadAttributesFor2D&&!c.scene3DOnly,A=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&h,_=e._loadAttributesAsTypedArray,y=!_,C=_||p||A||m,x=hue(e,t,n,i,o,r,s?!1:y,s?!0:C,c),S=new Xb.AttributeLoadPlan(x);return S.loadBuffer=y,S.loadTypedArray=C,S}function EWe(e,t,n,i,o){let r=e.gltfJson.accessors,a=l(n.ROTATION),s=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=tq(e,Ua,i),u=c.modelSemantic,f=u===Ua.TRANSLATION||u===Ua.ROTATION||u===Ua.SCALE,h=u===Ua.TRANSLATION,p=e._loadAttributesAsTypedArray||a&&f||!o.context.instancedArrays,A=e._enablePick&&!o.context.webgl2,m=!p,_=e._loadAttributesFor2D&&!o.scene3DOnly;return hue(e,t,c,void 0,void 0,void 0,m,p||h&&(!s||_||A),o)}function IWe(e,t,n,i,o,r){let a=e.gltfJson.accessors[t],s=a.bufferView,c=n.extensions??V.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(s))return;let h=new P5e;h.count=a.count;let p=e._loadAttributesAsTypedArray,A=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,m=e._loadForClassification&&i,y=!p,C=p||A||m||f,x=rWe(e,t,n,u,o?!1:y,o?!0:C,r),S=e._geometryLoaders.length;e._geometryLoaders.push(x);let w=x.load();e._loaderPromises.push(w),e._geometryCallbacks[S]=()=>{h.indexDatatype=x.indexDatatype,h.buffer=x.buffer,h.typedArray=x.typedArray};let v=new Xb.IndicesLoadPlan(h);return v.loadBuffer=y,v.loadTypedArray=C,v}function Tl(e,t,n,i){let o=e.gltfJson,r=Xu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(r))return;let a=Pi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),s=Xu.createModelTextureReader({textureInfo:t}),c=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=er.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[c]=()=>{s.texture=a.texture,l(i)&&(s.texture.sampler=i)},s}function bWe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=t,c=new q5e;return l(i)&&(c.diffuseTexture=Tl(e,i,n)),l(o)&&(c.specularGlossinessTexture=Tl(e,o,n)),c.diffuseFactor=lu(ie,r),c.specularFactor=lu(d,a),c.glossinessFactor=s,c}function xWe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=t,c=new Y5e;return l(i)&&(c.baseColorTexture=Tl(e,i,n)),l(o)&&(c.metallicRoughnessTexture=Tl(e,o,n)),c.baseColorFactor=lu(ie,r),c.metallicFactor=a,c.roughnessFactor=s,c}function TWe(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=t,s=new K5e;return l(o)&&(s.specularTexture=Tl(e,o,n)),l(a)&&(s.specularColorTexture=Tl(e,a,n)),s.specularFactor=i,s.specularColorFactor=lu(d,r),s}function SWe(e,t,n){let{anisotropyStrength:i=ZY.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=ZY.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,a=new ZY;return l(r)&&(a.anisotropyTexture=Tl(e,r,n)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function wWe(e,t,n){let{clearcoatFactor:i=$Y.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=$Y.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=t,c=new $Y;return l(o)&&(c.clearcoatTexture=Tl(e,o,n)),l(a)&&(c.clearcoatRoughnessTexture=Tl(e,a,n)),l(s)&&(c.clearcoatNormalTexture=Tl(e,s,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function BWe(e){if(!l(e))return;let t=new X5e;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function DWe(e,t,n){let i=new J5e,o=t.extensions??V.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=bWe(e,r,n):(l(u)&&(i.metallicRoughness=xWe(e,u,n)),l(a)&&!i.unlit&&(i.specular=TWe(e,a,n)),l(s)&&!i.unlit&&(i.anisotropy=SWe(e,s,n)),l(c)&&!i.unlit&&(i.clearcoat=wWe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Tl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Tl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Tl(e,t.occlusionTexture,n)),i.emissiveFactor=lu(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided;let f=o.BENTLEY_materials_point_style;if(l(f)&&l(f.diameter)){let h=f.diameter;h>=1&&(i.pointDiameter=Math.floor(h))}return i.lineStyle=BWe(o.BENTLEY_materials_line_style),i}function pue(e,t){let n=new cue;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 Aue(e,t,n,i){let o=new cue,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=due(r.attribute),o.positionalLabel=i,o}function gue(e,t){let n=new uue;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 _ue(e,t,n,i){let o=new uue,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function vWe(e,t,n,i){let o=new lue;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=Tl(e,r,n,jt.NEAREST);let s=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=s,o}function PWe(e,t,n,i,o,r){let a=new lue,s=t.featureIds,c=s.texture;return a.featureCount=o,a.propertyTableId=n,a.textureReader=Tl(e,c,i,jt.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function RWe(e,t,n,i,o){let r=new R5e,a=void 0,s=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let h=t[f],p=tq(e,at,f),A=mue(e,h,p,a,s,c,u,n,o);r.attributes.push(A.attribute),i.attributePlans.push(A)}return r}function MWe(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function yue(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let o=i.pbrMetallicRoughness??V.EMPTY_OBJECT,r=lu(ie,o.baseColorFactor);return l(r)?r:new ie(1,1,1,1)}function NWe(e){switch(e){case j.UNSIGNED_BYTE:return 255;case j.UNSIGNED_SHORT:return 65535;case j.UNSIGNED_INT:return 4294967295;default:throw new ue("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function LWe(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;o<t.length;o++){let r=t[o]??V.EMPTY_OBJECT,a=r.indices,s=e.gltfJson.accessors[a];if(!l(s))throw new ue("Edge visibility line string accessor not found!");let c=L_(e,s),u=NWe(s.componentType),f=l(r.material)?r.material:n;i[o]={indices:c,restartIndex:u,componentType:s.componentType,materialColor:yue(e,f)}}return i}function OWe(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let o=e.gltfJson.accessors[i];if(!l(o))throw new ue("Edge visibility accessor not found!");n.visibility=L_(e,o)}if(n.materialColor=yue(e,t.material),l(t.silhouetteNormals)){let o=e.gltfJson.accessors[t.silhouetteNormals];l(o)&&(n.silhouetteNormals=L_(e,o))}return l(t.lineStrings)&&(n.lineStrings=LWe(e,t.lineStrings,t.material)),n}function FWe(e,t,n,i){let o=new M5e,r=new Xb(o);e._primitiveLoadPlans.push(r);let a=t.material;l(a)&&(o.material=DWe(e,e.gltfJson.materials[a],i));let s=t.extensions??V.EMPTY_OBJECT,c=s.CESIUM_mesh_vector;l(c)&&(o.vector=kWe(e,c));let u=!1,f=s.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(f)&&(u=!0,r.needsOutlines=!0,r.outlineIndices=QWe(e,f,r)),o.edgeVisibility=OWe(e,s.EXT_mesh_primitive_edge_visibility);let h=MWe(s);l(h)&&(u=!0,r.needsGaussianSplats=!0);let p=e._loadForClassification,A=s.KHR_draco_mesh_compression,m=!1,_=t.attributes;if(l(_))for(let R in _){if(!_.hasOwnProperty(R))continue;let N=_[R],L=tq(e,at,R),g=L.modelSemantic;if(p&&!gWe(g))continue;g===at.FEATURE_ID&&(m=!0);let b=mue(e,N,L,t,A,h,n,u,i);r.attributePlans.push(b),o.attributes.push(b.attribute)}let y=t.targets;if(l(y)&&!p)for(let R=0;R<y.length;++R)o.morphTargets.push(RWe(e,y[R],u,r,i));let C=t.indices;if(l(C)){let R=IWe(e,C,t,m,u,i);l(R)&&(r.indicesPlan=R,o.indices=R.indices)}let E=s.EXT_structural_metadata,I=s.EXT_mesh_features,x=s.EXT_feature_metadata,S=l(x),w=s.NGA_gpm_local;l(I)?UWe(e,o,I,i):S&&zWe(e,o,x,i),l(E)?GWe(o,E):S&&VWe(e,o,x),l(w)&&HWe(o,w);let v=t.mode;if(p&&v!==Pe.TRIANGLES)throw new ue("Only triangle meshes can be used for classification.");return o.primitiveType=v,o}function QWe(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return L_(e,i,!1)}function kWe(e,t){if(!l(t))return;let n=new Z5e;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function o(r,a){if(l(r))return L_(e,i[r])}return n.polygonAttributeOffsets=o(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=o(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=o(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=o(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function UWe(e,t,n,i){let o;l(n)&&l(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let a=o[r],s=`featureId_${r}`,c;l(a.texture)?c=vWe(e,a,i,s):l(a.attribute)?c=pue(a,s):c=gue(a,s),t.featureIds.push(c)}}function zWe(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,a=n.featureIdAttributes;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,A=`featureId_${r}`;r++;let m;l(u.featureIds.attribute)?m=Aue(u,h,p,A):m=_ue(u,h,p,A),t.featureIds.push(m)}let s=n.featureIdTextures;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,A=`featureId_${r}`;r++;let m=PWe(e,u,h,i,p,A);t.featureIds.push(m)}}function GWe(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function VWe(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function HWe(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function WWe(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new N5e,r=i.attributes;if(l(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(EWe(e,f,r,u,n))}let a=i.extensions??V.EMPTY_OBJECT,s=t.EXT_instance_features,c=a.EXT_feature_metadata;return l(s)?jWe(o,s):l(c)&&YWe(e.gltfJson,o,c,e._sortedPropertyTableIds),o}function jWe(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,a;l(o.attribute)?a=pue(o,r):a=gue(o,r),e.featureIds.push(a)}}function YWe(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(l(r))for(let a=0;a<r.length;++a){let s=r[a],c=s.featureTable,u=i.indexOf(c),f=o[c].count,h=`instanceFeatureId_${a}`,p;l(s.featureIds.attribute)?p=Aue(s,u,f,h):p=_ue(s,u,f,h),t.featureIds.push(p)}}function qWe(e,t,n){let i=new O5e;i.name=t.name,i.matrix=lu(P,t.matrix),i.translation=lu(d,t.translation),i.rotation=lu(Qe,t.rotation),i.scale=lu(d,t.scale);let o=t.extensions??V.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations,s=o.CESIUM_mesh_vector;if(l(r)){if(e._loadForClassification)throw new ue("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=WWe(e,o,n)}l(a)&&(i.articulationName=a.articulationName),l(s)&&(i.meshVector=s);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=OQ(u);for(let A=0;A<f.length;++A)i.primitives.push(FWe(e,f[A],l(i.instances),n));let h=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(h)?h.slice():new Array(p.length).fill(0)}return i}function KWe(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(o,r){let a=qWe(e,o,t);return a.index=r,a});for(let o=0;o<i.length;++o){let r=n[o].children;if(l(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function XWe(e,t,n){let i=new L5e,o=t.joints;i.joints=o.map(a=>n[a]);let r=t.inverseBindMatrices;if(l(r)){let a=e.gltfJson.accessors[r];i.inverseBindMatrices=L_(e,a)}else i.inverseBindMatrices=new Array(o.length).fill(P.IDENTITY);return i}function JWe(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,a){let s=XWe(e,r,t);return s.index=a,s}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let a=o[r].skin;l(a)&&(t[r].skin=i[a])}return i}async function ZWe(e,t,n,i){let o=new bQ({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 $We(e,t,n,i){let o=new LQ({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 eje(e,t){let n=new Q5e,i=e.gltfJson.accessors,o=i[t.input];n.input=L_(e,o);let r=t.interpolation;n.interpolation=qm[r]??qm.LINEAR;let a=i[t.output];return n.output=L_(e,a,!0),n}function tje(e,t){let n=new k5e,i=e.node;if(!l(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=F5e[o],n}function nje(e,t,n){let i=new U5e,o=e.sampler;return i.sampler=t[o],i.target=tje(e.target,n),i}function ije(e,t,n){let i=new z5e;i.name=t.name;let o=t.samplers.map(function(a,s){let c=eje(e,a);return c.index=s,c}),r=t.channels.map(function(a){return nje(a,o,n)});return i.samplers=o,i.channels=r,i}function oje(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(o,r){let a=ije(e,o,t);return a.index=r,a})}function rje(e){let t=new G5e;t.name=e.name;let n=e.type.toUpperCase();return t.type=xl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function aje(e){let t=new V5e;return t.name=e.name,t.stages=e.stages.map(rje),t}function sje(e){let n=(e.extensions??V.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(aje):[]}function cje(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function lje(e,t){let n=new W5e,i=cje(e);return n.nodes=i.map(function(o){return t[o]}),n}var uje=new d;function fje(e,t){let n=e.gltfJson,i=n.extensions??V.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(l(r)){let E=r.featureTables,I=r.featureTextures,x=l(E)?E:[],S=l(I)?I:[];e._sortedPropertyTableIds=Object.keys(x).sort(),e._sortedFeatureTextureIds=Object.keys(S).sort()}let s=KWe(e,t),c=JWe(e,s),u=oje(e,s),f=sje(n),h=lje(n,s),p=new j5e,A=new H5e,m=n.asset.copyright;if(l(m)){let E=m.split(";").map(function(I){return new Et(I.trim())});A.credits=E}if(p.asset=A,p.scene=h,p.nodes=s,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(a)){let E=d.fromArray(a.center,0,uje);p.transform=P.fromTranslation(E,p.transform)}if(e._components=p,l(o)||l(r)){let E=ZWe(e,o,r,t);e._loaderPromises.push(E)}let _=i.NGA_gpm_local;if(l(_)){let E=PQ.load(_);e._components.extensions.NGA_gpm_local=E}let y=n.meshes;if(l(y))for(let E of y){let I=E.primitives;if(l(I))for(let x of I){let S=x.extensions;if(l(S)){let w=S.NGA_gpm_local;if(l(w)){let v=$We(e,n,w,t);e._loaderPromises.push(v)}}}}let C=[];return oi(C,e._loaderPromises),e._incrementallyLoadTextures||oi(C,e._texturesPromises),Promise.all(C)}function dje(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Pi.unload(t[n]);e._textureLoaders.length=0}function sue(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Pi.unload(t[n]);e._bufferViewLoaders.length=0}function hje(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Pi.unload(t[n]);e._geometryLoaders.length=0}function mje(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 pje(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Aje(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var td=eq;var QQ=`uniform sampler2D u_pointCloud_colorGBuffer;
|
|
uniform sampler2D u_pointCloud_depthGBuffer;
|
|
uniform vec2 u_distanceAndEdlStrength;
|
|
in vec2 v_textureCoordinates;
|
|
|
|
vec2 neighborContribution(float log2Depth, vec2 offset)
|
|
{
|
|
float dist = u_distanceAndEdlStrength.x;
|
|
vec2 texCoordOrig = v_textureCoordinates + offset * dist;
|
|
vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
|
|
vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
|
|
|
|
float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
|
|
float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));
|
|
|
|
// ignore depth values that are the clear depth
|
|
if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
|
|
return vec2(0.0);
|
|
}
|
|
|
|
// interpolate the two adjacent depth values
|
|
float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
|
|
return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
float log2Depth = log2(-eyeCoordinate.z);
|
|
|
|
if (depthOrLogDepth == 0.0) // 0.0 is the clear value for the gbuffer
|
|
{
|
|
discard;
|
|
}
|
|
|
|
vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
|
|
|
|
// sample from neighbors left, right, down, up
|
|
vec2 texelSize = 1.0 / czm_viewport.zw;
|
|
|
|
vec2 responseAndCount = vec2(0.0);
|
|
|
|
responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
|
|
responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
|
|
responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
|
|
responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
|
|
|
|
float response = responseAndCount.x / responseAndCount.y;
|
|
float strength = u_distanceAndEdlStrength.y;
|
|
float shade = exp(-response * 300.0 * strength);
|
|
color.rgb *= shade;
|
|
out_FragColor = vec4(color);
|
|
|
|
// Input and output depth are the same.
|
|
gl_FragDepth = depthOrLogDepth;
|
|
}
|
|
`;function Zb(){this._framebuffer=new bi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(Zb.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 gje(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var nq=new Q;function _je(e,t){let n=new We({defines:["LOG_DEPTH_WRITE"],sources:[QQ]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return nq.x=e._radius,nq.y=e._strength,nq}},o=Ve.fromCache({blending:sn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Be.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ui({framebuffer:e.framebuffer,color:new U(0,0,0,0),depth:1,renderState:Ve.fromCache(),pass:Be.CESIUM_3D_TILE,owner:e})}function yje(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),_je(e,t)}function Cue(e){return e.drawBuffers&&e.fragmentDepth}Zb.isSupported=Cue;function Cje(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
|
|
layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=We.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main()
|
|
{
|
|
czm_point_cloud_post_process_main();
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth();
|
|
out_FragData_1 = czm_packDepth(gl_FragDepth);
|
|
#else
|
|
out_FragData_1 = czm_packDepth(gl_FragCoord.z);
|
|
#endif
|
|
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}Zb.prototype.update=function(e,t,n,i){if(!Cue(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,yje(this,e.context);let o,r=e.commandList,a=r.length;for(o=t;o<a;++o){let u=r[o];if(u.primitiveType!==Pe.POINTS||u.pass===Be.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,h=p.originalShaderProgram),(!l(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=it.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=Cje(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let s=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,r.push(c),r.push(s)};Zb.prototype.isDestroyed=function(){return!1};Zb.prototype.destroy=function(){return gje(this),fe(this)};var O_=Zb;function Eue(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}Eue.isSupported=function(e){return O_.isSupported(e.context)};var TA=Eue;var Ac={},Eje=new ie(0,0,0,1),Vc=new ie,Ije=new et,iq=new Q,oq=new Q;Ac.worldToWindowCoordinates=function(e,t,n){return Ac.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var Iue=new ie,bue=new d;function ZB(e,t,n,i){let o=n.viewMatrix,r=P.multiplyByVector(o,ie.fromElements(e.x,e.y,e.z,1,Iue),Iue),a=d.multiplyComponents(t,d.normalize(r,bue),bue);return r.x+=t.x+a.x,r.y+=t.y+a.y,r.z+=a.z,P.multiplyByVector(n.frustum.projectionMatrix,r,i)}var bje=new me(Math.PI,D.PI_OVER_TWO),xje=new d,Tje=new d;Ac.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Ac.computeActualEllipsoidPosition(o,t,Eje);if(!l(r))return;let a=e.canvas,s=Ije;s.x=0,s.y=0,s.width=a.clientWidth,s.height=a.clientHeight;let c=e.camera,u=!1;if(o.mode===oe.SCENE2D){let f=e.mapProjection,h=bje,p=f.project(h,xje),A=d.clone(c.position,Tje),m=c.frustum.clone(),_=P.computeViewportTransformation(s,0,1,new P),y=c.frustum.projectionMatrix,C=c.positionWC.y,E=d.fromElements(D.sign(C)*p.x-C,0,-c.positionWC.x),I=At.pointToGLWindowCoordinates(y,_,E);if(C===0||I.x<=0||I.x>=a.clientWidth)u=!0;else{if(I.x>a.clientWidth*.5){s.width=I.x,c.frustum.right=p.x-C,Vc=ZB(r,n,c,Vc),Ac.clipToGLWindowCoordinates(s,Vc,iq),s.x+=I.x,c.position.x=-c.position.x;let x=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-x,Vc=ZB(r,n,c,Vc),Ac.clipToGLWindowCoordinates(s,Vc,oq)}else{s.x+=I.x,s.width-=I.x,c.frustum.left=-p.x-C,Vc=ZB(r,n,c,Vc),Ac.clipToGLWindowCoordinates(s,Vc,iq),s.x=s.x-s.width,c.position.x=-c.position.x;let x=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-x,Vc=ZB(r,n,c,Vc),Ac.clipToGLWindowCoordinates(s,Vc,oq)}d.clone(A,c.position),c.frustum=m.clone(),i=Q.clone(iq,i),(i.x<0||i.x>a.clientWidth)&&(i.x=oq.x)}}if(o.mode!==oe.SCENE2D||u){if(Vc=ZB(r,n,c,Vc),Vc.z<0&&!(c.frustum instanceof An)&&!(c.frustum instanceof Aa))return;i=Ac.clipToGLWindowCoordinates(s,Vc,i)}return i.y=a.clientHeight-i.y,i};Ac.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ac.worldToWindowCoordinates(e,t,n),!!l(n))return Ac.transformWindowToDrawingBuffer(e,n,n)};var SA=new d,Sje=new me;Ac.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,Sje);if(!l(r))return;if(o.project(r,SA),i===oe.COLUMBUS_VIEW)return d.fromElements(SA.z,SA.x,SA.y,n);if(i===oe.SCENE2D)return d.fromElements(0,SA.x,SA.y,n);let a=e.morphTime;return d.fromElements(D.lerp(SA.z,t.x,a),D.lerp(SA.x,t.y,a),D.lerp(SA.y,t.z,a),n)};var xue=new d,Tue=new d,Sue=new P;Ac.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,xue),P.computeViewportTransformation(e,0,1,Sue),P.multiplyByPoint(Sue,xue,Tue),Q.fromCartesian3(Tue,n)};Ac.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return Q.fromElements(t.x*o,t.y*r,n)};var wje=new ie,wue=new ie;Ac.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,a=r.currentFrustum,s=a.x,c=a.y;if(e.frameState.useLogDepth){let A=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,A)-1;n=c*(1-s/(m+s))/(c-s)}let u=e.view.passState.viewport,f=ie.clone(ie.UNIT_W,wje);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(l(p.fovy)){h=P.multiplyByVector(r.inverseViewProjection,f,wue);let A=1/h.w;d.multiplyByScalar(h,A,h)}else{let A=p.offCenterFrustum;l(A)&&(p=A),h=wue,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(s-c)-s-c)*.5,h.w=1,h=P.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var co=Ac;var $b={};$b._deprecationWarning=Gs;var wA=Uint32Array.BYTES_PER_ELEMENT;$b.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=wA;let r=o.getUint32(t,!0);if(r!==1)throw new ue(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=wA;let a=o.getUint32(t,!0);t+=wA;let s=o.getUint32(t,!0);t+=wA;let c=o.getUint32(t,!0);t+=wA;let u=o.getUint32(t,!0);t+=wA;let f=o.getUint32(t,!0);t+=wA;let h;u>=570425344?(t-=wA*2,h=s,u=c,f=0,s=0,c=0,$b._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=wA,h=u,u=s,f=c,s=0,c=0,$b._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;s===0?p={BATCH_LENGTH:h??0}:(p=Pr(i,t,s),t+=s);let A=new Uint8Array(e,t,c);t+=c;let m,_;u>0&&(m=Pr(i,t,u),t+=u,f>0&&(_=new Uint8Array(e,t,f),_=new Uint8Array(_),t+=f));let y=n+a-t;if(y===0)throw new ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,y):($b._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+y))),{batchLength:h,featureTableJson:p,featureTableBinary:A,batchTableJson:m,batchTableBinary:_,gltf:C}};var kQ=$b;function $B(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Bue(e,t,n,i,o,r){let a=e._cachedTypedArrays,s=a[t];return l(s)||(s=j.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),a[t]=s),s}function Bje(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=j.createTypedArray(n,i),o[t]=r),r}$B.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??j.UNSIGNED_INT,n=n??1,Bue(this,e,t,n,1,i.byteOffset)):i};$B.prototype.hasProperty=function(e){return l(this.json[e])};$B.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=j.fromName(i.componentType)),Bue(this,e,t,n,this.featuresLength,i.byteOffset)):Bje(this,e,t,i)};$B.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let a=this.getPropertyArray(e,t,n);if(n===1)return a[i];for(let s=0;s<n;++s)o[s]=a[n*i+s];return o};var Km=$B;function eD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput,a=Dje(n),s;l(a.jsonProperties)&&(s=new M_({count:t,properties:a.jsonProperties}));let c;l(a.hierarchy)&&(c=new Sb({extension:a.hierarchy,binaryBody:i}));let u=Hm.BATCH_TABLE_CLASS_NAME,f=a.binaryProperties,h,p,A;if(o){let y=Pje(t,u,f,i,r);A=y.transcodedSchema,p=[new jb({propertyAttribute:y.propertyAttributeJson,class:y.transcodedClass})]}else{let y=vje(t,u,f,i);A=y.transcodedSchema;let C=y.featureTableJson;h=new dh({count:C.count,properties:C.properties,class:y.transcodedClass,bufferViews:y.bufferViewsTypedArrays}),p=[]}let m=[];if(l(h)||l(s)||l(c)){let y=new cu({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:s,batchTableHierarchy:c});m.push(y)}let _={schema:A,propertyTables:m,propertyAttributes:p,extensions:a.extensions,extras:a.extras};return new js(_)}function Dje(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;l(t)?(eD._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):l(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,a={};for(let s in e){if(!e.hasOwnProperty(s)||s==="HIERARCHY"||s==="extensions"||s==="extras")continue;let c=e[s];Array.isArray(c)?(r=l(r)?r:{},r[s]=c):a[s]=c}return{binaryProperties:a,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function vje(e,t,n,i){let o={},r={},a={},s=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!l(i))throw new ue(`Property ${h} requires a batch table binary.`);let p=n[h],A=ch(p);r[h]={bufferView:s},o[h]=Due(p),a[s]=A.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),s++}let c={classes:{}};c.classes[t]={properties:o};let u=au.fromJson(c);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:a,transcodedSchema:u,transcodedClass:u.classes[t]}}function Pje(e,t,n,i,o){let r={},a={},s=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!l(i)&&!l(p.typedArray))throw new ue(`Property ${h} requires a batch table binary.`);let A=Tt.sanitizeGlslIdentifier(h);(A===""||r.hasOwnProperty(A))&&(A=`property_${s}`,s++);let m=Due(p);m.name=h,r[A]=m;let _=A.toUpperCase();_.startsWith("_")||(_=`_${_}`);let y=p.typedArray;l(y)||(y=ch(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let C=new bn.Attribute;C.name=_,C.count=e,C.type=p.type;let E=j.fromTypedArray(y);(E===j.INT||E===j.UNSIGNED_INT||E===j.DOUBLE)&&(eD._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${_}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),y=new Float32Array(y)),C.componentDatatype=j.fromTypedArray(y),C.typedArray=y,o.push(C),a[A]={attribute:_}}let c={classes:{}};c.classes[t]={properties:r};let u=au.fromJson(c);return{class:t,propertyAttributeJson:{properties:a},transcodedSchema:u,transcodedClass:u.classes[t]}}function Due(e){let t=Rje(e.componentType);return{type:e.type,componentType:t}}function Rje(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"}}eD._deprecationWarning=Gs;eD._oneTimeWarning=bt;var F_=eD;var CE={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},Mje=bn.FeatureIdAttribute,rq=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,o=t.arrayBuffer,r=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??so.Y,f=t.forwardAxis??so.X,h=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,A=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,_=t.loadPrimitiveOutline??!0,y=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=o,this._byteOffset=r,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=h,this._loadAttributesFor2D=p,this._enablePick=A,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=_,this._loadForClassification=y,this._state=CE.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=P.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=kQ.parse(this._arrayBuffer,this._byteOffset),n=t.batchLength,i=t.featureTableJson,o=t.featureTableBinary,r=t.batchTableJson,a=t.batchTableBinary,s=new Km(i,o);n=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=n;let c=s.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(c)&&(this._transform=P.fromTranslation(d.fromArray(c))),this._batchTable={json:r,binary:a};let u=new td({typedArray:t.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=u,this._state=CE.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=CE.PROCESSING,f}).catch(function(h){if(!f.isDestroyed())return Nje(f,h)}),this._promise}process(t){if(this._state===CE.READY)return!0;if(this._state!==CE.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=P.multiplyTransformation(this._transform,i.transform,i.transform),Lje(this,i),this._components=i,this._arrayBuffer=void 0,this._state=CE.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Nje(e,t){return e.unload(),e._state=CE.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function Lje(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(l(n.json))o=F_({count:i,batchTable:n.json,binaryBody:n.binary});else{let s=new cu({name:Hm.BATCH_TABLE_CLASS_NAME,count:i});o=new js({schema:{},propertyTables:[s]})}let r=t.scene.nodes,a=r.length;for(let s=0;s<a;s++)vue(r[s]);t.structuralMetadata=o}function vue(e){let t=e.children.length;for(let i=0;i<t;i++)vue(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=Tt.getAttributeBySemantic(o,at.FEATURE_ID);if(l(r)){r.setIndex=0;let a=new Mje;a.propertyTableId=0,a.setIndex=0,a.positionalLabel="featureId_0",o.featureIds.push(a)}}}var UQ=rq;var aq=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=qje(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function Oje(){this.lines=void 0,this.points=void 0,this.properties=void 0}function Fje(){this.features=[]}function sq(e){let t=e[0],n=e[1],i=e[2]??0;return new d(t,n,i)}function cq(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=sq(e[o]);return[n]}function Qje(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=cq(e[i])[0];return n}function Pue(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=cq(e[i])[0];return n}function kje(e){let t=e.length,n=[];for(let i=0;i<t;i++){let o=Pue(e[i]);oi(n,o)}return n}function Uje(e){return[sq(e)]}function zje(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=sq(e[i]);return n}var Gje={LineString:cq,MultiLineString:Qje,MultiPolygon:kje,Polygon:Pue,MultiPoint:zje,Point:Uje},Vje={LineString:Pe.LINES,MultiLineString:Pe.LINES,MultiPolygon:Pe.LINES,Polygon:Pe.LINES,MultiPoint:Pe.POINTS,Point:Pe.POINTS};function Rue(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Gje[n],o=Vje[n],r=e.geometry.coordinates;if(!l(i)||!l(r))return;let a=new Oje;o===Pe.LINES?a.lines=i(r):o===Pe.POINTS&&(a.points=i(r)),a.properties=e.properties,t.features.push(a)}function Hje(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Rue(n[o],t)}var Wje={FeatureCollection:Hje,Feature:Rue},zQ=new d;function jje(e,t,n){let i=0,o=0,r=e.length;for(let N=0;N<r;N++){let L=e[N];if(l(L.lines)){let g=L.lines.length;for(let b=0;b<g;b++){let T=L.lines[b];i+=T.length,o+=(T.length-1)*2}}}let a=new Float32Array(i*3),s=new Float32Array(i),c=Ue.createTypedArray(i,o),u=Ue.fromTypedArray(c),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,A=0;for(let N=0;N<r;N++){let L=e[N];if(!l(L.lines))continue;let g=L.lines.length;for(let b=0;b<g;b++){let T=L.lines[b],B=T.length;for(let M=0;M<B;M++){let O=T[M],G=d.fromDegrees(O.x,O.y,O.z,te.WGS84,zQ),k=P.multiplyByPoint(t,G,zQ);d.minimumByComponent(f,k,f),d.maximumByComponent(h,k,h),d.pack(k,a,p*3),s[p]=N,M<B-1&&(c[A*2]=p,c[A*2+1]=p+1,A++),p++}}}let m=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Re.STATIC_DRAW});m.vertexArrayDestroyable=!1;let _=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Re.STATIC_DRAW});_.vertexArrayDestroyable=!1;let y=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Re.STATIC_DRAW,indexDatatype:u});y.vertexArrayDestroyable=!1;let C=new bn.Attribute;C.semantic=at.POSITION,C.componentDatatype=j.FLOAT,C.type=zt.VEC3,C.count=i,C.min=f,C.max=h,C.buffer=m;let E=new bn.Attribute;E.semantic=at.FEATURE_ID,E.setIndex=0,E.componentDatatype=j.FLOAT,E.type=zt.SCALAR,E.count=i,E.buffer=_;let I=[C,E],x=new bn.Material;x.unlit=!0;let S=new bn.Indices;S.indexDatatype=u,S.count=c.length,S.buffer=y;let w=new bn.FeatureIdAttribute;w.featureCount=r,w.propertyTableId=0,w.setIndex=0,w.positionalLabel="featureId_0";let v=[w],R=new bn.Primitive;return R.attributes=I,R.indices=S,R.featureIds=v,R.primitiveType=Pe.LINES,R.material=x,R}function Yje(e,t,n){let i=0,o=e.length;for(let I=0;I<o;I++){let x=e[I];l(x.points)&&(i+=x.points.length)}let r=new Float32Array(i*3),a=new Float32Array(i),s=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let I=0;I<o;I++){let x=e[I];if(!l(x.points))continue;let S=x.points.length;for(let w=0;w<S;w++){let v=x.points[w],R=d.fromDegrees(v.x,v.y,v.z,te.WGS84,zQ),N=P.multiplyByPoint(t,R,zQ);d.minimumByComponent(s,N,s),d.maximumByComponent(c,N,c),d.pack(N,r,u*3),a[u]=I,u++}}let f=tt.createVertexBuffer({typedArray:r,context:n.context,usage:Re.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Re.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new bn.Attribute;p.semantic=at.POSITION,p.componentDatatype=j.FLOAT,p.type=zt.VEC3,p.count=i,p.min=s,p.max=c,p.buffer=f;let A=new bn.Attribute;A.semantic=at.FEATURE_ID,A.setIndex=0,A.componentDatatype=j.FLOAT,A.type=zt.SCALAR,A.count=i,A.buffer=h;let m=[p,A],_=new bn.Material;_.unlit=!0;let y=new bn.FeatureIdAttribute;y.featureCount=o,y.propertyTableId=0,y.setIndex=0,y.positionalLabel="featureId_0";let C=[y],E=new bn.Primitive;return E.attributes=m,E.featureIds=C,E.primitiveType=Pe.POINTS,E.material=_,E}function qje(e,t){let n=new Fje,i=Wje[e.type];l(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ue("GeoJSON must have at least one feature");let a={};for(let N=0;N<r;N++){let g=o[N].properties??V.EMPTY_OBJECT;for(let b in g)g.hasOwnProperty(b)&&(l(a[b])||(a[b]=new Array(r)))}for(let N=0;N<r;N++){let L=o[N];for(let g in a)if(a.hasOwnProperty(g)){let b=L.properties[g]??"";a[g][N]=b}}let s=new M_({count:r,properties:a}),u=[new cu({id:0,count:r,jsonMetadataTable:s})],f=au.fromJson({}),h=new js({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),A=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,_=!1;for(let N=0;N<r;N++){let L=o[N];if(l(L.lines)){m=!0;let g=L.lines.length;for(let b=0;b<g;b++){let T=L.lines[b],B=T.length;for(let M=0;M<B;M++)d.minimumByComponent(p,T[M],p),d.maximumByComponent(A,T[M],A)}}if(l(L.points)){_=!0;let g=L.points.length;for(let b=0;b<g;b++){let T=L.points[b];d.minimumByComponent(p,T,p),d.maximumByComponent(A,T,A)}}}let y=d.midpoint(p,A,new d),C=d.fromDegrees(y.x,y.y,y.z,te.WGS84,new d),E=At.eastNorthUpToFixedFrame(C,te.WGS84,new P),I=P.inverseTransformation(E,new P),x=[];m&&x.push(jje(o,I,t)),_&&x.push(Yje(o,I,t));let S=new bn.Node;S.index=0,S.primitives=x;let w=[S],v=new bn.Scene;v.nodes=w;let R=new bn.Components;return R.scene=v,R.nodes=w,R.transform=E,R.structuralMetadata=h,R}var GQ=aq;var VQ={};VQ._deprecationWarning=Gs;var Q_=Uint32Array.BYTES_PER_ELEMENT;VQ.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Q_;let r=o.getUint32(t,!0);if(r!==1)throw new ue(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Q_;let a=o.getUint32(t,!0);t+=Q_;let s=o.getUint32(t,!0);if(s===0)throw new ue("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Q_;let c=o.getUint32(t,!0);t+=Q_;let u=o.getUint32(t,!0);t+=Q_;let f=o.getUint32(t,!0);t+=Q_;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new ue(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=Q_;let p=Pr(i,t,s);t+=s;let A=new Uint8Array(e,t,c);t+=c;let m,_;u>0&&(m=Pr(i,t,u),t+=u,f>0&&(_=new Uint8Array(e,t,f),_=new Uint8Array(_),t+=f));let y=n+a-t;if(y===0)throw new ue("glTF byte length must be greater than 0.");let C;return t%4===0?C=new Uint8Array(e,t,y):(VQ._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),C=new Uint8Array(i.subarray(t,t+y))),{gltfFormat:h,featureTableJson:p,featureTableBinary:A,batchTableJson:m,batchTableBinary:_,gltf:C}};var HQ=VQ;var BA={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},WQ=bn.Attribute,Kje=bn.FeatureIdAttribute,Nue=bn.Instances,lq=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,o=t.baseResource,r=t.byteOffset??0,a=t.releaseGltfJson??!1,s=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??so.Y,f=t.forwardAxis??so.X,h=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,A=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;o=l(o)?o:n.clone(),this._i3dmResource=n,this._baseResource=o,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=a,this._asynchronous=s,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=h,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=A,this._enablePick=m,this._state=BA.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=HQ.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,a=t.gltfFormat,s=new Km(n,i);this._featureTable=s;let c=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=c,!l(c))throw new ue("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=s.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(u)&&(this._transform=P.fromTranslation(d.fromArray(u))),this._batchTable={json:o,binary:r};let f={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(a===0){let p=ju(t.gltf);p=p.replace(/[\s\0]+$/,"");let A=this._baseResource.getDerivedResource({url:p});f.gltfResource=A,f.baseResource=A}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let h=new td(f);return this._gltfLoader=h,this._state=BA.LOADING,this._promise=h.load().then(()=>{if(!this.isDestroyed())return this._state=BA.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw Xje(this,p)}),this._promise}process(t){if(this._state===BA.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===BA.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=P.multiplyTransformation(this._transform,o.transform,o.transform),$je(this,o,t),Jje(this,o),this._components=o,this._arrayBuffer=void 0,this._state=BA.READY,!0}isUnloaded(){return this._state===BA.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),o6e(this),this._components=void 0,this._arrayBuffer=void 0,this._state=BA.UNLOADED}};function Xje(e,t){return e.unload(),e._state=BA.FAILED,e.getError("Failed to load i3dm",t)}function Jje(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=F_({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new cu({name:Hm.BATCH_TABLE_CLASS_NAME,count:i});o=new js({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var jQ=new d,uq=new Array(4),Zje=new P;function $je(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let a=o.getGlobalProperty("RTC_CENTER",j.FLOAT,3),s=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||s,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=t6e(o,r),h;c&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let A=new Float32Array(r),m=d.unpackArray(f),_=new d,y=new d,C=new d,E=new d,I=new J,x=new Qe,S=new Array(4),w=new d,v=new Array(3),R=new P;if(!l(a)||d.equals(d.unpack(a),d.ZERO)){let k=le.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],k.center,jQ),f[3*i+0]=jQ.x,f[3*i+1]=jQ.y,f[3*i+2]=jQ.z;let z=P.fromTranslation(k.center,Zje);t.transform=P.multiplyTransformation(z,t.transform,t.transform)}for(i=0;i<r;i++){_=d.clone(m[i]),l(a)&&d.add(_,d.unpack(a),_),c&&(n6e(o,s,i,x,_,C,y,E,I,R),Qe.pack(x,S,0),h[4*i+0]=S[0],h[4*i+1]=S[1],h[4*i+2]=S[2],h[4*i+3]=S[3]),u&&(i6e(o,i,w),d.pack(w,v,0),p[3*i+0]=v[0],p[3*i+1]=v[1],p[3*i+2]=v[2]);let k=o.getProperty("BATCH_ID",j.UNSIGNED_SHORT,1,i);l(k)||(k=i),A[i]=k}let N=new Nue;N.transformInWorldSpace=!0;let L=e._buffers,g=new WQ;if(g.name="Instance Translation",g.semantic=Ua.TRANSLATION,g.componentDatatype=j.FLOAT,g.type=zt.VEC3,g.count=r,g.typedArray=f,!c){let k=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Re.STATIC_DRAW});k.vertexArrayDestroyable=!1,L.push(k),g.buffer=k}if(N.attributes.push(g),c){let k=new WQ;k.name="Instance Rotation",k.semantic=Ua.ROTATION,k.componentDatatype=j.FLOAT,k.type=zt.VEC4,k.count=r,k.typedArray=h,N.attributes.push(k)}if(u){let k=new WQ;if(k.name="Instance Scale",k.semantic=Ua.SCALE,k.componentDatatype=j.FLOAT,k.type=zt.VEC3,k.count=r,c)k.typedArray=p;else{let z=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Re.STATIC_DRAW});z.vertexArrayDestroyable=!1,L.push(z),k.buffer=z}N.attributes.push(k)}let b=new WQ;b.name="Instance Feature ID",b.setIndex=0,b.semantic=Ua.FEATURE_ID,b.componentDatatype=j.FLOAT,b.type=zt.SCALAR,b.count=r;let T=tt.createVertexBuffer({context:n.context,typedArray:A,usage:Re.STATIC_DRAW});T.vertexArrayDestroyable=!1,L.push(T),b.buffer=T,N.attributes.push(b);let B=new Kje;B.propertyTableId=0,B.setIndex=0,B.positionalLabel="instanceFeatureId_0",N.featureIds.push(B);let M=t.nodes,O=M.length,G=!1;for(i=0;i<O;i++){let k=M[i];k.primitives.length>0&&(k.instances=G?e6e(N):N,G=!0)}}function e6e(e){let t=new Nue;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=Ye(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function t6e(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",j.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",j.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",j.FLOAT,3);if(!l(i))throw new ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",j.FLOAT,3);if(!l(o))throw new ue("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let a=0;a<n.length/3;a++)for(let s=0;s<3;s++){let c=3*a+s;r[c]=n[c]/65535*o[s]+i[s]}return r}else throw new ue("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Mue=new Array(4);function n6e(e,t,n,i,o,r,a,s,c,u){let f=e.getProperty("NORMAL_UP",j.FLOAT,3,n,uq),h=e.getProperty("NORMAL_RIGHT",j.FLOAT,3,n,Mue),p=!1;if(l(f)){if(!l(h))throw new ue("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,a),p=!0}else{let A=e.getProperty("NORMAL_UP_OCT32P",j.UNSIGNED_SHORT,2,n,uq),m=e.getProperty("NORMAL_RIGHT_OCT32P",j.UNSIGNED_SHORT,2,n,Mue);if(l(A)){if(!l(m))throw new ue("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");tn.octDecodeInRange(A[0],A[1],65535,r),tn.octDecodeInRange(m[0],m[1],65535,a),p=!0}else t?(At.eastNorthUpToFixedFrame(o,te.WGS84,u),P.getMatrix3(u,c)):J.clone(J.IDENTITY,c)}p&&(d.cross(a,r,s),d.normalize(s,s),J.setColumn(c,0,a,c),J.setColumn(c,1,r,c),J.setColumn(c,2,s,c)),Qe.fromRotationMatrix(c,i)}function i6e(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",j.FLOAT,1,t);l(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",j.FLOAT,3,t,uq);l(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function o6e(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}var YQ=lq;var r6e={STOPPED:0,ANIMATING:1},Xm=Object.freeze(r6e);function ex(){this.times=void 0,this.points=void 0,de.throwInstantiationError()}ex.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Qe)return Qe};ex.prototype.evaluate=de.throwInstantiationError;ex.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};ex.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};ex.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var So=ex;function tx(e){this._value=e,this._valueType=So.getPointType(e)}Object.defineProperties(tx.prototype,{value:{get:function(){return this._value}}});tx.prototype.findTimeInterval=function(e){};tx.prototype.wrapTime=function(e){return 0};tx.prototype.clampTime=function(e){return 0};tx.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var qQ=tx;function nx(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=So.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(nx.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});nx.prototype.findTimeInterval=So.prototype.findTimeInterval;nx.prototype.wrapTime=So.prototype.wrapTime;nx.prototype.clampTime=So.prototype.clampTime;nx.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var EE=nx;var Lue={};Lue.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),a=new Array(i.length),s;for(s=0;s<r.length;s++)r[s]=new d,a[s]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let c;for(s=1;s<o.length;++s)c=1/(t[s]-o[s-1]*e[s-1]),o[s]=n[s]*c,r[s]=d.subtract(i[s],d.multiplyByScalar(r[s-1],e[s-1],r[s]),r[s]),r[s]=d.multiplyByScalar(r[s],c,r[s]);for(c=1/(t[s]-o[s-1]*e[s-1]),r[s]=d.subtract(i[s],d.multiplyByScalar(r[s-1],e[s-1],r[s]),r[s]),r[s]=d.multiplyByScalar(r[s],c,r[s]),a[a.length-1]=r[r.length-1],s=a.length-2;s>=0;--s)a[s]=d.subtract(r[s],d.multiplyByScalar(a[s+1],o[s],a[s]),a[s]);return a};var tD=Lue;var Oue=[],Fue=[],Que=[],kue=[];function a6e(e,t,n){let i=Oue,o=Que,r=Fue,a=kue;i.length=o.length=e.length-1,r.length=a.length=e.length;let s;i[0]=r[0]=1,o[0]=0;let c=a[0];for(l(c)||(c=a[0]=new d),d.clone(t,c),s=1;s<i.length-1;++s)i[s]=o[s]=1,r[s]=4,c=a[s],l(c)||(c=a[s]=new d),d.subtract(e[s+1],e[s-1],c),d.multiplyByScalar(c,3,c);return i[s]=0,o[s]=1,r[s]=4,c=a[s],l(c)||(c=a[s]=new d),d.subtract(e[s+1],e[s-1],c),d.multiplyByScalar(c,3,c),r[s+1]=1,c=a[s+1],l(c)||(c=a[s+1]=new d),d.clone(n,c),tD.solve(i,r,o,a)}function s6e(e){let t=Oue,n=Que,i=Fue,o=kue;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let a=o[0];for(l(a)||(a=o[0]=new d),d.subtract(e[1],e[0],a),d.multiplyByScalar(a,3,a),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,a=o[r],l(a)||(a=o[r]=new d),d.subtract(e[r+1],e[r-1],a),d.multiplyByScalar(a,3,a);return i[r]=2,a=o[r],l(a)||(a=o[r]=new d),d.subtract(e[r],e[r-1],a),d.multiplyByScalar(a,3,a),tD.solve(t,i,n,o)}function uu(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;this._times=n,this._points=t,this._pointType=So.getPointType(t[0]),this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(uu.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}}});uu.createC1=function(e){e=e??V.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new uu({times:t,points:n,inTangents:r,outTangents:o})};uu.createNaturalCubic=function(e){e=e??V.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new EE({points:n,times:t});let i=s6e(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new uu({times:t,points:n,inTangents:r,outTangents:o})};uu.createClampedCubic=function(e){e=e??V.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent,r=So.getPointType(n[0]);if(n.length<3)return new EE({points:n,times:t});let a=a6e(n,i,o),s=a.slice(0,a.length-1),c=a.slice(1,a.length);return new uu({times:t,points:n,inTangents:c,outTangents:s})};uu.hermiteCoefficientMatrix=new P(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);uu.prototype.findTimeInterval=So.prototype.findTimeInterval;var c6e=new ie,ix=new d;uu.prototype.wrapTime=So.prototype.wrapTime;uu.prototype.clampTime=So.prototype.clampTime;uu.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 a=this._lastTimeIndex,s=i[a+1]-i[a],c=(e-i[a])/s,u=c6e;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=P.multiplyByVector(uu.hermiteCoefficientMatrix,u,u);f.z*=s,f.w*=s;let h=this._pointType;return h===Number?n[a]*f.x+n[a+1]*f.y+r[a]*f.z+o[a]*f.w:(l(t)||(t=new h),t=h.multiplyByScalar(n[a],f.x,t),h.multiplyByScalar(n[a+1],f.y,ix),h.add(t,ix,t),h.multiplyByScalar(r[a],f.z,ix),h.add(t,ix,t),h.multiplyByScalar(o[a],f.w,ix),h.add(t,ix,t))};var IE=uu;function ox(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=So.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ox.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ox.prototype.findTimeInterval=So.prototype.findTimeInterval;ox.prototype.wrapTime=So.prototype.wrapTime;ox.prototype.clampTime=So.prototype.clampTime;ox.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(l(t)||(t=new o),o.clone(n[i],t))};var KQ=ox;function l6e(e){let t=e.points,n=e.times;return function(i,o){l(o)||(o=new Qe);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[r])/(n[r+1]-n[r]),s=t[r],c=t[r+1];return Qe.fastSlerp(s,c,a,o)}}function rx(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=l6e(this),this._lastTimeIndex=0}Object.defineProperties(rx.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});rx.prototype.findTimeInterval=So.prototype.findTimeInterval;rx.prototype.wrapTime=So.prototype.wrapTime;rx.prototype.clampTime=So.prototype.clampTime;rx.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var XQ=rx;var ax=bn.AnimatedPropertyType;function fq(e){e=e??V.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,m6e(this)}Object.defineProperties(fq.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 u6e(e,t){let n=[],i=[],o=[],r=t.length;for(let a=0;a<r;a+=3)i.push(t[a]),n.push(t[a+1]),o.push(t[a+2]);return i.splice(0,1),o.length=o.length-1,new IE({times:e,points:n,inTangents:i,outTangents:o})}function Uue(e,t,n,i){if(e.length===1&&t.length===1)return new qQ(t[0]);switch(n){case qm.STEP:return new KQ({times:e,points:t});case qm.CUBICSPLINE:return u6e(e,t);case qm.LINEAR:return i===ax.ROTATION?new XQ({times:e,points:t}):new EE({times:e,points:t})}}function f6e(e,t,n,i,o){let r=[];if(i===ax.WEIGHTS){let s=t.length/o,c,u;for(c=0;c<o;c++){let f=new Array(s),h=c;if(n===qm.CUBICSPLINE)for(u=0;u<s;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<s;u++)f[u]=t[h],h+=o;r.push(Uue(e,f,n,i))}}else r.push(Uue(e,t,n,i));return r}var d6e=new d,h6e=new Qe;function m6e(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,s=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=f6e(i,o,r,s,u);e._splines=f,e._path=s}fq.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===ax.WEIGHTS){let r=o.morphWeights,a=r.length;for(let s=0;s<a;s++){let c=t[s],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);r[s]=c.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],a=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===ax.TRANSLATION||n===ax.SCALE?o[n]=r.evaluate(a,d6e):n===ax.ROTATION&&(o[n]=r.evaluate(a,h6e))}}};var JQ=fq;function dq(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=X.clone(n.startTime),this._delay=n.delay??0,this._stopTime=X.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Ju.NONE,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new _e,this.update=new _e,this.stop=new _e,this._state=Xm.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,p6e(this)}Object.defineProperties(dq.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},animationTime:{get:function(){return this._animationTime}}});function p6e(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,a=r.length,s=[];for(let c=0;c<a;c++){let u=r[c],f=u.target;if(!l(f))continue;let h=f.node.index,p=i._runtimeNodes[h],A=new JQ({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),s.push(A)}e._runtimeChannels=s,e._localStartTime=t,e._localStopTime=n}dq.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var ZQ=dq;function DA(e){this.animationAdded=new _e,this.animationRemoved=new _e,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(DA.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function hq(e,t,n){let i=e._model,o=new ZQ(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}DA.prototype.add=function(e){e=e??V.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return hq(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}return hq(this,n[i],e)};DA.prototype.addAll=function(e){e=e??V.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let a=hq(this,n[r],e);i.push(a)}return i};DA.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};DA.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])};DA.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};DA.prototype.get=function(e){return this._runtimeAnimations[e]};var $Q=[];function A6e(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}DA.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&X.equals(e.time,this._previousTime))return!1;this._previousTime=X.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let a=0;a<n;++a){let s=t[a];l(s._computedStartTime)||(s._computedStartTime=X.addSeconds(s.startTime??o,s.delay,new X)),l(s._duration)||(s._duration=s.localStopTime*(1/s.multiplier));let c=s._computedStartTime,u=s._duration,f=s.stopTime,h=X.lessThanOrEquals(c,o),p=l(f)&&X.greaterThan(o,f),A=0;if(u!==0){let y=X.secondsDifference(p?f:o,c);A=l(s._animationTime)?s._animationTime(u,y):y/u}let m=s.loop===Ju.REPEAT||s.loop===Ju.MIRRORED_REPEAT,_=(h||m&&!l(s.startTime))&&(A<=1||m)&&!p;if(A===s._prevAnimationDelta){let y=s._state===Xm.STOPPED;if(_!==y)continue}if(s._prevAnimationDelta=A,_||s._state===Xm.ANIMATING){if(_&&s._state===Xm.STOPPED&&(s._state=Xm.ANIMATING,s.start.numberOfListeners>0&&e.afterRender.push(s._raiseStartEvent)),s.loop===Ju.REPEAT)A=A-Math.floor(A);else if(s.loop===Ju.MIRRORED_REPEAT){let C=Math.floor(A),E=A-C;A=C%2===1?1-E:E}s.reverse&&(A=1-A);let y=A*u*s.multiplier;y=D.clamp(y,s.localStartTime,s.localStopTime),s.animate(y),s.update.numberOfListeners>0&&(s._updateEventTime=y,e.afterRender.push(s._raiseUpdateEvent)),i=!0,_||(s._state=Xm.STOPPED,s.stop.numberOfListeners>0&&e.afterRender.push(s._raiseStopEvent),s.removeOnStop&&$Q.push(s))}}n=$Q.length;for(let a=0;a<n;++a){let s=$Q[a];t.splice(t.indexOf(s),1),e.afterRender.push(A6e(this,r,s))}return $Q.length=0,i};var e2=DA;function bE(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(bE.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new U),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}}});bE.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};bE.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};bE.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};bE.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};bE.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var t2=bE;var nD={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};nD.getStyleCommandsNeeded=function(e,t){return t===0?nD.ALL_OPAQUE:t===e?nD.ALL_TRANSLUCENT:nD.OPAQUE_AND_TRANSLUCENT};var Jm=Object.freeze(nD);var k_={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};k_.is3DTiles=function(e){switch(e){case k_.TILE_GLTF:case k_.TILE_B3DM:case k_.TILE_I3DM:case k_.TILE_PNTS:case k_.TILE_GEOJSON:return!0;case k_.GLTF:return!1}};var Vr=Object.freeze(k_);function ra(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=Jm.ALL_OPAQUE,g6e(this)}Object.defineProperties(ra.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function g6e(e){let t=e._model,n=Vr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let a=t.content;for(o=0;o<i;o++)r[o]=new Vs(a,o)}else for(o=0;o<i;o++)r[o]=new t2({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new ou({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ra.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=Jm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ra.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ra.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ra.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ra.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ra.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ra.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ra.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ra.prototype.getFeature=function(e){return this._features[e]};ra.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ra.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ra.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ra.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ra.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ra.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ra.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ra.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ra.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var _6e=new U;ra.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(ou.DEFAULT_COLOR_VALUE),this.setAllShow(ou.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,_6e)??ou.DEFAULT_COLOR_VALUE:ou.DEFAULT_COLOR_VALUE,o=l(e.show)?e.show.evaluate(n)??ou.DEFAULT_SHOW_VALUE:ou.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};ra.prototype.isDestroyed=function(){return!1};ra.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),fe(this)};var n2=ra;var zue={name:"TilesetPipelineStage"};zue.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,he.FRAGMENT);let r={u_polygonOffset:function(){return Q.ZERO}};e.uniformMap=Pt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var i2=zue;var o2=`// robust iterative solution without trig functions
|
|
// https://github.com/0xfaded/ellipse_demo/issues/1
|
|
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
|
|
//
|
|
// This version uses only a single iteration for best performance. For fog
|
|
// rendering, the difference is negligible.
|
|
vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
|
|
vec2 p = abs(pos);
|
|
vec2 inverseRadii = 1.0 / radii;
|
|
vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;
|
|
|
|
// We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
|
|
// but store the cos and sin of t in a vec2 for efficiency.
|
|
// Initial guess: t = cos(pi/4)
|
|
vec2 tTrigs = vec2(0.70710678118);
|
|
vec2 v = radii * tTrigs;
|
|
|
|
// Find the evolute of the ellipse (center of curvature) at v.
|
|
vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
|
|
// Find the (approximate) intersection of p - evolute with the ellipsoid.
|
|
vec2 q = normalize(p - evolute) * length(v - evolute);
|
|
// Update the estimate of t.
|
|
tTrigs = (q + evolute) * inverseRadii;
|
|
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
|
|
v = radii * tTrigs;
|
|
|
|
return v * sign(pos);
|
|
}
|
|
|
|
vec3 computeEllipsoidPositionWC(vec3 positionMC) {
|
|
// Get the world-space position and project onto a meridian plane of
|
|
// the ellipsoid
|
|
vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
|
|
|
|
vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
|
|
vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
|
|
|
|
// Reconstruct a 3D point in world space
|
|
return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
|
|
}
|
|
|
|
void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
|
|
|
|
vec3 fogColor = groundAtmosphereColor.rgb;
|
|
|
|
// If there is dynamic lighting, apply that to the fog.
|
|
const float NONE = 0.0;
|
|
if (czm_atmosphereDynamicLighting != NONE) {
|
|
float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
|
|
fogColor *= darken;
|
|
}
|
|
|
|
// Tonemap if HDR rendering is disabled
|
|
#ifndef HDR
|
|
fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
|
|
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
|
|
#endif
|
|
|
|
vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
|
|
color = vec4(withFog, color.a);
|
|
}
|
|
|
|
void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
|
|
vec3 rayleighColor;
|
|
vec3 mieColor;
|
|
float opacity;
|
|
|
|
vec3 positionWC;
|
|
vec3 lightDirection;
|
|
|
|
// When the camera is in space, compute the position per-fragment for
|
|
// more accurate ground atmosphere. All other cases will use
|
|
//
|
|
// The if condition will be added in https://github.com/CesiumGS/cesium/issues/11717
|
|
if (false) {
|
|
positionWC = computeEllipsoidPositionWC(attributes.positionMC);
|
|
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
|
|
|
|
// The fog color is derived from the ground atmosphere color
|
|
czm_computeGroundAtmosphereScattering(
|
|
positionWC,
|
|
lightDirection,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
} else {
|
|
positionWC = attributes.positionWC;
|
|
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
|
|
rayleighColor = v_atmosphereRayleighColor;
|
|
mieColor = v_atmosphereMieColor;
|
|
opacity = v_atmosphereOpacity;
|
|
}
|
|
|
|
//color correct rayleigh and mie colors
|
|
const bool ignoreBlackPixels = true;
|
|
rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
|
|
mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);
|
|
|
|
vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
|
|
|
|
if (u_isInFog) {
|
|
float distanceToCamera = length(attributes.positionEC);
|
|
applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
|
|
} else {
|
|
// Ground atmosphere
|
|
}
|
|
}
|
|
`;var r2=`void atmosphereStage(ProcessedAttributes attributes) {
|
|
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
|
|
|
|
czm_computeGroundAtmosphereScattering(
|
|
// This assumes the geometry stage came before this.
|
|
v_positionWC,
|
|
lightDirection,
|
|
v_atmosphereRayleighColor,
|
|
v_atmosphereMieColor,
|
|
v_atmosphereOpacity
|
|
);
|
|
}
|
|
`;var Gue={name:"AtmospherePipelineStage"};Gue.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,he.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([r2]),i.addFragmentLines([o2]),i.addUniform("bool","u_isInFog",he.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(o,n.fog.density)>D.EPSILON3}};var a2=Gue;var s2=`#ifdef DIFFUSE_IBL
|
|
vec3 sampleDiffuseEnvironment(vec3 cubeDir)
|
|
{
|
|
#ifdef CUSTOM_SPHERICAL_HARMONICS
|
|
return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);
|
|
#else
|
|
return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef SPECULAR_IBL
|
|
vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
|
|
{
|
|
#ifdef CUSTOM_SPECULAR_IBL
|
|
float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
|
|
return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
|
|
#else
|
|
float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
|
|
return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
|
|
#endif
|
|
}
|
|
vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
|
|
{
|
|
// see https://bruop.github.io/ibl/ at Single Scattering Results
|
|
// Roughness dependent fresnel, from Fdez-Aguera
|
|
vec3 f90 = max(vec3(1.0 - roughness), f0);
|
|
vec3 F = fresnelSchlick2(f0, f90, NdotV);
|
|
|
|
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
|
|
vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);
|
|
|
|
return specularSample * (F * brdfLut.x + brdfLut.y);
|
|
}
|
|
#endif
|
|
|
|
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
|
|
/**
|
|
* Compute the light contributions from environment maps and spherical harmonic coefficients.
|
|
* See Fdez-Aguera, https://www.jcgt.org/published/0008/01/03/paper.pdf, for explanation
|
|
* of the single- and multi-scattering terms.
|
|
*
|
|
* @param {vec3} viewDirectionEC Unit vector pointing from the fragment to the eye position.
|
|
* @param {vec3} normalEC The surface normal in eye coordinates.
|
|
* @param {czm_modelMaterial} The material properties.
|
|
* @return {vec3} The computed HDR color.
|
|
*/
|
|
vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
|
|
vec3 f0 = material.specular;
|
|
float roughness = material.roughness;
|
|
float specularWeight = 1.0;
|
|
#ifdef USE_SPECULAR
|
|
specularWeight = material.specularWeight;
|
|
#endif
|
|
float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);
|
|
|
|
// see https://bruop.github.io/ibl/ at Single Scattering Results
|
|
// Roughness dependent fresnel, from Fdez-Aguera
|
|
vec3 f90 = max(vec3(1.0 - roughness), f0);
|
|
vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);
|
|
|
|
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
|
|
vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);
|
|
|
|
#ifdef DIFFUSE_IBL
|
|
vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
|
|
vec3 irradiance = sampleDiffuseEnvironment(normalMC);
|
|
|
|
vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
|
|
float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
|
|
vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
|
|
vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
|
|
vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;
|
|
#else
|
|
vec3 diffuseContribution = vec3(0.0);
|
|
#endif
|
|
|
|
#ifdef USE_ANISOTROPY
|
|
// Bend normal to account for anisotropic distortion of specular reflection
|
|
vec3 anisotropyDirection = material.anisotropicB;
|
|
vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
|
|
vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
|
|
float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
|
|
float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
|
|
vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
|
|
vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
|
|
#else
|
|
vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
|
|
#endif
|
|
|
|
#ifdef SPECULAR_IBL
|
|
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
|
|
vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
|
|
vec3 specularContribution = radiance * FssEss * model_iblFactor.y;
|
|
#else
|
|
vec3 specularContribution = vec3(0.0);
|
|
#endif
|
|
|
|
return diffuseContribution + specularContribution;
|
|
}
|
|
#endif
|
|
`;var Vue={name:"ImageBasedLightingPipelineStage"},y6e=new Q;Vue.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,a;l(i.specularEnvironmentMaps)||(a=o.radianceCubeMap);let s=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,he.FRAGMENT),r.addUniform("vec2","model_iblFactor",he.FRAGMENT),Om.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",he.FRAGMENT),l(a)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,he.BOTH),l(s)&&l(s[0])?(r.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,he.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",he.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,he.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(a)?(r.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,he.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",he.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",he.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,he.FRAGMENT)),r.addFragmentLines(s2);let c={model_iblFactor:function(){return Q.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,y6e)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return s},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(a)&&(c.model_specularEnvironmentMaps=function(){return a},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=Pt(c,e.uniformMap)};var c2=Vue;var C6e=D.EPSILON16;function pq(e){e=e??V.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(pq.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,C6e)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var E6e=new d,mq=new J;pq.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=E6e,o;switch(t){case xl.XROTATE:o=J.fromRotationX(D.toRadians(n),mq),e=P.multiplyByMatrix3(e,o,e);break;case xl.YROTATE:o=J.fromRotationY(D.toRadians(n),mq),e=P.multiplyByMatrix3(e,o,e);break;case xl.ZROTATE:o=J.fromRotationZ(D.toRadians(n),mq),e=P.multiplyByMatrix3(e,o,e);break;case xl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case xl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case xl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=P.multiplyByTranslation(e,i,e);break;case xl.XSCALE:i.x=n,i.y=1,i.z=1,e=P.multiplyByScale(e,i,e);break;case xl.YSCALE:i.x=1,i.y=n,i.z=1,e=P.multiplyByScale(e,i,e);break;case xl.ZSCALE:i.x=1,i.y=1,i.z=n,e=P.multiplyByScale(e,i,e);break;case xl.UNIFORMSCALE:e=P.multiplyByUniformScale(e,n,e);break;default:break}return e};var l2=pq;function u2(e){e=e??V.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,I6e(this)}Object.defineProperties(u2.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 I6e(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let a=0;a<i;a++){let s=n[a],c=new l2({stage:s,runtimeArticulation:e});o.push(c);let u=s.name;r[u]=c}}u2.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var b6e=new P,x6e=new P;u2.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=P.clone(P.IDENTITY,b6e),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 a=o[t],s=P.multiplyTransformation(a.originalTransform,e,x6e);a.transform=s}};var f2=u2;var d2=`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 sx={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};sx.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,he.FRAGMENT),i.addFragmentLines(d2);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=Be.TRANSLUCENT),i.addUniform("vec4",sx.COLOR_UNIFORM_NAME,he.FRAGMENT),o[sx.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",sx.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),o[sx.COLOR_BLEND_UNIFORM_NAME]=function(){return bl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Pt(o,e.uniformMap)};var xE=sx;var h2=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
|
|
vec4 getClippingPlane(
|
|
highp sampler2D packedClippingPlanes,
|
|
int clippingPlaneNumber,
|
|
mat4 transform
|
|
) {
|
|
int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
|
|
int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
#else
|
|
// Handle uint8 clipping texture instead
|
|
vec4 getClippingPlane(
|
|
highp sampler2D packedClippingPlanes,
|
|
int clippingPlaneNumber,
|
|
mat4 transform
|
|
) {
|
|
int clippingPlaneStartIndex = clippingPlaneNumber * 2; // clipping planes are two pixels each
|
|
int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
|
|
int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
|
|
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
|
|
float u = (float(pixX) + 0.5) * pixelWidth; // sample from center of pixel
|
|
float v = (float(pixY) + 0.5) * pixelHeight;
|
|
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
|
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
|
vec4 plane;
|
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
|
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
#endif
|
|
|
|
float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
|
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
|
vec3 clipNormal = vec3(0.0);
|
|
vec3 clipPosition = vec3(0.0);
|
|
float pixelWidth = czm_metersPerPixel(position);
|
|
|
|
#ifdef UNION_CLIPPING_REGIONS
|
|
float clipAmount; // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
|
|
#else
|
|
float clipAmount = 0.0;
|
|
bool clipped = true;
|
|
#endif
|
|
|
|
for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
|
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
|
clipNormal = clippingPlane.xyz;
|
|
clipPosition = -clippingPlane.w * clipNormal;
|
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
|
|
|
#ifdef UNION_CLIPPING_REGIONS
|
|
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
|
|
if (amount <= 0.0) {
|
|
discard;
|
|
}
|
|
#else
|
|
clipAmount = max(amount, clipAmount);
|
|
clipped = clipped && (amount <= 0.0);
|
|
#endif
|
|
}
|
|
|
|
#ifndef UNION_CLIPPING_REGIONS
|
|
if (clipped) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
return clipAmount;
|
|
}
|
|
|
|
void modelClippingPlanesStage(inout vec4 color)
|
|
{
|
|
float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
|
|
vec4 clippingPlanesEdgeColor = vec4(1.0);
|
|
clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
|
|
float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
|
|
|
|
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
|
|
color = clippingPlanesEdgeColor;
|
|
}
|
|
}
|
|
`;var Hue={name:"ModelClippingPlanesPipelineStage"},T6e=new Q;Hue.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,he.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,he.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,he.FRAGMENT),Ca.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,he.FRAGMENT);let a=Ca.getTextureResolution(i,o,T6e);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",a.x,he.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",a.y,he.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",he.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",he.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",he.FRAGMENT),r.addFragmentLines(h2);let s={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=U.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=Pt(s,e.uniformMap)};var m2=Hue;var p2=`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 A2=`void modelClippingPolygonsStage()
|
|
{
|
|
vec2 clippingPosition = v_clippingPosition;
|
|
int regionIndex = v_regionIndex;
|
|
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
|
|
}
|
|
`;var Wue={name:"ModelClippingPolygonsPipelineStage"};Wue.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,he.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,he.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,he.BOTH),o.addUniform("sampler2D","model_clippingDistance",he.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",he.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(p2),o.addFragmentLines(A2);let r={model_clippingDistance:function(){return i.clippingTexture??n.context.defaultTexture},model_clippingExtents:function(){return i.extentsTexture??n.context.defaultTexture}};e.uniformMap=Pt(r,e.uniformMap)};var g2=Wue;function jue(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(jue.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var _2=jue;var y2=`mat4 getInstancingTransform()
|
|
{
|
|
mat4 instancingTransform;
|
|
|
|
#ifdef HAS_INSTANCE_MATRICES
|
|
instancingTransform = mat4(
|
|
a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1
|
|
a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2
|
|
a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3
|
|
a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4
|
|
);
|
|
#else
|
|
vec3 translation = vec3(0.0, 0.0, 0.0);
|
|
vec3 scale = vec3(1.0, 1.0, 1.0);
|
|
|
|
#ifdef HAS_INSTANCE_TRANSLATION
|
|
translation = a_instanceTranslation;
|
|
#endif
|
|
#ifdef HAS_INSTANCE_SCALE
|
|
scale = a_instanceScale;
|
|
#endif
|
|
|
|
instancingTransform = mat4(
|
|
scale.x, 0.0, 0.0, 0.0,
|
|
0.0, scale.y, 0.0, 0.0,
|
|
0.0, 0.0, scale.z, 0.0,
|
|
translation.x, translation.y, translation.z, 1.0
|
|
);
|
|
#endif
|
|
|
|
return instancingTransform;
|
|
}
|
|
|
|
#ifdef USE_2D_INSTANCING
|
|
mat4 getInstancingTransform2D()
|
|
{
|
|
mat4 instancingTransform2D;
|
|
|
|
#ifdef HAS_INSTANCE_MATRICES
|
|
instancingTransform2D = mat4(
|
|
a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1
|
|
a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2
|
|
a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3
|
|
a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4
|
|
);
|
|
#else
|
|
vec3 translation2D = vec3(0.0, 0.0, 0.0);
|
|
vec3 scale = vec3(1.0, 1.0, 1.0);
|
|
|
|
#ifdef HAS_INSTANCE_TRANSLATION
|
|
translation2D = a_instanceTranslation2D;
|
|
#endif
|
|
#ifdef HAS_INSTANCE_SCALE
|
|
scale = a_instanceScale;
|
|
#endif
|
|
|
|
instancingTransform2D = mat4(
|
|
scale.x, 0.0, 0.0, 0.0,
|
|
0.0, scale.y, 0.0, 0.0,
|
|
0.0, 0.0, scale.z, 0.0,
|
|
translation2D.x, translation2D.y, translation2D.z, 1.0
|
|
);
|
|
#endif
|
|
|
|
return instancingTransform2D;
|
|
}
|
|
#endif
|
|
`;var C2=`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 E2=`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 I2=new P,S6e=new P,w6e=new P,que={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:$ue,_transformsToTypedArray:gq};que.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(y2);let a=e.model,s=a.sceneGraph,c=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&a._projectTo2D,f=a._enablePick&&!n.context.webgl2,h=[];G6e(e,n,i,h,u,f),W6e(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,he.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",he.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",he.VERTEX),p.u_instance_modifiedModelView=function(){let A=P.multiplyTransformation(a.modelMatrix,s.components.transform,I2);return u?P.multiplyTransformation(n.context.uniformState.view3D,A,I2):(n.mode!==oe.SCENE3D&&(A=At.basisTo2D(n.mapProjection,A,I2)),P.multiplyTransformation(n.context.uniformState.view,A,I2))},p.u_instance_nodeTransform=function(){return P.multiplyTransformation(s.axisCorrectionMatrix,c.computedTransform,S6e)},r.addVertexLines(E2)):r.addVertexLines(C2),u){r.addDefine("USE_2D_INSTANCING",void 0,he.VERTEX),r.addUniform("mat4","u_modelView2D",he.VERTEX);let A=n.context,m=P.fromTranslation(c.instancingReferencePoint2D,new P);p.u_modelView2D=function(){return P.multiplyTransformation(A.uniformState.view,m,w6e)}}e.uniformMap=Pt(p,e.uniformMap),e.instanceCount=o,oi(e.attributes,h)};var iD=new P,B6e=new d;function D6e(e,t,n,i,o){let r=P.multiplyTransformation(t,e,iD);return r=P.multiplyTransformation(r,n,iD),o=At.basisTo2D(i.mapProjection,r,o),o}function v6e(e,t,n,i,o){let r=P.fromTranslation(e,iD),a=P.multiplyTransformation(t,r,iD);a=P.multiplyTransformation(a,n,iD);let s=P.getTranslation(a,B6e);return o=co.computeActualEllipsoidPosition(i,s,o),o}function Kue(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=P.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=P.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=P.clone(o.computedModelMatrix,t),t=P.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=P.clone(P.IDENTITY,n))}var Xue=new P,Jue=new P,P6e=new P,R6e=new d;function M6e(e,t,n,i){let o=Xue,r=Jue;Kue(t,o,r);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=D6e(f,o,r,n,P6e),p=P.getTranslation(h,R6e),A=d.subtract(p,s,p);i[u]=P.setTranslation(h,A,i[u])}return i}function N6e(e,t,n,i){let o=Xue,r=Jue;Kue(t,o,r);let s=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],h=v6e(f,o,r,n,f);i[u]=d.subtract(h,s,i[u])}return i}var L6e=new d,O6e=new d;function Zue(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=P.multiplyByPoint(i,n.instancingTranslationMin,L6e),r=co.computeActualEllipsoidPosition(t,o,o),a=P.multiplyByPoint(i,n.instancingTranslationMax,O6e),s=co.computeActualEllipsoidPosition(t,a,a);n.instancingReferencePoint2D=d.lerp(r,s,.5,new d)}function gq(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],a=12*o;i[a+0]=r[0],i[a+1]=r[4],i[a+2]=r[8],i[a+3]=r[12],i[a+4]=r[1],i[a+5]=r[5],i[a+6]=r[9],i[a+7]=r[13],i[a+8]=r[2],i[a+9]=r[6],i[a+10]=r[10],i[a+11]=r[14]}return i}function F6e(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],a=3*o;i[a+0]=r[0],i[a+1]=r[4],i[a+2]=r[8]}return i}var Q6e=new d,k6e=new Qe,U6e=new d;function $ue(e,t,n){let i=new Array(t),o=Tt.getAttributeBySemantic(e,Ua.TRANSLATION),r=Tt.getAttributeBySemantic(e,Ua.ROTATION),a=Tt.getAttributeBySemantic(e,Ua.SCALE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(o),f=l(r),h=l(a),p=u?o.typedArray:new Float32Array(t*3),A=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(A=tn.dequantize(A,r.componentDatatype,r.type,t));let m;h?m=a.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let y=0;y<t;y++){let C=new d(p[y*3],p[y*3+1],p[y*3+2],Q6e);d.maximumByComponent(s,C,s),d.minimumByComponent(c,C,c);let E=new Qe(A[y*4],A[y*4+1],A[y*4+2],f?A[y*4+3]:1,k6e),I=new d(m[y*3],m[y*3+1],m[y*3+2],U6e),x=P.fromTranslationQuaternionRotationScale(C,E,I,new P);i[y]=x}let _=n.runtimeNode;return _.instancingTranslationMin=c,_.instancingTranslationMax=s,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(a.typedArray=void 0),i}function z6e(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new d(o[c*3],o[c*3+1],o[c*3+2]);i[c]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(a,u,a)}let s=n.runtimeNode;return s.instancingTranslationMin=r,s.instancingTranslationMax=a,e.typedArray=void 0,i}function _q(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Re.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function G6e(e,t,n,i,o,r){let a=Tt.getAttributeBySemantic(n,Ua.ROTATION);l(a)?V6e(e,n,i,t,o,r):H6e(e,n,i,t,o)}function V6e(e,t,n,i,o,r){let a=e.shaderBuilder,s=t.attributes[0].count,c=e.model,u=e.runtimeNode;a.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!l(p)){h=$ue(t,s,e);let y=gq(h);p=_q(y,i),c._modelResources.push(p),r&&(u.transformsTypedArray=y),u.instancingTransformsBuffer=p}if(Yue(e,p,n,f),!o)return;let A=Ye(i);A.mode=oe.COLUMBUS_VIEW,Zue(e,A);let m=u.instancingTransformsBuffer2D;if(!l(m)){let y=M6e(h,e,A,h),C=gq(y);m=_q(C,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Yue(e,m,n,"Transform2D")}function H6e(e,t,n,i,o,r){let a=e.shaderBuilder,s=e.runtimeNode,c=Tt.getAttributeBySemantic(t,Ua.TRANSLATION),u=Tt.getAttributeBySemantic(t,Ua.SCALE);if(l(u)&&(a.addDefine("HAS_INSTANCE_SCALE"),Aq(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,h=c.typedArray;if(l(h)?f=z6e(c,c.count,e):l(s.instancingTranslationMin)||(s.instancingTranslationMin=c.min,s.instancingTranslationMax=c.max),a.addDefine("HAS_INSTANCE_TRANSLATION"),Aq(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!o&&!r)return;let A=Ye(i);A.mode=oe.COLUMBUS_VIEW,Zue(e,A);let m=s.instancingTranslationBuffer2D;if(!l(m)){let E=N6e(f,e,A,f),I=F6e(E);r&&(s.transformsTypedArray=I),m=_q(I,i),e.model._modelResources.push(m),s.instancingTranslationBuffer2D=m}if(!o)return;Aq(e,m,0,void 0,n,"Translation2D")}function Yue(e,t,n,i){let r=j.getSizeInBytes(j.FLOAT),a=r*12,s=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:a,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:a,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),oi(n,s)}function Aq(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function W6e(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let a=0;a<o.length;a++){let s=o[a];s.semantic===Ua.FEATURE_ID&&(s.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:s.buffer,componentsPerAttribute:zt.getNumberOfComponents(s.type),componentDatatype:s.componentDatatype,normalize:!1,offsetInBytes:s.byteOffset,strideInBytes:s.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${s.setIndex}`))}}var b2=que;var yq={};yq.name="ModelMatrixUpdateStage";yq.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;efe(e,t,o,e.transformToRoot),e._transformDirty=!1}};function j6e(e,t,n){e.modelMatrix=P.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Tt.getCullFace(e.modelMatrix,e.primitiveType)}function efe(e,t,n,i){let o;i=P.multiplyTransformation(i,e.transform,new P),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let s=e.runtimePrimitives[o];j6e(s.drawCommand,n,i)}let a=e.children.length;for(o=0;o<a;o++){let s=t._runtimeNodes[e.children[o]];s._transformToRoot=P.clone(i,s._transformToRoot),efe(s,t,n,i),s._transformDirty=!1}}var x2=yq;var tfe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:nfe,_countGeneratedBuffers:ife};tfe.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;nfe(i,o),ife(i,r)};function nfe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r.buffer)&&e.addBuffer(r.buffer,!1)}}function ife(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var T2=tfe;function cx(e){e=e??V.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=P.clone(n,this._originalTransform),this._transform=P.clone(n,this._transform),this._transformToRoot=P.clone(i,this._transformToRoot),this._computedTransform=new P,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,Y6e(this)}Object.defineProperties(cx.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=P.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;d.equals(n,e)||(t.translation=d.clone(e,t.translation),Cq(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Qe.equals(n,e)||(t.rotation=Qe.clone(e,t.rotation),Cq(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),Cq(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function Y6e(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=P.multiply(n,t,i);let o=e.node;l(o.matrix)||(e._transformParameters=new tE(o.translation,o.rotation,o.scale)),l(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(l(r)){let c=e.sceneGraph._runtimeArticulations[r];l(c)&&c.runtimeNodes.push(e)}}function Cq(e,t){e._transformDirty=!0,e._transform=P.fromTranslationRotationScale(t,e._transform)}cx.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};cx.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(b2),t.push(T2),n.push(x2)};cx.prototype.updateComputedTransform=function(){this._computedTransform=P.multiply(this._transformToRoot,this._transform,this._computedTransform)};cx.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){l(t[o])||(t[o]=new P);let r=P.multiplyTransformation(this.transformToRoot,this.transform,t[o]),a=P.inverseTransformation(r,t[o]);t[o]=P.multiplyTransformation(a,n[o],t[o])}};var S2=cx;var ofe={name:"AlphaPipelineStage"};ofe.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===Be.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=sn.ALPHA_BLEND);let a=e.shaderBuilder,s=e.uniformMap;l(i.alphaCutoff)&&(a.addDefine("ALPHA_MODE_MASK",void 0,he.FRAGMENT),a.addUniform("float","u_alphaCutoff",he.FRAGMENT),s.u_alphaCutoff=function(){return i.alphaCutoff})};var w2=ofe;var rfe={name:"BatchTexturePipelineStage"};rfe.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,a=r.featureTables[r.featureTableId],s=a.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return s};let c=a.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Pt(o,e.uniformMap)};var B2=rfe;var afe={name:"ClassificationPipelineStage"};afe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,he.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||q6e(t,o)};function q6e(e,t){let n=Tt.getAttributeBySemantic(e,at.POSITION);if(!l(n))throw new ue("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let a=r?o.count:n.count,s=Tt.getAttributeBySemantic(e,at.FEATURE_ID,0);if(!l(s)){t.batchLengths=[a],t.batchOffsets=[0];return}let c=s.typedArray;s.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=c[h],A=0;for(let _=1;_<a;_++){let y=r?i[_]:_,C=c[y];if(C!==p){let E=_-A,I=_;u.push(E),f.push(I),A=I,p=C}}let m=a-A;u.push(m),t.batchLengths=u,t.batchOffsets=f}var D2=afe;var v2=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
|
|
{
|
|
bool styleTranslucent = (featureColor.a != 1.0);
|
|
// Only render translucent features in the translucent pass (if the style or the original command has translucency).
|
|
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
|
|
{
|
|
// If the model has a translucent silhouette, it needs to render during the silhouette color command,
|
|
// (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
|
|
#ifdef HAS_SILHOUETTE
|
|
positionMC *= float(model_silhouettePass);
|
|
#else
|
|
positionMC *= 0.0;
|
|
#endif
|
|
}
|
|
// If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
|
|
else if (czm_pass != czm_passTranslucent && styleTranslucent)
|
|
{
|
|
positionMC *= 0.0;
|
|
}
|
|
}
|
|
|
|
void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
|
|
{
|
|
float show = ceil(feature.color.a);
|
|
positionMC *= show;
|
|
|
|
#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
|
|
filterByPassType(positionMC, feature.color);
|
|
#endif
|
|
}
|
|
`;var P2=`void filterByPassType(vec4 featureColor)
|
|
{
|
|
bool styleTranslucent = (featureColor.a != 1.0);
|
|
// Only render translucent features in the translucent pass (if the style or the original command has translucency).
|
|
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
|
|
{
|
|
// If the model has a translucent silhouette, it needs to render during the silhouette color command,
|
|
// (i.e. the command where model_silhouettePass = true), even if the model isn't translucent.
|
|
#ifdef HAS_SILHOUETTE
|
|
if(!model_silhouettePass) {
|
|
discard;
|
|
}
|
|
#else
|
|
discard;
|
|
#endif
|
|
}
|
|
// If the current pass is not the translucent pass and the style is not translucent, don't render the feature.
|
|
else if (czm_pass != czm_passTranslucent && styleTranslucent)
|
|
{
|
|
discard;
|
|
}
|
|
}
|
|
|
|
void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
|
|
{
|
|
vec4 featureColor = feature.color;
|
|
if (featureColor.a == 0.0)
|
|
{
|
|
discard;
|
|
}
|
|
|
|
// If a feature ID vertex attribute is used, the pass type filter is applied in the vertex shader.
|
|
// So, we only apply in in the fragment shader if the feature ID texture is used.
|
|
#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
|
|
filterByPassType(featureColor);
|
|
#endif
|
|
|
|
featureColor = czm_gammaCorrect(featureColor);
|
|
|
|
// Classification models compute the diffuse differently.
|
|
#ifdef HAS_CLASSIFICATION
|
|
material.diffuse = featureColor.rgb * featureColor.a;
|
|
#else
|
|
float highlight = ceil(model_colorBlend);
|
|
material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
|
|
#endif
|
|
|
|
material.alpha *= featureColor.a;
|
|
}
|
|
`;var sfe={name:"CPUStylingPipelineStage"};sfe.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(v2),o.addFragmentLines(P2),o.addDefine("USE_CPU_STYLING",void 0,he.BOTH),l(i.color)||(o.addUniform("float",xE.COLOR_BLEND_UNIFORM_NAME,he.FRAGMENT),e.uniformMap[xE.COLOR_BLEND_UNIFORM_NAME]=function(){return bl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",he.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Be.TRANSLUCENT}};var R2=sfe;var cfe={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};cfe.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var U_=Object.freeze(cfe);var M2=`void customShaderStage(
|
|
inout czm_modelVertexOutput vsOutput,
|
|
inout ProcessedAttributes attributes,
|
|
FeatureIds featureIds,
|
|
Metadata metadata,
|
|
MetadataClass metadataClass,
|
|
MetadataStatistics metadataStatistics
|
|
) {
|
|
// VertexInput and initializeInputStruct() are dynamically generated in JS,
|
|
// see CustomShaderPipelineStage.js
|
|
VertexInput vsInput;
|
|
initializeInputStruct(vsInput, attributes);
|
|
vsInput.featureIds = featureIds;
|
|
vsInput.metadata = metadata;
|
|
vsInput.metadataClass = metadataClass;
|
|
vsInput.metadataStatistics = metadataStatistics;
|
|
vertexMain(vsInput, vsOutput);
|
|
attributes.positionMC = vsOutput.positionMC;
|
|
}
|
|
`;var N2=`void customShaderStage(
|
|
inout czm_modelMaterial material,
|
|
ProcessedAttributes attributes,
|
|
FeatureIds featureIds,
|
|
Metadata metadata,
|
|
MetadataClass metadataClass,
|
|
MetadataStatistics metadataStatistics
|
|
) {
|
|
// FragmentInput and initializeInputStruct() are dynamically generated in JS,
|
|
// see CustomShaderPipelineStage.js
|
|
FragmentInput fsInput;
|
|
initializeInputStruct(fsInput, attributes);
|
|
fsInput.featureIds = featureIds;
|
|
fsInput.metadata = metadata;
|
|
fsInput.metadataClass = metadataClass;
|
|
fsInput.metadataStatistics = metadataStatistics;
|
|
fragmentMain(fsInput, material);
|
|
}
|
|
`;var L2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
|
|
initializeFeatureIds(featureIds, attributes);
|
|
initializeFeatureIdAliases(featureIds);
|
|
}
|
|
`;var O2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
|
|
{
|
|
initializeFeatureIds(featureIds, attributes);
|
|
initializeFeatureIdAliases(featureIds);
|
|
setFeatureIdVaryings();
|
|
}
|
|
`;var eo={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()"};eo.process=function(e,t,n){let i=e.shaderBuilder;K6e(i);let o=e.runtimeNode.node.instances;l(o)&&X6e(e,o,n),J6e(e,t,n),i.addVertexLines(O2),i.addFragmentLines(L2)};function K6e(e){e.addStruct(eo.STRUCT_ID_FEATURE_IDS_VS,eo.STRUCT_NAME_FEATURE_IDS,he.VERTEX),e.addStruct(eo.STRUCT_ID_FEATURE_IDS_FS,eo.STRUCT_NAME_FEATURE_IDS,he.FRAGMENT),e.addFunction(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,eo.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.VERTEX),e.addFunction(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,eo.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,he.FRAGMENT),e.addFunction(eo.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,eo.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.VERTEX),e.addFunction(eo.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,eo.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,he.FRAGMENT),e.addFunction(eo.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,eo.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,he.VERTEX)}function X6e(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let a=i[r],s=a.positionalLabel;a instanceof bn.FeatureIdAttribute?Z6e(e,a,s):lfe(e,a,s,o,1,n);let c=a.label;l(c)&&ufe(e,s,c,he.BOTH)}}function J6e(e,t,n){let i=t.featureIds,r=Tt.getAttributeBySemantic(t,at.POSITION).count;for(let a=0;a<i.length;a++){let s=i[a],c=s.positionalLabel,u=he.BOTH;s instanceof bn.FeatureIdAttribute?$6e(e,s,c):s instanceof bn.FeatureIdImplicitRange?lfe(e,s,c,r,void 0,n):(eYe(e,s,c,a,n),u=he.FRAGMENT);let f=s.label;l(f)&&ufe(e,c,f,u)}}function Z6e(e,t,n){let i=e.shaderBuilder;i.addStructField(eo.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(eo.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),a=`a_${r}${o}`,s=`v_${r}${o}`,c=`featureIds.${n} = int(czm_round(${a}));`,u=`featureIds.${n} = int(czm_round(${s}));`;i.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",s),i.addFunctionLines(eo.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${s} = ${a};`])}function $6e(e,t,n){let i=e.shaderBuilder;i.addStructField(eo.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(eo.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),a=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,a),i.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,a)}function lfe(e,t,n,i,o,r){tYe(e,t,i,o,r);let a=e.shaderBuilder,s=`a_implicit_${n}`;a.addAttribute("float",s);let c=`v_implicit_${n}`;a.addVarying("float",c),a.addStructField(eo.STRUCT_ID_FEATURE_IDS_VS,"int",n),a.addStructField(eo.STRUCT_ID_FEATURE_IDS_FS,"int",n),a.addFunctionLines(eo.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${s};`]),a.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${s}));`]),a.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function eYe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,a=e.uniformMap,s=t.textureReader;a[r]=function(){return s.texture??o.context.defaultTexture};let c=s.channels,u=e.shaderBuilder;u.addStructField(eo.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,he.FRAGMENT);let h=`v_texCoord_${s.texCoord}`,p=h,A=s.transform;if(l(A)&&!J.equals(A,J.IDENTITY)){let y=`${r}Transform`;u.addUniform("mat3",y,he.FRAGMENT),a[y]=function(){return A},p=`vec2(${y} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${c}`,_=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[_])}function ufe(e,t,n,i){let o=e.shaderBuilder,r=he.includesVertexShader(i);r&&o.addStructField(eo.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(eo.STRUCT_ID_FEATURE_IDS_FS,"int",n);let a=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,a),o.addFunctionLines(eo.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,a)}function tYe(e,t,n,i,o){let r=e.model,a,s;if(l(t.repeat)){let u=nYe(t,n);a=tt.createVertexBuffer({context:o.context,typedArray:u,usage:Re.STATIC_DRAW}),a.vertexArrayDestroyable=!1,r._pipelineResources.push(a),r.statistics.addBuffer(a,!1)}else s=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:s,vertexBuffer:a,normalize:!1,componentsPerAttribute:1,componentDatatype:j.FLOAT,strideInBytes:j.getSizeInBytes(j.FLOAT),offsetInBytes:0};e.attributes.push(c)}function nYe(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 TE=eo;var F2=`void metadataStage(
|
|
FeatureIds featureIds,
|
|
out Metadata metadata,
|
|
out MetadataClass metadataClass,
|
|
out MetadataStatistics metadataStatistics,
|
|
ProcessedAttributes attributes
|
|
)
|
|
{
|
|
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
}
|
|
`;var Q2=`void metadataStage(
|
|
FeatureIds featureIds,
|
|
out Metadata metadata,
|
|
out MetadataClass metadataClass,
|
|
out MetadataStatistics metadataStatistics,
|
|
ProcessedAttributes attributes
|
|
)
|
|
{
|
|
initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
setMetadataVaryings();
|
|
}
|
|
`;var Ci={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(FeatureIds featureIds, 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"}]};Ci.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:a}=o,s=a?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=EYe(o,t),f=iYe(r.propertyAttributes,t,s),h=rYe(r.propertyTextures,s),p=cYe(r.propertyTables,t,e,s,u),A=f.concat(h).concat(p);fYe(i,A),mYe(i),i.addVertexLines(Q2),i.addFragmentLines(F2);for(let m=0;m<f.length;m++){let _=f[m];pYe(e,_)}for(let m=0;m<h.length;m++){let _=h[m];gYe(e,_,c)}for(let m=0;m<p.length;m++){let _=p[m];yYe(e,_,c)}};function iYe(e,t,n){return l(e)?e.flatMap(i=>oYe(i,t,n)):[]}function oYe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Tt,a=e.class.id,s=n?.classes[a],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[h,p]=c[f],A=i(t,p.attribute),{glslType:m,variableName:_}=o(A);u[f]={metadataVariable:r(h),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:_,propertyStatistics:s?.properties[h],shaderDestination:he.BOTH}}return u}function rYe(e,t){return l(e)?e.flatMap(n=>aYe(n,t)):[]}function aYe(e,t){let{sanitizeGlslIdentifier:n}=Tt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([s,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),a=new Array(r.length);for(let s=0;s<r.length;s++){let[c,u]=r[s];a[s]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:o?.properties[c],shaderDestination:he.FRAGMENT}}return a}var sYe=4;function cYe(e,t,n,i,o){if(!l(e))return[];let r=uYe(n,t);return e.filter(a=>l(a.class)&&r.has(String(a.id))).flatMap(a=>lYe(a,r,i,o))}function lYe(e,t,n,i){let{sanitizeGlslIdentifier:o}=Tt,r=e.class,a=n?.classes[r.id],s=t.get(String(e.id))??{},c=s.shaderDestination??he.BOTH,u=e.properties,f=r.properties,h=[],p=0;for(let[A,m]of Object.entries(f)){if(!m.isGpuCompatible(sYe))continue;let _=u[A],y=he.intersection(xYe(A,i),c);if(y===he.NONE){p++;continue}h.push({metadataVariable:o(A),property:_,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:a?.properties[A],shaderDestination:y,propertyTable:e,featureIdVariableName:s.variableName,propertyInfoIndex:p}),p++}return h}function uYe(e,t){let n=new Map;function i(s,c){let u=s?.propertyTableId;if(!l(u))return;let f=String(u),h={variableName:s.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,h)}let o=t?.featureIds??[];for(let s=0;s<o.length;s++){let c=o[s],u=l(c?.textureReader);i(c,u?he.FRAGMENT:he.BOTH)}let a=e.runtimeNode?.node?.instances?.featureIds??[];for(let s=0;s<a.length;s++){let c=a[s];i(c,he.BOTH)}return n}function fYe(e,t){let n=new Set,i=new Set;for(let s=0;s<t.length;s++){let{type:c,glslType:u,propertyStatistics:f}=t[s];n.add(u),l(f)&&c!==It.ENUM&&i.add(u)}let o=Ci.METADATA_CLASS_FIELDS;for(let s of n){let c=`${s}MetadataClass`;a(c,s,o)}let r=Ci.METADATA_STATISTICS_FIELDS;for(let s of i){let c=`${s}MetadataStatistics`;a(c,s,r)}function a(s,c,u){e.addStruct(s,s,he.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?hYe(c):c;e.addStructField(s,p,h)}}}var dYe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function hYe(e){let t=dYe[e];return l(t)?t:e}function mYe(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,he.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,he.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,he.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,he.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,he.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,he.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,he.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,he.VERTEX)}function pYe(e,t){AYe(e,t),Eq(e.shaderBuilder,t),Iq(e.shaderBuilder,t)}function AYe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,a=bq({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:he.BOTH,property:o});n.addStructField(Ci.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,i);let s=`metadata.${i} = ${a};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,[s]),n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[s])}function gYe(e,t,n){_Ye(e,t,n),Eq(e.shaderBuilder,t),Iq(e.shaderBuilder,t)}function _Ye(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:a,property:s}=t,{texCoord:c,channels:u,index:f,texture:h,transform:p}=s.textureReader,A=`u_propertyTexture_${f}`,m=[];o.hasOwnProperty(A)||(i.addUniform("sampler2D",A,he.FRAGMENT),o[A]=()=>h),i.addStructField(Ci.STRUCT_ID_METADATA_FS,a,r);let _=`attributes.texCoord_${c}`,y=_;if(l(p)&&!J.equals(p,J.IDENTITY)){let w=`${A}Transform`;i.addUniform("mat3",w,he.FRAGMENT),o[w]=function(){return p},y=`vec2(${w} * vec3(${_}, 1.0))`}let C=`texture(${A}, ${y}).${u}`,E=s.classProperty,I;n?I=E.unpackTextureInShader(C,u,r,m):I=E.unpackTextureInShaderWebGL1(C);let x=bq({valueExpression:I,renderResources:e,glslType:a,metadataVariable:r,shaderDestination:he.FRAGMENT,property:s}),S=`metadata.${r} = ${x};`;m.push(S),i.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function Eq(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,a=ffe(Ci.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),s=`${o}MetadataClass`;e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_FS,s,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,a),he.includesVertexShader(r)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,s,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,a))}function Iq(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===It.ENUM)return;let a=Ci.METADATA_STATISTICS_FIELDS,s=`metadataStatistics.${i}`,c=ffe(a,n,s,r),u=`${r}MetadataStatistics`;e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,c),he.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function yYe(e,t,n){CYe(e,t,n),Eq(e.shaderBuilder,t),Iq(e.shaderBuilder,t)}function CYe(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:a,property:s,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){bt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let h=`u_propertyTableTexture_${u.id}`,p=[];o.hasOwnProperty(h)||(i.addUniform("sampler2D",h,he.BOTH),o[h]=()=>u.texture);let A=t.shaderDestination;he.includesVertexShader(A)&&i.addStructField(Ci.STRUCT_ID_METADATA_VS,a,r),he.includesFragmentShader(A)&&i.addStructField(Ci.STRUCT_ID_METADATA_FS,a,r);let _=`ivec2(${`featureIds.${c}`}, ${f})`,y=`texelFetch(${h}, ${_}, 0)`,C=t.classProperty,E=C.unpackTextureInShader(y,"rgba",r,p),I=bq({valueExpression:E,renderResources:e,glslType:a,metadataVariable:r,shaderDestination:A,property:s??C}),x=`metadata.${r} = ${I};`;p.push(x),he.includesVertexShader(A)&&i.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,p),he.includesFragmentShader(A)&&i.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function ffe(e,t,n,i){function o(r){let a=t[r.specName];if(l(a))return`${n}.${r.shaderName} = ${i}(${a});`}return l(t)?e.map(o).filter(l):[]}function bq(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:a,uniformMap:s}=e.renderResources,{glslType:c,shaderDestination:u}=e;a.addUniform(c,o,u),a.addUniform(c,r,u);let{offset:f,scale:h}=n;return s[o]=()=>f,s[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}function EYe(e,t){let n=new Set,i=new Set;return IYe(e,n,i),bYe(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function IYe(e,t,n){let i=e.customShader;if(!l(i))return;let o=i.usedVariablesFragment?.metadataSet??{};for(let a in o)o.hasOwnProperty(a)&&n.add(a);let r=i.usedVariablesVertex?.metadataSet??{};for(let a in r)r.hasOwnProperty(a)&&t.add(a)}function bYe(e,t,n,i){let o=e.style;if(!(l(o)&&t.primitiveType===Pe.POINTS))return;let a=o.color?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let s=o.show?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let c=o.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function xYe(e,t){let n=t.usedInFragment.has(e)?he.FRAGMENT:he.NONE,i=t.usedInVertex.has(e)?he.VERTEX:he.NONE;return he.union(n,i)}var ph=Ci;var TYe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},SE=Object.freeze(TYe);var Ia={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:bt};Ia.process=function(e,t,n){let i=e.model.customShader;if(i&&Ia.process_original(e,t,n,i),l(e.model._marsOptions)&&l(e.model._marsOptions.customShaders)){let o=Lg.getCache(e.model._marsOptions.customShaders);for(let r in o)Object.prototype.hasOwnProperty.call(o,r)&&Ia.process_original(e,t,n,o[r])}};Ia.process_original=function(e,t,n,i){let{shaderBuilder:o,alphaOptions:r}=e,{lightingModel:a,translucencyMode:s}=i;l(a)&&(e.lightingOptions.lightingModel=a),s===SE.TRANSLUCENT?r.pass=Be.TRANSLUCENT:s===SE.OPAQUE&&(r.pass=void 0);let c=MYe(i,t,e);if(!c.customShaderEnabled)return;if(FYe(o,i,c),c.shouldComputePositionWC&&o.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,he.BOTH),l(i.vertexShaderText)&&o.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,he.VERTEX),l(i.fragmentShaderText)){o.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,he.FRAGMENT);let h=U_.getDefineName(i.mode);o.addDefine(h,void 0,he.FRAGMENT)}let u=i.uniforms;for(let h in u)if(u.hasOwnProperty(h)){let p=u[h];o.addUniform(p.type,h)}let f=i.varyings;for(let h in f)if(f.hasOwnProperty(h)){let p=f[h];o.addVarying(p,h)}e.uniformMap=Pt(e.uniformMap,i.uniformMap)};function SYe(e){let t={};for(let n=0;n<e.length;n++){let i=Tt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var wYe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},BYe={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 dfe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=wYe[t],i=BYe[t];if(l(n))return{attributeField:[n,e],value:i}}function DYe(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!pfe(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=hfe(t,o,!1),a=mfe(t,o,!1),s,c=[],u=[];for(let f in r){if(!r.hasOwnProperty(f))continue;let p=[r[f].glslType,f];c.push(p),s=`vsInput.attributes.${f} = attributes.${f};`,u.push(s)}for(let f=0;f<a.length;f++){let h=a[f],p=dfe(h);if(!l(p))return Ia._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${h}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),s=`vsInput.attributes.${h} = ${p.value};`,u.push(s)}return{enabled:!0,attributeFields:c,initializationLines:u}}function vYe(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 PYe(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!pfe(i.metadataSet,n))return{enabled:!1};let o=i.attributeSet,r=hfe(t,o,!0),a=mfe(t,o,!0),s,c=[],u=[];for(let h in r){if(!r.hasOwnProperty(h))continue;let A=[r[h].glslType,h];c.push(A),s=`fsInput.attributes.${h} = attributes.${h};`,u.push(s)}for(let h=0;h<a.length;h++){let p=a[h],A=dfe(p);if(!l(A))return Ia._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(A.attributeField),s=`fsInput.attributes.${p} = ${A.value};`,u.push(s)}let f=vYe(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var RYe={positionWC:!0,positionEC:!0};function hfe(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],a=o;n&&o==="normalMC"?a="normalEC":n&&o==="tangentMC"&&(a="tangentEC",r.glslType="vec3"),t.hasOwnProperty(a)&&(i[a]=r)}return i}function mfe(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||RYe.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 MYe(e,t,n){let i=SYe(t.attributes),o=QYe(t,n.model.structuralMetadata),r=DYe(e,i,o),a=PYe(e,i,o),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&a.enabled;return{vertexLines:r,fragmentLines:a,customShaderEnabled:r.enabled||a.enabled,shouldComputePositionWC:c}}function NYe(e,t){let n=Ia.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ia.STRUCT_NAME_ATTRIBUTES,he.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=Ia.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ia.STRUCT_NAME_VERTEX_INPUT,he.VERTEX),e.addStructField(n,Ia.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,TE.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,ph.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,ph.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,ph.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ia.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,Ia.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,he.VERTEX),e.addFunctionLines(r,o)}function LYe(e,t){let n=Ia.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ia.STRUCT_NAME_ATTRIBUTES,he.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let a=0;a<i.length;a++){let[s,c]=i[a];e.addStructField(n,s,c)}n=Ia.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ia.STRUCT_NAME_FRAGMENT_INPUT,he.FRAGMENT),e.addStructField(n,Ia.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,TE.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,ph.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,ph.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,ph.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=Ia.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,Ia.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,he.FRAGMENT),e.addFunctionLines(r,o)}var OYe=[];function FYe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=OYe;i.enabled&&(NYe(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,M2),e.addVertexLines(r)),o.enabled&&(LYe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,N2),e.addFragmentLines(r))}function QYe(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,o=l(e.featureIds)?e.featureIds.map(s=>s.propertyTableId):[],r=new Set;function a(s,c){for(let u of s){let h=c[u].class.properties;Object.keys(h).forEach(p=>r.add(p))}}return a(n,t.propertyTextures),a(i,t.propertyAttributes),a(o,t.propertyTables),r}function pfe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Ia._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var k2=Ia;var oD={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};oD.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,he.VERTEX),i.addFunction(oD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,oD.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,he.VERTEX);let a=t.attributes;for(let s=0;s<a.length;s++){let c=a[s],u=c.quantization;if(!l(u))continue;let f=c.semantic===at.POSITION,h=c.semantic===at.TEXCOORD;if(r&&!f&&!h)continue;let p=Tt.getAttributeInfo(c);UYe(i,p),kYe(e,p)}};function kYe(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let a=`model_normalizationRange_${o}`;n.addUniform("float",a,he.VERTEX),i[a]=function(){return r.normalizationRange}}else{let a=`model_quantizedVolumeOffset_${o}`,s=`model_quantizedVolumeStepSize_${o}`,c=t.glslType;n.addUniform(c,a,he.VERTEX),n.addUniform(c,s,he.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Afe(u,0),f=Afe(f,1)),i[a]=function(){return u},i[s]=function(){return f}}}function Afe(e,t){return e instanceof ie?e:new ie(e.x,e.y,e.z,t)}function UYe(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=zYe(n,i):o=GYe(n),e.addFunctionLines(oD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function zYe(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 GYe(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var U2=oD;var z2=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) {
|
|
if (u_isEdgePass) {
|
|
return;
|
|
}
|
|
|
|
vec2 screenCoord = gl_FragCoord.xy / czm_viewport.zw;
|
|
|
|
vec4 edgeColor = texture(czm_edgeColorTexture, screenCoord);
|
|
vec4 edgeId = texture(czm_edgeIdTexture, screenCoord);
|
|
|
|
// Packed window-space depth from edge pass (0..1)
|
|
float edgeDepthWin = czm_unpackDepth(texture(czm_edgeDepthTexture, screenCoord));
|
|
|
|
// Near / far for current frustum
|
|
float n = czm_currentFrustum.x;
|
|
float f = czm_currentFrustum.y;
|
|
|
|
// geometry depth in eye coordinate
|
|
vec4 geomEC = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
float geomDepthLinear = -geomEC.z;
|
|
|
|
// Convert edge depth to linear depth
|
|
float z_ndc_edge = edgeDepthWin * 2.0 - 1.0;
|
|
float edgeDepthLinear = (2.0 * n * f) / (f + n - z_ndc_edge * (f - n));
|
|
|
|
float d = abs(edgeDepthLinear - geomDepthLinear);
|
|
|
|
// Adaptive epsilon using linear depth fwidth for robustness
|
|
float pixelStepLinear = fwidth(geomDepthLinear);
|
|
float rel = geomDepthLinear * 0.0005;
|
|
float eps = max(n * 1e-4, max(pixelStepLinear * 1.5, rel));
|
|
|
|
// If Edge isn't behind any geometry and the pixel has edge data
|
|
if (d < eps && edgeId.r > 0.0) {
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
float edgeFeatureId = edgeId.g;
|
|
float currentFeatureId = float(featureIds.featureId_0);
|
|
#endif
|
|
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
|
|
// Background / sky / globe: always show edge
|
|
bool isBackground = geomDepthLinear > globeDepth;
|
|
bool drawEdge = isBackground;
|
|
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
bool hasEdgeFeature = edgeFeatureId > 0.0;
|
|
bool hasCurrentFeature = currentFeatureId > 0.0;
|
|
bool featuresMatch = edgeFeatureId == currentFeatureId;
|
|
|
|
drawEdge = drawEdge || !hasEdgeFeature || !hasCurrentFeature || featuresMatch;
|
|
#else
|
|
drawEdge = true;
|
|
#endif
|
|
|
|
if (drawEdge) {
|
|
color = edgeColor;
|
|
}
|
|
}
|
|
}
|
|
`;var gfe={name:"EdgeDetectionPipelineStage"};gfe.process=function(e){e.shaderBuilder.addFragmentLines([z2])};var G2=gfe;var V2=`// CESIUM_REDIRECTED_COLOR_OUTPUT flag is used to avoid color attachment conflicts
|
|
// when shaders are processed by different rendering pipelines (e.g., OIT).
|
|
// Only declare MRT outputs when not in a derived shader context.
|
|
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
|
|
layout(location = 1) out vec4 out_id; // edge id / metadata
|
|
layout(location = 2) out vec4 out_edgeDepth; // packed depth
|
|
#endif
|
|
|
|
void edgeVisibilityStage(inout vec4 color, inout FeatureIds featureIds)
|
|
{
|
|
#ifdef HAS_EDGE_VISIBILITY
|
|
|
|
if (!u_isEdgePass) {
|
|
return;
|
|
}
|
|
|
|
float edgeTypeInt = v_edgeType * 255.0;
|
|
|
|
if (edgeTypeInt < 0.5) {
|
|
discard;
|
|
}
|
|
|
|
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) { // silhouette candidate
|
|
// Silhouette check done in vertex shader
|
|
// v_shouldDiscard will be > 0.5 if this edge should be discarded
|
|
if (v_shouldDiscard > 0.5) {
|
|
discard;
|
|
}
|
|
}
|
|
|
|
vec4 finalColor = color;
|
|
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
|
|
if (v_edgeColor.a >= 0.0) {
|
|
finalColor = v_edgeColor;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_LINE_PATTERN
|
|
// Pattern is 16-bit, each bit represents visibility at that position
|
|
const float maskLength = 16.0;
|
|
|
|
// Get the relative position within the dash from 0 to 1
|
|
float dashPosition = fract(v_lineCoord / maskLength);
|
|
// Figure out the mask index
|
|
float maskIndex = floor(dashPosition * maskLength);
|
|
// Test the bit mask
|
|
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
|
|
|
|
// If bit is 0 (gap), discard the fragment (use < 1.0 for better numerical stability)
|
|
if (mod(maskTest, 2.0) < 1.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
color = finalColor;
|
|
|
|
#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT)
|
|
// Write edge metadata
|
|
out_id = vec4(0.0);
|
|
out_id.r = edgeTypeInt; // Edge type (0-3)
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
out_id.g = float(featureIds.featureId_0); // Feature ID if available
|
|
#else
|
|
out_id.g = 0.0;
|
|
#endif
|
|
// Pack depth into separate MRT attachment
|
|
out_edgeDepth = czm_packDepth(gl_FragCoord.z);
|
|
#endif
|
|
#endif
|
|
}`;var H2=`#ifdef HAS_EDGE_VISIBILITY
|
|
void edgeVisibilityStageVS() {
|
|
if (!u_isEdgePass) {
|
|
return;
|
|
}
|
|
|
|
v_edgeType = a_edgeType;
|
|
v_silhouetteNormalView = czm_normal * a_silhouetteNormal;
|
|
v_faceNormalAView = czm_normal * a_faceNormalA;
|
|
v_faceNormalBView = czm_normal * a_faceNormalB;
|
|
v_edgeOffset = a_edgeOffset;
|
|
|
|
// Silhouette detection: check both endpoints of the edge
|
|
v_shouldDiscard = 0.0;
|
|
float edgeTypeInt = a_edgeType * 255.0;
|
|
if (edgeTypeInt > 0.5 && edgeTypeInt < 1.5) {
|
|
vec3 normalA = normalize(v_faceNormalAView);
|
|
vec3 normalB = normalize(v_faceNormalBView);
|
|
const float perpTol = 2.5e-4;
|
|
|
|
// Check at current vertex (first endpoint)
|
|
vec4 currentPosEC = czm_modelView * vec4(v_positionMC, 1.0);
|
|
vec3 toEye1 = normalize(-currentPosEC.xyz);
|
|
float dotA1 = dot(normalA, toEye1);
|
|
float dotB1 = dot(normalB, toEye1);
|
|
|
|
// Check at other vertex (second endpoint)
|
|
vec4 otherPosEC = czm_modelView * vec4(a_edgeOtherPos, 1.0);
|
|
vec3 toEye2 = normalize(-otherPosEC.xyz);
|
|
float dotA2 = dot(normalA, toEye2);
|
|
float dotB2 = dot(normalB, toEye2);
|
|
|
|
// Discard if EITHER endpoint is non-silhouette
|
|
if (dotA1 * dotB1 > perpTol || dotA2 * dotB2 > perpTol) {
|
|
v_shouldDiscard = 1.0;
|
|
}
|
|
}
|
|
|
|
#ifdef HAS_EDGE_FEATURE_ID
|
|
v_featureId_0 = a_edgeFeatureId;
|
|
#endif
|
|
|
|
#ifdef HAS_EDGE_COLOR_ATTRIBUTE
|
|
v_edgeColor = a_edgeColor;
|
|
#endif
|
|
|
|
#ifdef HAS_LINE_PATTERN
|
|
#ifdef HAS_EDGE_CUMULATIVE_DISTANCE
|
|
v_lineCoord = a_edgeCumulativeDistance * u_pixelsPerWorld;
|
|
#else
|
|
vec4 currentClip = czm_modelViewProjection * vec4(v_positionMC, 1.0);
|
|
vec2 currentScreen = ((currentClip.xy / currentClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
|
|
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
|
|
vec2 otherScreen = ((otherClip.xy / otherClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
vec2 windowDir = otherScreen - currentScreen;
|
|
|
|
const float textureCoordinateBase = 8192.0;
|
|
if (abs(windowDir.x) > abs(windowDir.y)) {
|
|
v_lineCoord = textureCoordinateBase + currentScreen.x;
|
|
} else {
|
|
v_lineCoord = textureCoordinateBase + currentScreen.y;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
// Expand vertex to form quad
|
|
vec4 posClip = gl_Position;
|
|
|
|
if (length(a_edgeOtherPos) > 0.0 && abs(a_edgeOffset) > 0.0) {
|
|
vec4 currentClip = posClip;
|
|
vec4 otherClip = czm_modelViewProjection * vec4(a_edgeOtherPos, 1.0);
|
|
|
|
vec2 currentNDC = currentClip.xy / currentClip.w;
|
|
vec2 otherNDC = otherClip.xy / otherClip.w;
|
|
|
|
vec2 edgeDirNDC = otherNDC - currentNDC;
|
|
|
|
// Ensure consistent edge direction
|
|
if (edgeDirNDC.x < 0.0 || (abs(edgeDirNDC.x) < 0.001 && edgeDirNDC.y < 0.0)) {
|
|
edgeDirNDC = -edgeDirNDC;
|
|
}
|
|
|
|
edgeDirNDC = normalize(edgeDirNDC);
|
|
vec2 perpNDC = vec2(-edgeDirNDC.y, edgeDirNDC.x);
|
|
|
|
// Convert line width from pixels to clip space
|
|
float lineWidthPixels = u_lineWidth;
|
|
vec2 viewportSize = czm_viewport.zw;
|
|
vec2 clipPerPixel = (2.0 / viewportSize) * currentClip.w;
|
|
vec2 offsetClip = perpNDC * lineWidthPixels * clipPerPixel * 0.5 * a_edgeOffset;
|
|
|
|
posClip.xy += offsetClip;
|
|
}
|
|
|
|
gl_Position = posClip;
|
|
}
|
|
#endif
|
|
`;var xq=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,o=t.quantization;if(!l(o)&&!i)return n;let r=t.type,a=t.count,s=n;return i&&(s=tn.dequantize(n,t.componentDatatype,r,a)),l(o)?e.dequantize(s,a,r,o):s}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,o=zt.getNumberOfComponents(n),r=i*o,a=t.componentDatatype,s=t.quantization;l(s)&&(a=s.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,h=j.getSizeInBytes(a),p=o*h;if(!l(f)||f===p){let I=j.createTypedArray(a,r);return c.getBufferData(I,u),I}let A=new Uint8Array(c.sizeInBytes);c.getBufferData(A);let m=j.createTypedArray(a,r),_=f??p,y=new DataView(A.buffer,A.byteOffset,A.byteLength),C=new Array(o),E=e.createComponentsReader(a);for(let I=0;I<i;++I){let x=u+I*_;E(y,x,o,C);for(let S=0;S<o;++S)m[I*o+S]=C[S]}return m}static dequantize(t,n,i,o){if(o.octEncoded){let s=e.octDecode(t,n,o.normalizationRange,void 0);return o.octEncodedZXY&&e.convertZxyToXyz(s,s),s}let r=o.quantizedVolumeStepSize,a=o.quantizedVolumeOffset;if(i===zt.SCALAR)return e.dequantize1D(t,n,r,a,void 0);if(i===zt.VEC2)return e.dequantize2D(t,n,r,a,void 0);if(i===zt.VEC3)return e.dequantize3D(t,n,r,a,void 0);if(i===zt.VEC4)return e.dequantize4D(t,n,r,a,void 0);throw new de(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,o){l(o)||(o=new Float32Array(t.length));let r=new d;for(let a=0;a<n;a++)d.unpack(t,a*3,r),tn.octDecodeInRange(r,i,r),d.pack(o,r,a*3);return o}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let o=0;for(let r=0;r<n;r++,o+=3){let a=t[o+0],s=t[o+1],c=t[o+2];i[o+0]=s,i[o+1]=c,i[o+2]=a}return i}static dequantize1D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));for(let a=0;a<n;a++){let c=t[a]*i+o;r[a]=c}return r}static dequantize2D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new Q;for(let s=0;s<n;s++)Q.unpack(t,s*2,a),Q.multiplyComponents(a,i,a),Q.add(a,o,a),Q.pack(a,r,s*2);return r}static dequantize3D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new d;for(let s=0;s<n;s++)d.unpack(t,s*3,a),d.multiplyComponents(a,i,a),d.add(a,o,a),d.pack(a,r,s*3);return r}static dequantize4D(t,n,i,o,r){l(r)||(r=new Float32Array(t.length));let a=new ie;for(let s=0;s<n;s++)ie.unpack(t,s*4,a),ie.multiplyComponents(a,i,a),ie.add(a,o,a),ie.pack(a,r,s*4);return r}static createComponentsReader(t){let n=e.createComponentReader(t),i=j.getSizeInBytes(t);return function(o,r,a,s){let c=r;for(let u=0;u<a;++u)s[u]=n(o,c),c+=i}}static createComponentReader(t){switch(t){case j.BYTE:return function(n,i){return n.getInt8(i)};case j.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case j.SHORT:return function(n,i){return n.getInt16(i,!0)};case j.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case j.INT:return function(n,i){return n.getInt32(i,!0)};case j.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case j.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case j.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new de(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let o=new d,r=t.length/3;for(let a=0;a<r;a++)d.unpack(t,a*3,o),P.multiplyByPoint(n,o,o),d.pack(o,i,a*3);return i}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,o=t.count,r=t.indexDatatype,a=e.createIndexTypedArray(r,o);return i.getBufferData(a),a}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Pe.TRIANGLES)return i;if(n===Pe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Pe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new de(`The primitiveType must be TRIANGLES (${Pe.TRIANGLES}, TRIANGLE_STRIP (${Pe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Pe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case Ue.UNSIGNED_BYTE:return new Uint8Array(n);case Ue.UNSIGNED_SHORT:return new Uint16Array(n);case Ue.UNSIGNED_INT:return new Uint32Array(n)}throw new de(`The indexDatatype must be UNSIGNED_BYTE (${Ue.UNSIGNED_BYTE}, UNSIGNED_SHORT (${Ue.UNSIGNED_SHORT}, or UNSIGNED_INT (${Ue.UNSIGNED_INT}, but is ${t}`)}},Sl=xq;var _fe={name:"EdgeVisibilityPipelineStage"};_fe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,he.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,he.FRAGMENT),i.addFragmentLines(V2),i.addVertexLines(H2),i.addUniform("bool","u_isEdgePass",he.BOTH);let o=t.material,r=l(o)?o.lineStyle:void 0;(!l(r)||!l(r.width))&&i.addUniform("float","u_lineWidth",he.VERTEX);let a=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let s=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_silhouetteNormal");i.addVarying("vec3","v_silhouetteNormalView","flat");let u=i.addAttribute("vec3","a_faceNormalA"),f=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let h=i.addAttribute("vec3","a_edgeOtherPos"),p=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let A=VYe(t),m=WYe(t);if(!l(m)||!l(m.edgeIndices)||m.edgeIndices.length===0)return;let _=e.runtimePrimitive.primitive,y=jYe(_),E=m.edgeData.some(function(L){return l(L.color)})||l(y),I;E&&(I=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,he.BOTH));let x,S,w=Tt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(w)&&(x=w,S=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,he.VERTEX));let v=HYe(A,m.edgeIndices,m.edgeData,t.edgeVisibility),R=YYe(m.edgeIndices,m.edgeData,e,n.context,a,c,u,f,s,I,h,p,y,t.edgeVisibility,v,x,S);if(!l(R))return;R.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,he.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let N=l(r)&&l(r.width)?r.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:R.vertexArray,indexCount:R.indexCount,primitiveType:Pe.TRIANGLES,pass:Be.CESIUM_3D_TILE_EDGES,lineWidth:N}};function VYe(e){let t=e.indices;if(!l(t))return{edgeMap:new Map,faceNormals:new Float32Array(0),triangleCount:0};let n=t.typedArray,i=Math.floor(n.length/3),o=Tt.getAttributeBySemantic(e,at.POSITION),r=l(o.typedArray)?o.typedArray:Sl.readAttributeAsTypedArray(o),a=o.quantization;if(l(a)&&!a.octEncoded){let y=r.length,C=new Float32Array(y),E=a.quantizedVolumeOffset,I=a.quantizedVolumeStepSize;for(let x=0;x<y;x+=3)C[x]=E.x+r[x]*I.x,C[x+1]=E.y+r[x+1]*I.y,C[x+2]=E.z+r[x+2]*I.z;r=C}let s=new Map,c=new Float32Array(i*3),u=new d,f=new d,h=new d,p=new d,A=new d,m=new d;function _(y,C,E){let I=`${y<C?y:C},${y<C?C:y}`,x=s.get(I);l(x)||(x=[],s.set(I,x)),x.length<2&&x.push(E)}for(let y=0;y<i;y++){let C=y*3,E=n[C],I=n[C+1],x=n[C+2],S=E*3,w=I*3,v=x*3;u.x=r[S],u.y=r[S+1],u.z=r[S+2],f.x=r[w],f.y=r[w+1],f.z=r[w+2],h.x=r[v],h.y=r[v+1],h.z=r[v+2],d.subtract(f,u,p),d.subtract(h,u,A),d.cross(p,A,m),d.normalize(m,m),c[C]=m.x,c[C+1]=m.y,c[C+2]=m.z,_(E,I,y),_(I,x,y),_(x,E,y)}return{edgeMap:s,faceNormals:c,triangleCount:i}}function HYe(e,t,n,i){let{edgeMap:o,faceNormals:r}=e,a=t.length/2,s=new Float32Array(a*6),c=l(i)&&l(i.silhouetteNormals),u=null,f=new d,h=new d;if(c){let p=C=>2*((C+128)/255)-1,A=new Uint16Array(i.silhouetteNormals.length),m=new d,_=new Q;for(let C=0;C<i.silhouetteNormals.length;C++){let E=i.silhouetteNormals[C];m.x=p(E.x),m.y=p(E.y),m.z=p(E.z),d.magnitude(m)>0?d.normalize(m,m):(m.x=0,m.y=0,m.z=1),tn.octEncodeInRange(m,255,_);let x=_.x&255,S=_.y&255;A[C]=S<<8|x}let y=Math.floor(A.length/2);u=new Uint32Array(y);for(let C=0;C<y;C++){let E=A[C*2],I=A[C*2+1];u[C]=E|I<<16}}for(let p=0;p<a;p++){let A=t[p*2],m=t[p*2+1],_=`${A<m?A:m},${A<m?m:A}`,y=o.get(_),{edgeType:C,mateVertexIndex:E}=n[p],I,x,S,w,v,R,N=!1;if(c&&u&&C===1&&E>=0&&E<u.length){let g=u[E];tn.octDecode(g&255,g>>8&255,f),tn.octDecode(g>>16&255,g>>24&255,h),I=f.x,x=f.y,S=f.z,w=h.x,v=h.y,R=h.z,N=!0}if(!N){if(!l(y)||y.length===0)continue;let b=y[0]*3;if(I=r[b],x=r[b+1],S=r[b+2],y.length>1){let M=y[1]*3;w=r[M],v=r[M+1],R=r[M+2]}else w=-I,v=-x,R=-S}let L=p*6;s[L]=I,s[L+1]=x,s[L+2]=S,s[L+3]=w,s[L+4]=v,s[L+5]=R}return s}function WYe(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,o=t.lineStrings,r=e.attributes,a=l(r)&&r.length>0?r[0].count:0,s=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(o)&&o.length>0;if(!s&&!c)return[];let u=s?i.typedArray:void 0,f=[],h=[],p=new Set,A=0,m=t.materialColor;if(s){let _=0,y=u.length,C=n;for(let E=0;E+2<y;E+=3){let I=u[E],x=u[E+1],S=u[E+2];for(let w=0;w<3;w++){let v,R;w===0?(v=I,R=x):w===1?(v=x,R=S):(v=S,R=I);let N=Math.floor(_/4),L=_%4*2;if(_++,N>=C.length)break;let b=C[N]>>L&3;if(b===0)continue;let T=Math.min(v,R),B=Math.max(v,R),M=`${T},${B}`;if(p.has(M))continue;p.add(M),f.push(v,R);let O=-1;b===1&&(O=A,A++),h.push({edgeType:b,triangleIndex:Math.floor(E/3),edgeIndex:w,mateVertexIndex:O,currentTriangleVertices:[I,x,S],color:m})}}}if(c)for(let _=0;_<o.length;_++){let y=o[_];if(!l(y)||!l(y.indices))continue;let C=y.indices;if(!l(C)||C.length<2)continue;let E=y.restartIndex,I=l(y.materialColor)?y.materialColor:m,x;for(let S=0;S<C.length;S++){let w=C[S];if(l(E)&&w===E){x=void 0;continue}if(!l(x)){x=w;continue}let v=x,R=w;if(x=w,v===R||a>0&&(v<0||v>=a||R<0||R>=a))continue;let N=Math.min(v,R),L=Math.max(v,R),g=`${N},${L}`;p.has(g)||(p.add(g),f.push(v,R),h.push({edgeType:2,triangleIndex:-1,edgeIndex:-1,mateVertexIndex:-1,currentTriangleVertices:void 0,color:l(I)?I:void 0}))}}return{edgeIndices:f,edgeData:h,silhouetteEdgeCount:A}}function jYe(e){if(!l(e))return;let t=Tt.getAttributeBySemantic(e,at.COLOR);if(!l(t))return;let n=zt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Sl.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length<o*n)return;let r=i instanceof Float32Array||i instanceof Float64Array,a=i instanceof Uint8Array,s=i instanceof Uint16Array;if(!r&&!a&&!s)return;let c=new Float32Array(o*4),u=function(f){let h;return r?h=f:a?h=f/255:s&&(h=f/65535),Math.min(Math.max(h,0),1)};for(let f=0;f<o;f++){let h=f*n,p=f*4;c[p]=u(i[h]),c[p+1]=u(i[h+1]),c[p+2]=u(i[h+2]),n===4?c[p+3]=u(i[h+3]):c[p+3]=1}return{colors:c,count:o}}function YYe(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_,y){if(!l(e)||e.length===0)return;let C=t.length,I=C*4,x=0,S=Tt.getAttributeBySemantic(n.runtimePrimitive.primitive,at.POSITION),w=l(S.typedArray)?S.typedArray:Sl.readAttributeAsTypedArray(S),v=new Float32Array(I*3),R=new Float32Array(I),N=new Float32Array(I*3),L=new Float32Array(I*3),g=new Float32Array(I*3),b=new Float32Array(I*3),T=new Float32Array(I),B=l(_),M=B?new Float32Array(I):void 0,O;B&&(O=l(_.typedArray)?_.typedArray:Sl.readAttributeAsTypedArray(_));let G=l(u),k=G?new Float32Array(I*4):void 0,z=l(p)?p.colors:void 0,F=l(p)?p.count:0;function H(st){if(!G)return;let ft=st*4;k[ft]=0,k[ft+1]=0,k[ft+2]=0,k[ft+3]=-1}function Y(st,ft){if(!G)return;let St=st*4,be=l(ft.x)?ft.x:ft[0],Se=l(ft.y)?ft.y:ft[1],qt=l(ft.z)?ft.z:ft[2],mt=l(ft.w)?ft.w:l(ft[3])?ft[3]:1;k[St]=be,k[St+1]=Se,k[St+2]=qt,k[St+3]=mt}function $(st,ft){if(!G)return;if(ft>=F){H(st);return}let St=ft*4,be=st*4;k[be]=z[St],k[be+1]=z[St+1],k[be+2]=z[St+2],k[be+3]=z[St+3]}for(let st=0;st<C;st++){let ft=e[st*2],St=e[st*2+1],be=t[st].edgeType,Se=be/255,qt=w[ft*3],mt=w[ft*3+1],Ut=w[ft*3+2],Gn=w[St*3],Xe=w[St*3+1],ro=w[St*3+2],Vt=st*4;v[Vt*3]=qt,v[Vt*3+1]=mt,v[Vt*3+2]=Ut,b[Vt*3]=Gn,b[Vt*3+1]=Xe,b[Vt*3+2]=ro,T[Vt]=-1,R[Vt]=Se,v[(Vt+1)*3]=qt,v[(Vt+1)*3+1]=mt,v[(Vt+1)*3+2]=Ut,b[(Vt+1)*3]=Gn,b[(Vt+1)*3+1]=Xe,b[(Vt+1)*3+2]=ro,T[Vt+1]=1,R[Vt+1]=Se,v[(Vt+2)*3]=Gn,v[(Vt+2)*3+1]=Xe,v[(Vt+2)*3+2]=ro,b[(Vt+2)*3]=qt,b[(Vt+2)*3+1]=mt,b[(Vt+2)*3+2]=Ut,T[Vt+2]=1,R[Vt+2]=Se,v[(Vt+3)*3]=Gn,v[(Vt+3)*3+1]=Xe,v[(Vt+3)*3+2]=ro,b[(Vt+3)*3]=qt,b[(Vt+3)*3+1]=mt,b[(Vt+3)*3+2]=Ut,T[Vt+3]=-1,R[Vt+3]=Se;let Do=t[st].color;if(l(Do))for(let yn=0;yn<4;yn++)Y(Vt+yn,Do);else if(l(z))for(let yn=0;yn<4;yn++)$(Vt+yn,ft);else for(let yn=0;yn<4;yn++)H(Vt+yn);if(B){let yn=O[ft],Ei=O[St];M[Vt]=yn,M[Vt+1]=yn,M[Vt+2]=Ei,M[Vt+3]=Ei}let ji=0,Mi=0,zo=1;if(be===1&&l(A.silhouetteNormals)){let yn=t[st].mateVertexIndex;if(yn>=0&&yn<A.silhouetteNormals.length){let Ei=A.silhouetteNormals[yn];l(Ei)&&(ji=Ei.x,Mi=Ei.y,zo=Ei.z)}}for(let yn=0;yn<4;yn++)N[(Vt+yn)*3]=ji,N[(Vt+yn)*3+1]=Mi,N[(Vt+yn)*3+2]=zo;let ii=st*6,qn=m[ii],Yi=m[ii+1],vo=m[ii+2],mo=m[ii+3],Xo=m[ii+4],Go=m[ii+5];for(let yn=0;yn<4;yn++)L[(Vt+yn)*3]=qn,L[(Vt+yn)*3+1]=Yi,L[(Vt+yn)*3+2]=vo,g[(Vt+yn)*3]=mo,g[(Vt+yn)*3+1]=Xo,g[(Vt+yn)*3+2]=Go}let W=tt.createVertexBuffer({context:i,typedArray:v,usage:Re.STATIC_DRAW}),K=tt.createVertexBuffer({context:i,typedArray:R,usage:Re.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:N,usage:Re.STATIC_DRAW}),pe=tt.createVertexBuffer({context:i,typedArray:L,usage:Re.STATIC_DRAW}),ge=tt.createVertexBuffer({context:i,typedArray:g,usage:Re.STATIC_DRAW}),re=tt.createVertexBuffer({context:i,typedArray:b,usage:Re.STATIC_DRAW}),ye=tt.createVertexBuffer({context:i,typedArray:T,usage:Re.STATIC_DRAW}),Ce=G?tt.createVertexBuffer({context:i,typedArray:k,usage:Re.STATIC_DRAW}):void 0,ve=B?tt.createVertexBuffer({context:i,typedArray:M,usage:Re.STATIC_DRAW}):void 0,Le=C*2*3,Oe=I>65534,nt=Oe?new Uint32Array(Le):new Uint16Array(Le);for(let st=0;st<C;st++){let ft=st*4,St=st*6;nt[St]=ft,nt[St+1]=ft+1,nt[St+2]=ft+2,nt[St+3]=ft,nt[St+4]=ft+2,nt[St+5]=ft+3}let Fe=tt.createIndexBuffer({context:i,typedArray:nt,usage:Re.STATIC_DRAW,indexDatatype:Oe?Ue.UNSIGNED_INT:Ue.UNSIGNED_SHORT}),_t=[{index:x,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:o,vertexBuffer:K,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1},{index:r,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:a,vertexBuffer:pe,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:s,vertexBuffer:ge,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:f,vertexBuffer:re,componentsPerAttribute:3,componentDatatype:j.FLOAT,normalize:!1},{index:h,vertexBuffer:ye,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1}];G&&_t.push({index:u,vertexBuffer:Ce,componentsPerAttribute:4,componentDatatype:j.FLOAT,normalize:!1}),B&&_t.push({index:y,vertexBuffer:ve,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1});let rt=n.runtimePrimitive.primitive;if(l(rt.featureIds)&&rt.featureIds.length>0){let st=rt.featureIds[0];if(l(st.setIndex)){let ft=rt.attributes.find(St=>St.semantic===at.FEATURE_ID&&St.setIndex===st.setIndex);if(l(ft)){let St=l(ft.typedArray)?ft.typedArray:Sl.readAttributeAsTypedArray(ft),be=new Float32Array(I);for(let qt=0;qt<C;qt++){let mt=e[qt*2],Ut=mt<St.length?St[mt]:0;for(let Gn=0;Gn<4;Gn++)be[qt*4+Gn]=Ut}let Se=tt.createVertexBuffer({context:i,typedArray:be,usage:Re.STATIC_DRAW});_t.push({index:c,vertexBuffer:Se,componentsPerAttribute:1,componentDatatype:j.FLOAT,normalize:!1})}}}return{vertexArray:new Vn({context:i,attributes:_t,indexBuffer:Fe}),indexCount:Le,hasEdgeFeatureIds:l(rt.featureIds)&&rt.featureIds.length>0}}var W2=_fe;var j2=`void geometryStage(out ProcessedAttributes attributes)
|
|
{
|
|
attributes.positionMC = v_positionMC;
|
|
attributes.positionEC = v_positionEC;
|
|
|
|
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
|
|
attributes.positionWC = v_positionWC;
|
|
#endif
|
|
|
|
#ifdef HAS_NORMALS
|
|
// renormalize after interpolation
|
|
attributes.normalEC = normalize(v_normalEC);
|
|
#endif
|
|
|
|
#ifdef HAS_TANGENTS
|
|
attributes.tangentEC = normalize(v_tangentEC);
|
|
#endif
|
|
|
|
#ifdef HAS_BITANGENTS
|
|
attributes.bitangentEC = normalize(v_bitangentEC);
|
|
#endif
|
|
|
|
// Everything else is dynamically generated in GeometryPipelineStage
|
|
setDynamicVaryings(attributes);
|
|
}
|
|
`;var Y2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
|
|
{
|
|
vec4 computedPosition;
|
|
|
|
// Compute positions in different coordinate systems
|
|
vec3 positionMC = attributes.positionMC;
|
|
v_positionMC = positionMC;
|
|
v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
|
|
|
|
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
|
|
vec3 position2D = attributes.position2D;
|
|
vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
|
|
computedPosition = czm_projection * vec4(positionEC, 1.0);
|
|
#else
|
|
computedPosition = czm_projection * vec4(v_positionEC, 1.0);
|
|
#endif
|
|
|
|
// Sometimes the custom shader and/or style needs this
|
|
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
|
|
// Note that this is a 32-bit position which may result in jitter on small
|
|
// scales.
|
|
v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
|
|
#endif
|
|
|
|
#ifdef HAS_NORMALS
|
|
v_normalEC = normalize(normal * attributes.normalMC);
|
|
#endif
|
|
|
|
#ifdef HAS_TANGENTS
|
|
v_tangentEC = normalize(normal * attributes.tangentMC);
|
|
#endif
|
|
|
|
#ifdef HAS_BITANGENTS
|
|
v_bitangentEC = normalize(normal * attributes.bitangentMC);
|
|
#endif
|
|
|
|
// All other varyings need to be dynamically generated in
|
|
// GeometryPipelineStage
|
|
setDynamicVaryings(attributes);
|
|
|
|
return computedPosition;
|
|
}
|
|
`;var rD=`vec2 computeSt(float featureId)
|
|
{
|
|
float stepX = model_textureStep.x;
|
|
float centerX = model_textureStep.y;
|
|
|
|
#ifdef MULTILINE_BATCH_TEXTURE
|
|
float stepY = model_textureStep.z;
|
|
float centerY = model_textureStep.w;
|
|
|
|
float xId = mod(featureId, model_textureDimensions.x);
|
|
float yId = floor(featureId / model_textureDimensions.x);
|
|
|
|
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
|
|
#else
|
|
return vec2(centerX + (featureId * stepX), 0.5);
|
|
#endif
|
|
}
|
|
|
|
void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
|
|
{
|
|
int featureId = featureIds.SELECTED_FEATURE_ID;
|
|
|
|
|
|
if (featureId < model_featuresLength)
|
|
{
|
|
vec2 featureSt = computeSt(float(featureId));
|
|
|
|
feature.id = featureId;
|
|
feature.st = featureSt;
|
|
feature.color = texture(model_batchTexture, featureSt);
|
|
}
|
|
// Floating point comparisons can be unreliable in GLSL, so we
|
|
// increment the feature ID to make sure it's always greater
|
|
// then the model_featuresLength - a condition we check for in the
|
|
// pick ID, to avoid sampling the pick texture if the feature ID is
|
|
// greater than the number of features.
|
|
else
|
|
{
|
|
feature.id = model_featuresLength + 1;
|
|
feature.st = vec2(0.0);
|
|
feature.color = vec4(1.0);
|
|
}
|
|
|
|
#ifdef HAS_NULL_FEATURE_ID
|
|
if (featureId == model_nullFeatureId) {
|
|
feature.id = featureId;
|
|
feature.st = vec2(0.0);
|
|
feature.color = vec4(1.0);
|
|
}
|
|
#endif
|
|
}
|
|
`;var aD={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};aD.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,a=qYe(o,r,t),s=a.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,s),i.addDefine("SELECTED_FEATURE_ID",a.variableName,s),i.addDefine(a.featureIdDefine,void 0,s),KYe(i);let c=a.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,s),i.addUniform("int","model_nullFeatureId",s),u.model_nullFeatureId=function(){return c}),a.shaderDestination===he.BOTH&&i.addVertexLines(rD),i.addFragmentLines(rD)};function yfe(e){return e instanceof bn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Cfe(e){return e instanceof bn.FeatureIdTexture?he.FRAGMENT:he.BOTH}function qYe(e,t,n){let i,o;return l(t.instances)&&(o=Tt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Cfe(o),featureIdDefine:yfe(o)}):(o=Tt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Cfe(o),featureIdDefine:yfe(o)})}function KYe(e){e.addStructField(aD.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(aD.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(aD.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var wE=aD;var Ts={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)"};Ts.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",he.VERTEX),i.addStruct(Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",he.FRAGMENT),i.addStruct(wE.STRUCT_ID_SELECTED_FEATURE,wE.STRUCT_NAME_SELECTED_FEATURE,he.BOTH),i.addFunction(Ts.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ts.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,he.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ts.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ts.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.VERTEX),i.addFunction(Ts.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ts.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,he.FRAGMENT),o.type===Vr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,he.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,a=l(e.runtimeNode.node.instances),s=r&&!a,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],h=zt.getAttributeLocationCount(f.type),p=f.semantic===at.POSITION,A;h>1?(A=e.attributeIndex,e.attributeIndex+=h):p&&!s?A=0:A=e.attributeIndex++;let m=!p&&t.primitiveType===Pe.POINTS&&n.context.webgl2?"flat":void 0;XYe(e,f,A,h,r,a,m)}rqe(i,t.attributes),t.primitiveType===Pe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(Y2),i.addFragmentLines(j2)};function XYe(e,t,n,i,o,r,a){let s=e.shaderBuilder,c=Tt.getAttributeInfo(t),u=o&&!r;i>1?$Ye(e,t,n,i):ZYe(e,t,n,u),tqe(s,c,u),eqe(s,c,a),l(t.semantic)&&JYe(s,t),nqe(s,c,o),iqe(s,c,u),oqe(s,c)}function JYe(e,t){let{semantic:n,setIndex:i}=t;switch(n){case at.NORMAL:e.addDefine("HAS_NORMALS");break;case at.TANGENT:e.addDefine("HAS_TANGENTS");break;case at.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case at.TEXCOORD:case at.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function ZYe(e,t,n,i){let{quantization:o,semantic:r,setIndex:a}=t,{type:s,componentDatatype:c}=l(o)?o:t;r===at.FEATURE_ID&&a>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a+1);let u=r===at.POSITION,f=u?0:n,h=zt.getNumberOfComponents(s),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let A=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:A,count:t.count,componentsPerAttribute:h,componentDatatype:j.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function $Ye(e,t,n,i){let{quantization:o,normalized:r}=t,{type:a,componentDatatype:s}=l(o)?o:t,u=zt.getNumberOfComponents(a)/i,f=j.getSizeInBytes(s),h=u*f,p=t.byteStride;for(let A=0;A<i;A++){let m=t.byteOffset+A*h,_={index:n+A,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:s,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(_)}}function eqe(e,t,n){let i=t.variableName,o=`v_${i}`,r;i==="normalMC"?(o="v_normalEC",r=t.glslType):i==="tangentMC"?(r="vec3",o="v_tangentEC"):r=t.glslType,e.addVarying(r,o,n)}function tqe(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,a;t.isQuantized?(r=`a_quantized_${o}`,a=t.quantizedGlslType):(r=`a_${o}`,a=t.glslType);let s=i===at.POSITION;s?e.setPositionAttribute(a,r):e.addAttribute(a,r),s&&n&&e.addAttribute("vec3","a_position2D")}function nqe(e,t,n){let i=Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:a}=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,a,r),e.addStructField(o,a,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function iqe(e,t,n){let i=Ts.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let a=[];o==="tangentMC"?(a.push("attributes.tangentMC = a_tangentMC.xyz;"),a.push("attributes.tangentSignMC = a_tangentMC.w;")):a.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,a)}function oqe(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Ts.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,a=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[a]),o=Ts.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,a=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[a])}function rqe(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===at.NORMAL?n=!0:r.semantic===at.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ts.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var q2=Ts;function z_(e){if(e=e??V.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??te.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new mi(this._ellipsoid),l(e.rectangleSouthwestInMeters)&&l(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new Q(-i,-i),this._rectangleNortheastInMeters=new Q(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(z_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});z_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};z_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};z_.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return l(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};z_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,s=this._rectangleSouthwestInMeters.x+e*a,c=this._rectangleSouthwestInMeters.x+(e+1)*a,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return l(i)?(i.west=s,i.south=h,i.east=c,i.north=f,i):new ce(s,h,c,f)};z_.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,a=r.unproject(new Q(o.west,o.south)),s=r.unproject(new Q(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=s.longitude,o.north=s.latitude,o};z_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,A=this._rectangleNortheastInMeters.y-h.y,m=p/s|0;m>=o&&(m=o-1);let _=A/u|0;return _>=r&&(_=r-1),l(n)?(n.x=m,n.y=_,n):new Q(m,_)};var za=z_;var Tq,Efe="AAPTahokHpH_PEeQIduLwb1A8ZA..rA8bGH-48FscqzwJpCALUEqt2P_mHiflgl0WkBvCxPJzsFMRqAukz-mcG8oZ3eKnfk4MHGvCFMNsNrxXb2fGxfKH-3TQxCZVkCycztIPWRM5OIQ7pzTZIBOO9D7N8VXXpyPtp2bSsxWp5dUpv8qsgrfMHU4IXWGiiKWELBnANXn1QgzyLKngOHAgYWUq2OQ2XuULOpwJwOEWpyX5KvoLavJP0LFJdjB08Mmz-wCvnFqwr8CZjFpKaVSbAT1_aZs2dlMP",lx={};lx.defaultAccessToken=Efe;lx.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});lx.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});lx.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});lx.getDefaultTokenCredit=function(e){if(e===Efe){if(!l(Tq)){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>';Tq=new Et(t,!0)}return Tq}};var nd=lx;function Sq(e){e=e??V.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let a=mm(r);if(e.disableCheckIfAllPixelsAreTransparent){let s=!0,c=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;s&&f<h;++f){let p=u[f],A=p.x*4+p.y*c;a[A+3]>0&&(s=!1)}s&&(a=void 0)}n._missingImagePixels=a,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}Sq.prototype.isReady=function(){return this._isReady};Sq.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=mm(e),o=e.width;for(let r=0,a=t.length;r<a;++r){let s=t[r],c=s.x*4+s.y*o;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var K2=Sq;function wq(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}wq.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};wq.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Zm=wq;function ux(){de.throwInstantiationError()}Object.defineProperties(ux.prototype,{rectangle:{get:de.throwInstantiationError},tileWidth:{get:de.throwInstantiationError},tileHeight:{get:de.throwInstantiationError},maximumLevel:{get:de.throwInstantiationError},minimumLevel:{get:de.throwInstantiationError},tilingScheme:{get:de.throwInstantiationError},tileDiscardPolicy:{get:de.throwInstantiationError},errorEvent:{get:de.throwInstantiationError},credit:{get:de.throwInstantiationError},proxy:{get:de.throwInstantiationError},hasAlphaChannel:{get:de.throwInstantiationError}});ux.prototype.getTileCredits=function(e,t,n){de.throwInstantiationError()};ux.prototype.requestImage=function(e,t,n,i){de.throwInstantiationError()};ux.prototype.pickFeatures=function(e,t,n,i,o){de.throwInstantiationError()};var aqe=/\.ktx2$/i;ux.loadImage=function(e,t){let n=De.createIfNeeded(t);return aqe.test(n.url)?ku(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var id=ux;var sqe={SATELLITE:1,OCEANS:2,HILLSHADE:3},$m=Object.freeze(sqe);function Ife(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ji({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Et(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}Ife.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new K2({missingImageUrl:bfe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new Q(0,0),new Q(200,20),new Q(20,200),new Q(80,110),new Q(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function cqe(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new za({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ji({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ue(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new mi,o=e.fullExtent,r=i.unproject(new d(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),a=i.unproject(new d(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,a.longitude,a.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ue(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Et(e.copyrightText)]:t.credit=new Et(e.copyrightText))}function lqe(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ue(n)}async function uqe(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();cqe(i,t)}catch(i){lqe(e,i)}}function ep(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ji({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 Et(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new _e}ep.fromBasemapType=async function(e,t){t=t??V.EMPTY_OBJECT;let n,i,o;switch(e){case $m.SATELLITE:{n=t.token??nd.defaultAccessToken,i=De.createIfNeeded(nd.defaultWorldImageryServer),i.appendForwardSlash();let r=nd.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;case $m.OCEANS:{n=t.token??nd.defaultAccessToken,i=De.createIfNeeded(nd.defaultWorldOceanServer),i.appendForwardSlash();let r=nd.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;case $m.HILLSHADE:{n=t.token??nd.defaultAccessToken,i=De.createIfNeeded(nd.defaultWorldHillshadeServer),i.appendForwardSlash();let r=nd.getDefaultTokenCredit(n);l(r)&&(o=Et.clone(r))}break;default:}return ep.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function bfe(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let a=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${a.west},${a.south},${a.east},${a.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof qi?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(ep.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}}});ep.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new ep(t);i._resource=n;let o=new Ife(t);return(t.usePreCachedTilesIfAvailable??!0)&&await uqe(n,o),o.build(i),i};ep.prototype.getTileCredits=function(e,t,n){return this._tileCredits};ep.prototype.requestImage=function(e,t,n,i){return id.loadImage(this,bfe(this,e,t,n,i))};ep.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),a,s,c;if(this._tilingScheme.projection instanceof qi)a=D.toDegrees(i),s=D.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new me(i,o,0));a=p.x,s=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${a},${s}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let A=[],m=p.results;if(!l(m))return A;for(let _=0;_<m.length;++_){let y=m[_],C=new Zm;if(C.data=y,C.name=y.value,C.properties=y.attributes,C.configureDescriptionFromProperties(y.attributes),y.geometryType==="esriGeometryPoint"&&y.geometry){let E=y.geometry.spatialReference&&y.geometry.spatialReference.wkid?y.geometry.spatialReference.wkid:4326;if(E===4326||E===4283)C.position=me.fromDegrees(y.geometry.x,y.geometry.y,y.geometry.z);else if(E===102100||E===900913||E===3857){let I=new mi;C.position=I.unproject(new d(y.geometry.x,y.geometry.y,y.geometry.z))}}A.push(C)}return A})};ep._metadataCache={};var G_=ep;function fqe(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return l(o)&&(t+=`
|
|
${o}`),t}var vA=fqe;function X2(e,t,n,i,o,r,a){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=a}X2.reportError=function(e,t,n,i,o,r,a,s){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=a,c.retry=!1,c.error=s,++c.timesRetried):c=new X2(t,i,o,r,a,0,s),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${vA(i)}`),c};X2.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var tr=X2;var dqe={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"},sD=Object.freeze(dqe);function cD(e){}cD.prototype.isReady=function(){return!0};cD.prototype.shouldDiscardImage=function(e){return cD.EMPTY_IMAGE===e};var J2;Object.defineProperties(cD,{EMPTY_IMAGE:{get:function(){return l(J2)||(J2=new Image,J2.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),J2}}});var lD=cD;function xfe(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}xfe.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 Et)break;o.credit=new Et(o.attribution);let r=o.coverageAreas;for(let a=0,s=o.coverageAreas.length;a<s;++a){let c=r[a],u=c.bbox;c.bbox=new ce(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function hqe(e,t){if(e.resourceSets.length!==1)throw new ue("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function mqe(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ue(i)}async function pqe(e,t,n){let i=e.url,o=rs._metadataCache[i];l(o)||(o=e.fetchJson(),rs._metadataCache[i]=o);try{let r=await o;return hqe(r,t)}catch(r){mqe(e,r,n)}}function rs(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??sD.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new lD),this._proxy=e.proxy,this._credit=new Et(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${rs.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new za({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new _e}Object.defineProperties(rs.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});rs.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??sD.AERIAL,o=De.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let a=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),s=new rs(t);s._resource=o;let c=new xfe(t);return await pqe(a,c),c.build(s),s};var Aqe=new ce;rs.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Aqe);return yqe(this._attributionList,n,i)};rs.prototype.requestImage=function(e,t,n,i){let o=id.loadImage(this,gqe(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?lD.EMPTY_IMAGE:Promise.reject(r)})};rs.prototype.pickFeatures=function(e,t,n,i,o){};rs.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,a=0;(e&r)!==0&&(a|=1),(t&r)!==0&&(a|=2),i+=a}return i};rs.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,a=+e[i-o];(a&1)!==0&&(t|=r),(a&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};rs._logoUrl=void 0;Object.defineProperties(rs,{logoUrl:{get:function(){return l(rs._logoUrl)||(rs._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),rs._logoUrl},set:function(e){rs._logoUrl=e}}});function gqe(e,t,n,i,o){let r=e._imageUrlTemplate,a=e._imageUrlSubdomains,s=(t+n+i)%a.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:rs.tileXYToQuadKey(t,n,i),subdomain:a[s],culture:e._culture},queryParameters:{n:"z"}})}var _qe=new ce;function yqe(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let a=e[o],s=a.coverageAreas,c=!1;for(let u=0,f=a.coverageAreas.length;!c&&u<f;++u){let h=s[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,_qe);l(p)&&(c=!0)}}c&&i.push(a.credit)}return i}rs._metadataCache={};var Z2=rs;var Tfe=/{[^}]+}/g,Sfe={x:bqe,y:Tqe,z:Bqe,s:Dqe,reverseX:xqe,reverseY:Sqe,reverseZ:wqe,westDegrees:vqe,southDegrees:Pqe,eastDegrees:Rqe,northDegrees:Mqe,westProjected:Nqe,southProjected:Lqe,eastProjected:Oqe,northProjected:Fqe,width:Qqe,height:kqe},Cqe=Pt(Sfe,{i:Uqe,j:zqe,reverseI:Gqe,reverseJ:Vqe,longitudeDegrees:Wqe,latitudeDegrees:jqe,longitudeProjected:Yqe,latitudeProjected:qqe,format:Xqe});function uD(e){e=e??V.EMPTY_OBJECT,this._errorEvent=new _e;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new za({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Et(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,a=Pt(Sfe,r),s=Pt(Cqe,r);this._tags=a,this._pickFeaturesTags=s,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(uD.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}}});uD.prototype.getTileCredits=function(e,t,n){};uD.prototype.requestImage=function(e,t,n,i){return id.loadImage(this,Eqe(this,e,t,n,i))};uD.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,a=this;function s(u,f){return u.callback(f)}function c(){if(r>=a._getFeatureInfoFormats.length)return Promise.resolve([]);let u=a._getFeatureInfoFormats[r],f=Iqe(a,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(s.bind(void 0,u)).catch(c)}return c()};var $2=!1,Zu=new ce,ek=!1,fD=new ce;function Eqe(e,t,n,i,o){$2=!1,ek=!1;let r=e._resource,a=r.getUrlComponent(!0),s=e._tags,c={},u=a.match(Tfe);return l(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);l(s[h])&&(c[h]=s[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var Bq=!1,dx=new Q,Dq=!1;function Iqe(e,t,n,i,o,r,a){$2=!1,ek=!1,Bq=!1,Dq=!1;let s=e._pickFeaturesResource,c=s.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=c.match(Tfe);return l(h)&&h.forEach(function(p){let A=p.substring(1,p.length-1);l(u[A])&&(f[A]=u[A](e,t,n,i,o,r,a))}),s.getDerivedResource({templateValues:f})}function hx(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 bqe(e,t,n,i){return hx(e,"{x}",t)}function xqe(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return hx(e,"{reverseX}",o)}function Tqe(e,t,n,i){return hx(e,"{y}",n)}function Sqe(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return hx(e,"{reverseY}",o)}function wqe(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return hx(e,"{reverseZ}",r)}function Bqe(e,t,n,i){return hx(e,"{z}",i)}function Dqe(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function tk(e,t,n,i){$2||(e.tilingScheme.tileXYToRectangle(t,n,i,Zu),Zu.west=D.toDegrees(Zu.west),Zu.south=D.toDegrees(Zu.south),Zu.east=D.toDegrees(Zu.east),Zu.north=D.toDegrees(Zu.north),$2=!0)}function vqe(e,t,n,i){return tk(e,t,n,i),Zu.west}function Pqe(e,t,n,i){return tk(e,t,n,i),Zu.south}function Rqe(e,t,n,i){return tk(e,t,n,i),Zu.east}function Mqe(e,t,n,i){return tk(e,t,n,i),Zu.north}function nk(e,t,n,i){ek||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,fD),ek=!0)}function Nqe(e,t,n,i){return nk(e,t,n,i),fD.west}function Lqe(e,t,n,i){return nk(e,t,n,i),fD.south}function Oqe(e,t,n,i){return nk(e,t,n,i),fD.east}function Fqe(e,t,n,i){return nk(e,t,n,i),fD.north}function Qqe(e,t,n,i){return e.tileWidth}function kqe(e,t,n,i){return e.tileHeight}function Uqe(e,t,n,i,o,r,a){return ik(e,t,n,i,o,r),dx.x}function zqe(e,t,n,i,o,r,a){return ik(e,t,n,i,o,r),dx.y}function Gqe(e,t,n,i,o,r,a){return ik(e,t,n,i,o,r),e.tileWidth-dx.x-1}function Vqe(e,t,n,i,o,r,a){return ik(e,t,n,i,o,r),e.tileHeight-dx.y-1}var Hqe=new ce,fx=new d;function ik(e,t,n,i,o,r,a){if(Bq)return;vq(e,t,n,i,o,r);let s=fx,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Hqe);dx.x=e.tileWidth*(s.x-c.west)/c.width|0,dx.y=e.tileHeight*(c.north-s.y)/c.height|0,Bq=!0}function Wqe(e,t,n,i,o,r,a){return D.toDegrees(o)}function jqe(e,t,n,i,o,r,a){return D.toDegrees(r)}function Yqe(e,t,n,i,o,r,a){return vq(e,t,n,i,o,r),fx.x}function qqe(e,t,n,i,o,r,a){return vq(e,t,n,i,o,r),fx.y}var Kqe=new me;function vq(e,t,n,i,o,r,a){if(!Dq){if(e.tilingScheme.projection instanceof qi)fx.x=D.toDegrees(o),fx.y=D.toDegrees(r);else{let s=Kqe;s.longitude=o,s.latitude=r,e.tilingScheme.projection.project(s,fx)}Dq=!0}}function Xqe(e,t,n,i,o,r,a){return a}var ba=uD;function od(e){ba.call(this,e)}od._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return od._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof nA)return od._metadataFailure(e,t);throw o}};od.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??V.EMPTY_OBJECT;let r=await od._requestMetadata(t,i,o);return new od(r)};l(Object.create)&&(od.prototype=Object.create(ba.prototype),od.prototype.constructor=od);function wfe(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 Bfe(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}od._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,a=/tileset/i,s=/tilesets/i,c=/boundingbox/i,u,f,h,p=[],A=e.childNodes[0].childNodes;for(let R=0;R<A.length;R++)if(r.test(A.item(R).nodeName))u=A.item(R);else if(s.test(A.item(R).nodeName)){h=A.item(R);let N=A.item(R).childNodes;for(let L=0;L<N.length;L++)a.test(N.item(L).nodeName)&&p.push(N.item(L))}else c.test(A.item(R).nodeName)&&(f=A.item(R));let m;if(!l(h)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&tr.reportError(void 0,o,o.errorEvent,m),new ue(m);let _=t.fileExtension??u.getAttribute("extension"),y=t.tileWidth??parseInt(u.getAttribute("width"),10),C=t.tileHeight??parseInt(u.getAttribute("height"),10),E=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),I=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),x=h.getAttribute("profile"),S=t.tilingScheme;if(!l(S))if(x==="geodetic"||x==="global-geodetic")S=new Ji({ellipsoid:t.ellipsoid});else if(x==="mercator"||x==="global-mercator")S=new za({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${x}.`,l(o)&&tr.reportError(void 0,o,o.errorEvent,m),new ue(m);let w=ce.clone(t.rectangle);if(!l(w)){let R,N,L,g;t.flipXY??!1?(L=new Q(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),g=new Q(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new Q(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),g=new Q(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let T=x==="geodetic"||x==="mercator";if(S.projection instanceof qi||T)R=me.fromDegrees(L.x,L.y),N=me.fromDegrees(g.x,g.y);else{let B=S.projection;R=B.unproject(L),N=B.unproject(g)}w=new ce(R.longitude,R.latitude,N.longitude,N.latitude)}return w=wfe(w,S),E=Bfe(S,w,E),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${_}`}),tilingScheme:S,rectangle:w,tileWidth:y,tileHeight:C,minimumLevel:E,maximumLevel:I,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};od._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,a=l(e.tilingScheme)?e.tilingScheme:new za({ellipsoid:e.ellipsoid}),s=e.rectangle??a.rectangle;s=wfe(s,a);let c=Bfe(a,s,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:a,rectangle:s,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var BE=od;function Dfe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Dfe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Jqe(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ue(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ue(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new za({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ue(o)}return!0}function Zqe(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function $qe(e,t,n){try{let i=await e.fetchText();Jqe(i,t)}catch(i){Zqe(i,e,n)}}function fu(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 Et(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${fu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new _e}Object.defineProperties(fu.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}}});fu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=De.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"}}),a=new Dfe(n);a.channel=t,await $qe(r,a);let s=new fu(n);return a.build(s),s._resource=o,s._url=e,s._path=i,s};fu.prototype.getTileCredits=function(e,t,n){};fu.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 id.loadImage(this,o)};fu.prototype.pickFeatures=function(e,t,n,i,o){};fu._logoUrl=void 0;Object.defineProperties(fu,{logoUrl:{get:function(){return l(fu._logoUrl)||(fu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),fu._logoUrl},set:function(e){fu._logoUrl=e}}});var ok=fu;var eKe=/\/$/,vfe=new Et('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function mx(e){e=e??V.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.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();eKe.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let a;l(e.credit)?(a=e.credit,typeof a=="string"&&(a=new Et(a))):a=vfe,this._resource=i,this._imageryProvider=new ba({url:i,credit:a,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(mx.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}}});mx.prototype.getTileCredits=function(e,t,n){};mx.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};mx.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};mx._defaultCredit=vfe;var rk=mx;function DE(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??ce.MAX_VALUE,n=new Ji({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new _e;let i=e.credit;typeof i=="string"&&(i=new Et(i)),this._credit=i;let o=De.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(DE.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 tKe(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=tr.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return Pq(e,n,r);throw l(n)&&(n._hasError=!0),new ue(o)}async function Pq(e,t,n){try{return await id.loadImage(null,e)}catch(i){return tKe(e,i,t,n)}}DE.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await Pq(n);t=t??V.EMPTY_OBJECT;let o=new DE({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};DE.prototype.getTileCredits=function(e,t,n){};DE.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await Pq(this._resource,this);return this._image=o,tr.reportSuccess(this._errorEvent),o}return this._image};DE.prototype.pickFeatures=function(e,t,n,i,o){};var ak=DE;function nKe(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=iKe:e==="xml"?n=sKe:(e==="html"||e==="text")&&(n=Pfe)),this.callback=n}function iKe(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Zm;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let a=o.geometry.coordinates[0],s=o.geometry.coordinates[1];r.position=me.fromDegrees(a,s)}t.push(r)}return t}var Rq="http://www.mapinfo.com/mxp",oKe="http://www.esri.com/wms",rKe="http://www.opengis.net/wfs",aKe="http://www.opengis.net/gml";function sKe(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===Rq)return cKe(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===oKe)return lKe(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===rKe)return uKe(e);if(t.localName==="ServiceExceptionReport")throw new ue(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?fKe(e):dKe(e)}function cKe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Rq,"Feature");for(let o=0;o<i.length;++o){let r=i[o],a={},s=r.getElementsByTagNameNS(Rq,"Val");for(let u=0;u<s.length;++u){let f=s[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();a[h]=p}}let c=new Zm;c.data=r,c.properties=a,c.configureNameFromProperties(a),c.configureDescriptionFromProperties(a),t.push(c)}return t}function lKe(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let a=o[r];i={};let s=a.attributes;for(let c=0;c<s.length;++c){let u=s[c];i[u.name]=u.value}n.push(sk(a,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let a=0;a<r.length;++a){let s=r[a];i={};let c=s.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(sk(s,i))}}return n}function uKe(e){let t=[],i=e.documentElement.getElementsByTagNameNS(aKe,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],a={};Mq(r,a),t.push(sk(r,a))}return t}function fKe(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new ue("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let a=o[r];if(a.nodeType===Node.ELEMENT_NODE){let s={};Mq(a,s),t.push(sk(a,s))}}return t}function Mq(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()&&Mq(o,t)&&(t[o.localName]=o.textContent)}return n}function sk(e,t){let n=new Zm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function dKe(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Zm;return o.data=e,o.description=n.innerHTML,[o]}var hKe=/<body>\s*<\/body>/im,mKe=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,pKe=/<title>([\s\S]*)<\/title>/im;function Pfe(e){if(hKe.test(e)||mKe.test(e))return;let t,n=pKe.exec(e);n&&n.length>1&&(t=n[1]);let i=new Zm;return i.name=t,i.description=e,i.data=e,[i]}var tp=nKe;function dD(e){e=e??V.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(dD.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});dD.prototype.getFromCache=function(e,t,n,i){let o=Rfe(e,t,n),r,a=this._tileCache[this._currentIntervalIndex];if(l(a)&&l(a[o])){let s=a[o];r=s.promise.catch(function(c){throw i.state=s.request.state,c}),delete a[o]}return r};dD.prototype.checkApproachingInterval=function(e,t,n,i){let o=Rfe(e,t,n),r=this._tilesRequestedForInterval,a=Mfe(this),s={key:o,priorityFunction:i.priorityFunction};(!l(a)||!Nfe(this,s,a))&&r.push(s),r.length>=512&&r.splice(0,256)};dD.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let a=this._tileCache[o];for(let s in a)a.hasOwnProperty(s)&&a[s].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=Mfe(this);if(l(r)){let a=this._tilesRequestedForInterval,s=!0;for(;s&&a.length!==0;){let c=a.pop();s=Nfe(this,c,r),s||a.push(c)}}};function Rfe(e,t,n){return`${e}-${t}-${n}`}function AKe(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Mfe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let a,s=t.indexOf(i);if(s<0)return;let c=t.get(s);return r>0?(a=X.secondsDifference(c.stop,i),++s):(a=X.secondsDifference(c.start,i),--s),a/=r,s>=0&&a<=5?t.get(s):void 0}function Nfe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let a=t.key;if(l(r[a]))return!0;let s=AKe(a),c=new Br({throttle:!1,throttleByServer:!0,type:es.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(s.x,s.y,s.level,c,n);return l(u)?(r[a]={promise:u,request:c},!0):!1}var px=dD;var gKe=[3034,3035,3042,3043,3044],_Ke=[4471,4559];function Ah(e){if(e=e??V.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new de("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=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Ah.DefaultParameters,!0),n.setQueryParameters(Ah.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Lfe(e.parameters,e.toLowerCase)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Lfe(e.getFeatureInfoParameters,e.toLowerCase));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new px({clock:e.clock,times:e.times,requestImageFunction:function(a,s,c,u,f){return Ofe(i,a,s,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof mi?"EPSG:3857":"CRS:84");let a=o.crs.split(":");if(a[0]==="EPSG"&&a.length===2){let s=Number(a[1]);(s>=4e3&&s<5e3&&!_Ke.includes(s)||gKe.includes(s))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof mi?"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 Ji({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??Ah.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function Ofe(e,t,n,i,o,r){let a=l(r)?r.data:void 0,s=e._tileProvider;return l(a)&&s._resource.setQueryParameters(a),s.requestImage(t,n,i,o)}function yKe(e,t,n,i,o,r,a){let s=l(a)?a.data:void 0,c=e._tileProvider;return l(s)&&c._pickFeaturesResource.setQueryParameters(s),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Ah.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}}});Ah.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Ah.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,a;return l(r)&&(a=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Ofe(this,e,t,n,i,a)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Ah.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,a=l(r)?r.currentInterval:void 0;return yKe(this,e,t,n,i,o,a)};Ah.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Ah.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Ah.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new tp("json","application/json")),Object.freeze(new tp("xml","text/xml")),Object.freeze(new tp("text","text/html"))]);function Lfe(e,t=!0){if(t){let n={};for(let i in e)e.hasOwnProperty(i)&&(n[i.toLowerCase()]=e[i]);return n}return e}var ck=Ah;function $u(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,o=e.tileMatrixSetID,r=t.url,a=e.format??"image/jpeg",s=r.match(/{/g);if(!l(s)||s.length===1&&/{s}/.test(r)?(t.setQueryParameters($u.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues($u.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters($u.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Ffe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues($u.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(Ffe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=a,this._dimensions=e.dimensions,this._tilematrixset=o;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=o,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:a},!0),n.setQueryParameters({format:a},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:a}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new px({clock:e.clock,times:e.times,requestImageFunction:function(f,h,p,A,m){return Qfe(u,f,h,p,A,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new _e,this._tileProvider=new ba({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new za({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??$u.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:EKe(this)})}function Qfe(e,t,n,i,o,r){let a=e._tileProvider;return kfe(e,a._resource,r),a.requestImage(t,n,i,o)}function CKe(e,t,n,i,o,r,a){let s=e._tileProvider;return kfe(e,s._pickFeaturesResource,a),s.pickFeatures(t,n,i,o,r)}Object.defineProperties($u.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},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}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},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}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});$u.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};$u.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,a;return l(r)&&(a=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=Qfe(this,e,t,n,i,a)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};$u.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,a=l(r)?r.currentInterval:void 0;return CKe(this,e,t,n,i,o,a)};$u.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});$u.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});$u.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new tp("json","application/json")),Object.freeze(new tp("xml","text/xml")),Object.freeze(new tp("text","text/html"))]);function kfe(e,t,n){let i=e._dimensions,o=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(o)&&t.setTemplateValues(o);else{let r={};l(i)&&(r=Pt(r,i)),l(o)&&(r=Pt(r,o)),t.setQueryParameters(r)}}function EKe(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,o,r){return t(r)},tilematrix:function(n,i,o,r){return t(r)},TileRow:function(n,i,o){return o.toString()},tilerow:function(n,i,o){return o.toString()},TileCol:function(n,i,o){return i.toString()},tilecol:function(n,i,o){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function Ffe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var lk=$u;var Ax={};Ax.defaultApiKey=void 0;Ax.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});Ax.defaultStreetViewStaticApiKey=void 0;Ax.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});Ax.getDefaultCredit=function(){return new Et('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ss=Ax;var Ufe=/\/$/;function PA(e){e=e??V.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof _a?e.url:De.createIfNeeded(e.url??Ss.mapTilesApiEndpoint),n=t.getUrlComponent();Ufe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new Et(o)));let r=new ba({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(PA.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}}});PA.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=zfe(e),i=_a._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),a=r.options.url;return delete r.options.url,r.options={...r.options,...o},Nq(a,r,i)};PA.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Ss.mapTilesApiEndpoint,e.key=e.key??Ss.defaultApiKey;let t=e.overlayLayerType,n=await bKe(e);return new PA({...n,...e,credit:e.credit??Ss.getDefaultCredit()})};PA.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};PA.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};PA.prototype.pickFeatures=function(e,t,n,i,o){};PA.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(IKe(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],a=n[o];if(a){let s=new Et(a);r.push(s)}i.set(o,r)}return this._attributionsByLevel=i,i};async function IKe(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(V.EMPTY_OBJECT)}).fetchJson()).copyright}function zfe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function bKe(e){let{language:t,region:n,key:i,url:o}=e,r=zfe(e),a=o.url??o;Ufe.test(a)||(a+="/");let s=await De.post({url:`${a}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(s)}var uk=PA;var xKe=/\/$/;function gx(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof _a?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();xKe.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new Et(r)));let a=new ba({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});a._resource=n,this._imageryProvider=a,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(gx.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}}});gx.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};gx.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};gx.prototype.pickFeatures=function(e,t,n,i,o){};gx.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(TKe(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],a=n[o].join(",");if(a){let s=new Et(a);r.push(s)}i.set(o,r)}return this._attributionsByLevel=i,i};async function TKe(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(V.EMPTY_OBJECT)}).fetchJson()).copyrights}var fk=gx;var SKe=async(e,t,n)=>BE.fromUrl(new _a(t,n)),wKe=async(e,{options:t})=>G_.fromUrl(e,t),BKe=async(e,{options:t})=>Z2.fromUrl(e,t),DKe=async(e,{options:t})=>{let n=t.channel;return delete t.channel,ok.fromUrl(e,n,t)},vKe=async(e,{options:t})=>new rk({url:e,...t}),PKe=async(e,{options:t})=>ak.fromUrl(e,t),RKe=async(e,{options:t})=>BE.fromUrl(e,t),MKe=async(e,{options:t})=>new ba({url:e,...t}),NKe=async(e,{options:t})=>new ck({url:e,...t}),LKe=async(e,{options:t})=>new lk({url:e,...t}),Nq=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new _a(t,n),o=(r,a)=>{delete a.externalType,a.url=e;let{options:s}=a;r.setQueryParameters({session:s.session,key:s.key})};return i.refreshCallback=o,new uk({...t.options,url:i})},OKe=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new _a(t,n),o=(r,a)=>{delete a.externalType,a.url=e;let{options:s}=a;r.setQueryParameters({"subscription-key":s["subscription-key"]})};return i.refreshCallback=o,new fk({...t.options,url:i})},FKe={ARCGIS_MAPSERVER:wKe,BING:BKe,GOOGLE_EARTH:DKe,MAPBOX:vKe,SINGLE_TILE:PKe,TMS:RKe,URL_TEMPLATE:MKe,WMS:NKe,WMTS:LKe,GOOGLE_2D_MAPS:Nq,AZURE_MAPS:OKe,defaultFactoryCallback:SKe},hD=Object.freeze(FKe);function np(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new _e}Object.defineProperties(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){t=t??V.EMPTY_OBJECT;let n=_a._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=np._endpointCache[i];l(o)||(o=n.fetchJson(),np._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ue(`Cesium ion asset ${e} is not an imagery asset.`);let a=r.externalType,s=hD.defaultFactoryCallback;r=Ye(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(a)&&(s=hD[a],!l(s)))throw new ue(`Unrecognized Cesium ion imagery type: ${a}`);let u=await s(c,r,n),f=new np(t);return u.errorEvent.addEventListener(function(h){h.provider=f,f._errorEvent.raiseEvent(h)}),f._tileCredits=_a.getCreditsFromEndpoint(r,n),f._imageryProvider=u,f};np.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(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 du=np;var QKe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},V_=Object.freeze(QKe);function kKe(e){e=e??V.EMPTY_OBJECT;let t=e.style??V_.AERIAL;return du.fromAssetId(t)}var H_=kKe;function xa(){de.throwInstantiationError()}Object.defineProperties(xa.prototype,{errorEvent:{get:de.throwInstantiationError},credit:{get:de.throwInstantiationError},tilingScheme:{get:de.throwInstantiationError},hasWaterMask:{get:de.throwInstantiationError},hasVertexNormals:{get:de.throwInstantiationError},availability:{get:de.throwInstantiationError}});var Gfe=[];xa.getRegularGridIndices=function(e,t){let n=Gfe[e];l(n)||(Gfe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),jfe(e,t,i,0)),i};var Vfe=[];xa.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=Vfe[e];l(n)||(Vfe[e]=n=[]);let i=n[t];if(!l(i)){let o=xa.getRegularGridIndices(e,t),r=Wfe(e,t),a=r.westIndicesSouthToNorth,s=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:a,southIndicesEastToWest:s,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Hfe=[];xa.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Hfe[e];l(n)||(Hfe[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,a=e*2+t*2,s=Math.max(0,a-4)*6,c=o+a,u=r+s,f=Wfe(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,A=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,_=Ue.createTypedArray(c,u);jfe(e,t,_,0),xa.addSkirtIndices(h,p,A,m,o,_,r),i=n[t]={indices:_,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:A,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};xa.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};xa.getSkirtIndexCount=function(e){return(e-4)*2*3};xa.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};xa.addSkirtIndices=function(e,t,n,i,o,r,a){let s=o;a=dk(e,s,r,a),s+=e.length,a=dk(t,s,r,a),s+=t.length,a=dk(n,s,r,a),s+=n.length,dk(i,s,r,a)};xa.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,a){xa.addSkirtIndices(e,t,n,i,o,r,a);let s=xa.getSkirtVertexCount(e,t,n,i),c=xa.getSkirtIndexCount(s),u=a+c,f=e[0],h=i[0],p=n[0],A=t[0],m=o,_=m+e.length-1,y=_+1,C=y+t.length-1,E=C+1,I=E+n.length-1,x=I+1,S=x+i.length-1;r[u+0]=f,r[u+1]=m,r[u+2]=C,r[u+3]=A,r[u+4]=y,r[u+5]=I,r[u+6]=p,r[u+7]=E,r[u+8]=S,r[u+9]=h,r[u+10]=x,r[u+11]=_};function Wfe(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),a;for(a=0;a<e;++a)r[a]=a,i[a]=e*t-1-a;for(a=0;a<t;++a)o[a]=(a+1)*e-1,n[a]=(t-a-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function jfe(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let a=0;a<e-1;++a){let s=o,c=s+e,u=c+1,f=s+1;n[i++]=s,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++o}++o}}function dk(e,t,n,i){let o=e[0],r=e.length;for(let a=1;a<r;++a){let s=e[a];n[i++]=o,n[i++]=s,n[i++]=t,n[i++]=t,n[i++]=s,n[i++]=t+1,o=s,++t}return i}xa.heightmapTerrainQuality=.25;xa.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*xa.heightmapTerrainQuality/(t*n)};xa.prototype.requestTileGeometry=de.throwInstantiationError;xa.prototype.getLevelMaximumGeometricError=de.throwInstantiationError;xa.prototype.getTileDataAvailable=de.throwInstantiationError;xa.prototype.loadTileDataAvailability=de.throwInstantiationError;var Yo=xa;var hk=`uniform sampler2D u_texture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = texture(u_texture, v_textureCoordinates);
|
|
}
|
|
`;var mk=`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 UKe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},Hn=Object.freeze(UKe);function _x(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,a=n/2|0,s=i-1;this.parent=e.getImageryFromCache(r,a,s)}this.state=Hn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}_x.createPlaceholder=function(e){let t=new _x(e,0,0,0);return t.addReference(),t.state=Hn.PLACEHOLDER,t};_x.prototype.addReference=function(){++this.referenceCount};_x.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),fe(this),0):this.referenceCount};_x.prototype.processStateMachine=function(e,t,n){this.state===Hn.UNLOADED&&!n&&(this.state=Hn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Hn.RECEIVED&&(this.state=Hn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Hn.READY&&t&&!this.texture;(this.state===Hn.TEXTURE_LOADED||i)&&(this.state=Hn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var mD=_x;function Lq(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}Lq.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};Lq.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Hn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,a;for(;l(r)&&(r.state!==Hn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Hn.FAILED&&r.state!==Hn.INVALID&&(a=a||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===Hn.FAILED||i.state===Hn.INVALID?l(a)?(a.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var pD=Lq;function Ri(e,t){this._imageryProvider=e,this._readyEvent=new _e,this._errorEvent=new _e,t=t??V.EMPTY_OBJECT,e=e??V.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Ri.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ri.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ri.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ri.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ri.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ri.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ri.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ri.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ce.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new pD(mD.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??Ri.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD,this._marsOptions=t.marsOptions??{},this._initByMars3D&&this._initByMars3D(e,t)}Object.defineProperties(Ri.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ri.DEFAULT_BRIGHTNESS=1;Ri.DEFAULT_CONTRAST=1;Ri.DEFAULT_HUE=0;Ri.DEFAULT_SATURATION=1;Ri.DEFAULT_GAMMA=1;Ri.DEFAULT_SPLIT=Qr.NONE;Ri.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Ri.DEFAULT_MAGNIFICATION_FILTER=si.LINEAR;Ri.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ri.fromProviderAsync=function(e,t){let n=new Ri(void 0,t);return WKe(n,Promise.resolve(e)),n};Ri.fromWorldImagery=function(e){return e=e??V.EMPTY_OBJECT,Ri.fromProviderAsync(H_({style:e.style}),e)};Ri.prototype.isBaseLayer=function(){return this._isBaseLayer};Ri.prototype.isDestroyed=function(){return!1};Ri.prototype.destroy=function(){return fe(this)};var Kfe=new ce,Yfe=new ce,Oq=new ce,Xfe=new ce;Ri.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};Ri.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof mi&&e.rectangle.north<mi.MaximumLatitude&&e.rectangle.south>-mi.MaximumLatitude,a=ce.intersection(o.rectangle,this._rectangle,Kfe),s=ce.intersection(e.rectangle,a,Yfe);if(!l(s)){if(!this.isBaseLayer())return!1;let T=a,B=e.rectangle;s=Yfe,B.south>=T.north?s.north=s.south=T.north:B.north<=T.south?s.north=s.south=T.south:(s.south=Math.max(B.south,T.south),s.north=Math.min(B.north,T.north)),B.west>=T.east?s.west=s.east=T.east:B.east<=T.west?s.west=s.east=T.west:(s.west=Math.max(B.west,T.west),s.east=Math.min(B.east,T.east))}let c=0;s.south>0?c=s.south:s.north<0&&(c=s.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=VKe(this,f,c);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),l(o.minimumLevel)){let T=o.minimumLevel;h<T&&(h=T)}let A=o.tilingScheme,m=A.positionToTileXY(ce.northwest(s),h),_=A.positionToTileXY(ce.southeast(s),h),y=e.rectangle.width/512,C=e.rectangle.height/512,E=A.tileXYToRectangle(m.x,m.y,h);Math.abs(E.south-e.rectangle.north)<C&&m.y<_.y&&++m.y,Math.abs(E.east-e.rectangle.west)<y&&m.x<_.x&&++m.x;let I=A.tileXYToRectangle(_.x,_.y,h);Math.abs(I.north-e.rectangle.south)<C&&_.y>m.y&&--_.y,Math.abs(I.west-e.rectangle.east)<y&&_.x>m.x&&--_.x;let x=ce.clone(e.rectangle,Xfe),S=A.tileXYToRectangle(m.x,m.y,h),w=ce.intersection(S,a,Oq),v;r?(A.rectangleToNativeRectangle(x,x),A.rectangleToNativeRectangle(S,S),A.rectangleToNativeRectangle(w,w),A.rectangleToNativeRectangle(a,a),v=A.tileXYToNativeRectangle.bind(A),y=x.width/512,C=x.height/512):v=A.tileXYToRectangle.bind(A);let R,N=0,L=1,g;!this.isBaseLayer()&&Math.abs(w.west-x.west)>=y&&(N=Math.min(1,(w.west-x.west)/x.width)),!this.isBaseLayer()&&Math.abs(w.north-x.north)>=C&&(L=Math.max(0,(w.north-x.south)/x.height));let b=L;for(let T=m.x;T<=_.x;T++)if(R=N,S=v(T,m.y,h),w=ce.simpleIntersection(S,a,Oq),!!l(w)){N=Math.min(1,(w.east-x.west)/x.width),T===_.x&&(this.isBaseLayer()||Math.abs(w.east-x.east)<y)&&(N=1),L=b;for(let B=m.y;B<=_.y;B++){if(g=L,S=v(T,B,h),w=ce.simpleIntersection(S,a,Oq),!l(w))continue;L=Math.max(0,(w.south-x.south)/x.height),B===_.y&&(this.isBaseLayer()||Math.abs(w.south-x.south)<C)&&(L=0);let M=new ie(R,L,N,g),O=this.getImageryFromCache(T,B,h);i.imagery.splice(n,0,new pD(O,M,r)),++n}}return!0};Ri.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Kfe),i=c.rectangleToNativeRectangle(i,Xfe)}let o=i.width,r=i.height,a=o/n.width,s=r/n.height;return new ie(a*(i.west-n.west)/o,s*(i.south-n.south)/r,a,s)};Ri.prototype._requestImagery=function(e){if(l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel)return e.state=Hn.FAILED,e.request=void 0,!1;if(l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return e.state=Hn.FAILED,e.request=void 0,!1;let t=this._imageryProvider,n=this;function i(a){if(!l(a))return o();e.image=a,e.state=Hn.RECEIVED,e.request=void 0,tr.reportSuccess(n._requestImageError),n._marsOptions.onAddTileSuccess&&n._marsOptions.onAddTileSuccess(e)}function o(a){if(e.request.state===yi.CANCELLED){e.state=Hn.UNLOADED,e.request=void 0;return}e.state=Hn.FAILED,e.request=void 0;let s=`\u65E0\u6CD5\u83B7\u5F97\u56FE\u5757 x:${e.x},y: ${e.y},z:${e.level}. `;t._resource&&t._resource._last_url&&(s+=t._resource._last_url),n._requestImageError=tr.reportError(n._requestImageError,t,t.errorEvent,s,e.x,e.y,e.level,a),n._requestImageError.retry&&r(),n._marsOptions.onAddTileError&&n._marsOptions.onAddTileError(e)}function r(){let a=new Br({throttle:!1,throttleByServer:!0,type:es.IMAGERY});e.request=a,e.state=Hn.TRANSITIONING;let s=t.requestImage(e.x,e.y,e.level,a);if(!l(s)){e.state=Hn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),n._marsOptions.onAddTile&&n._marsOptions.onAddTile(e),s.then?s.then(function(c){i(c)}).catch(function(c){o(c)}):i(s)}r()};Ri.prototype._createTextureWebGL=function(e,t){let n=new jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new vt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new vt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Ke.RGBA:Ke.RGB,sampler:n})};Ri.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=Hn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Hn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof mi?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Hn.TEXTURE_LOADED};function qfe(e,t,n){return`${e}:${t}:${n}`}Ri.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===si.LINEAR&&!Ke.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let r=Nt.maximumTextureFilterAnisotropy,a=Math.min(r,this._maximumAnisotropy??r),s=qfe(n,i,a),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[s];l(u)||(u=c[s]=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:a})),t.generateMipmap(ih.NICEST),t.sampler=u}else{let r=qfe(n,i,0),a=e.cache.imageryLayerNonMipmapSamplers;l(a)||(a={},e.cache.imageryLayerNonMipmapSamplers=a);let s=a[r];l(s)||(s=a[r]=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=s}};Ri.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 qi)&&o.width/i.width>1e-5){let a=this;t.addReference();let s=new Vl({persists:!0,owner:this,preExecute:function(c){GKe(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,a._finalizeReprojectTexture(r,c),t.state=Hn.READY,t.releaseReference()},canceled:function(){t.state=Hn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(s)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Hn.READY};Ri.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};Ri.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ri.prototype.getImageryFromCache=function(e,t,n,i){let o=Jfe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new mD(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};Ri.prototype.removeImageryFromCache=function(e){this._marsOptions.onRemoveTile&&this._marsOptions.onRemoveTile(e);let t=Jfe(e.x,e.y,e.level);delete this._imageryCache[t]};function Jfe(e,t,n){return JSON.stringify([e,t,n])}var pk={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Q,texture:void 0},zKe=hn.supportsTypedArrays()?new Float32Array(128):void 0;function GKe(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let y=new Float32Array(256),C=0;for(let w=0;w<64;++w){let v=w/63;y[C++]=0,y[C++]=v,y[C++]=1,y[C++]=v}let E={position:0,webMercatorT:1},I=Yo.getRegularGridIndices(2,64),x=tt.createIndexBuffer({context:t,typedArray:I,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});o.vertexArray=new Vn({context:t,attributes:[{index:E.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:y,usage:Re.STATIC_DRAW}),componentsPerAttribute:2},{index:E.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Re.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:x});let S=new We({sources:[mk]});o.shaderProgram=$t.fromCache({context:t,vertexShaderSource:S,fragmentShaderSource:hk,attributeLocations:E}),o.sampler=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:si.LINEAR})}n.sampler=o.sampler;let r=n.width,a=n.height;pk.textureDimensions.x=r,pk.textureDimensions.y=a,pk.texture=n;let s=Math.sin(i.south),c=.5*Math.log((1+s)/(1-s));s=Math.sin(i.north);let f=1/(.5*Math.log((1+s)/(1-s))-c),h=new vt({context:t,width:r,height:a,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(r)&&D.isPowerOfTwo(a)&&h.generateMipmap(ih.NICEST);let p=i.south,A=i.north,m=zKe,_=0;for(let y=0;y<64;++y){let C=y/63,E=D.lerp(p,A,C);s=Math.sin(E);let x=(.5*Math.log((1+s)/(1-s))-c)*f;m[_++]=x,m[_++]=x}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=pk,e.vertexArray=o.vertexArray}function VKe(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,a=e._imageryProvider.tilingScheme.projection instanceof qi?1:Math.cos(n),s=o.rectangle,u=r.maximumRadius*s.width*a/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function HKe(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function WKe(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){HKe(e._errorEvent,i)}}var Ta=Ri;var Fq=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},Ak=Fq;var Qq=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},AD=Qq;var jKe=new ce,Zfe=new ce,YKe=new ce,qKe=new ce,KKe=new ce,XKe=new ce,kq=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),a=ce.intersection(o.rectangle,n.rectangle,jKe),s=o.tilingScheme,c=e._computeImageryRange(t,a,s,r),u=qKe;s.rectangleToNativeRectangle(t,u);let f=KKe;s.rectangleToNativeRectangle(a,f);let h=(A,m,_)=>{let y=s.tileXYToRectangle(A,m,_),C=ce.intersection(y,a,YKe);if(!l(C))return;let E=XKe;return s.rectangleToNativeRectangle(C,E),E};return e._computeImageryCoverages(n,c,r,u,h)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),a=i.positionToTileXY(ce.northwest(r),o),s=i.positionToTileXY(ce.southeast(r),o),c=new AD;c.minX=a.x,c.minY=a.y,c.maxX=s.x,c.maxY=s.y;let u=t.width/512,f=t.height/512,h=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(h.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(h.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ce),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ce.intersection(t,n,Zfe);return l(i)?i:e._clampRectangle(t,n,Zfe)}static _computeImageryCoverages(t,n,i,o,r){let a=[];for(let s=n.minX;s<=n.maxX;s++){let c=r(s,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=r(s,u,i);if(!l(f))continue;let h=e._localizeToCartesianRectangle(f,o,void 0),p=t.getImageryFromCache(s,u,i),A=new e(s,u,i,h,p);a.push(A)}}return a}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new AD);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},gD=kq;var Uq=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new et;et.fromRectangle(i,o,r);let a=e.createProjectedPositions(t,o),s=e.computeTexCoords(a,r);return e.createTypedArrayFromCartesians2(n,s)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=Sl.readAttributeAsTypedArray(t),r=t.type,a=zt.getNumberOfComponents(r),s=e.createIterableCartesian3FromTypedArray(o,a),c=e.transformCartesians3(s,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new d,o=t.length/n;return{[Symbol.iterator]:function*(){for(let a=0;a<o;a++)i.x=t[a*n+0],i.y=t[a*n+1],i.z=t[a*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ce);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;for(let s of t)i=Math.max(i,s.latitude),o=Math.min(o,s.latitude),r=Math.max(r,s.longitude),a=Math.min(a,s.longitude);return n.north=i,n.south=o,n.east=r,n.west=a,n}static transformCartesians3(t,n){let i=new d;return e.map(t,r=>(P.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new me;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new d;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new Q,o=1/n.width,r=1/n.height;return e.map(t,s=>{let c=(s.x-n.x)*o,u=(s.y-n.y)*r,f=Math.min(Math.max(c,0),1),h=Math.min(Math.max(u,0),1);return i.x=f,i.y=h,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:at.TEXCOORD,setIndex:0,componentDatatype:j.FLOAT,type:zt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new Q(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},yx=Uq;var zq=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},gk=zq;var Gq=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new P,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new de("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new de("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=t[o];this._deleteCoverages(r,a)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],a=tt.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Re.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!P.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,a=e._computePrimitivePositionTransform(t,n,void 0),s=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let h=c[f],p=yx.createCartographicPositions(o,a,h),A=yx.computeCartographicBoundingRectangle(p),m=new gk(p,r,A,h);s.push(m)}return P.clone(t.modelMatrix,this._mappedPositionsModelMatrix),s}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),a=e._getEllipsoid(r);n.add(a)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),a=e._getProjection(r);n.push(a)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],a=r.ellipsoid,s=this.mappedPositionsForEllipsoid(a),c=yx.createTextureCoordinatesAttributeForMappedPositions(s,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let a=0;a<r;a++){let s=o.get(a),c=this._computeCoverage(s);t.push(c),n.push(s)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return gD.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,a=1,s=n.width,c=r.width;n.height>n.width&&(s=n.height,c=r.height);let u=Math.log2(a*c/s);return gD._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let a=0;a<o;a++){let s=i[a],c=s.length;for(let u=0;u<c;u++){let h=s[u].imagery;h.state===Hn.READY||h.state===Hn.FAILED||h.state===Hn.INVALID||(r=!1,h.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new de("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new de(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new de("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),fe(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new P);let o=t.sceneGraph;return P.clone(P.IDENTITY,i),P.multiply(i,t.modelMatrix,i),P.multiply(i,o.components.transform,i),P.multiply(i,o.axisCorrectionMatrix,i),P.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=Tt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new de("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},Cx=Gq;var Vq=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},_k=Vq;var JKe=!1,ZKe=new ce,$Ke=new ce,Hq=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let a=o.imageryLayers,s=Cx._extractProjections(a),c=[...new Set(s)],u=e._computeIndexMapping(s,c),f=e._createImageryInputs(a,r,u);if(f.length===0)return;f.length>10&&(bt("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let h=[];for(let p=0;p<a.length;p++)h.push(a.get(p));e._processImageryInputs(h,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=zt.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,a=e._computeImageryFlags(t),s=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${s}`),e._addAttributes(r,o),e._defineUniforms(r,a),e._buildSampleAndBlendFunction(r,a),e._createMainImageryShader(r,i,a);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,he.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new Ak;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==Ta.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==Ta.DEFAULT_CONTRAST,n.hue|=o.hue!==Ta.DEFAULT_HUE,n.saturation|=o.saturation!==Ta.DEFAULT_SATURATION,n.gamma|=o.gamma!==Ta.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",he.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,he.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),JKe&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",he.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let s=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,s,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],a=r.imageryLayer,s=r.texture,c=r.textureCoordinateRectangle,u=r.textureTranslationAndScale;i.imageryTextures[o]=s,i.imageryTextureTranslationAndScale[o]=u,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=a.alpha,i.imageryTextureBrightness[o]=a.brightness,i.imageryTextureContrast[o]=a.contrast,i.imageryTextureHue[o]=a.hue,i.imageryTextureSaturation[o]=a.saturation,i.imageryTextureOneOverGamma[o]=1/a.gamma;let f=i.imageryTextureColorToAlpha[o];if(l(f)||(f=new ie,i.imageryTextureColorToAlpha[o]=f),l(a.colorToAlpha)&&a.colorToAlphaThreshold>0){let p=a.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=a.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let a=t.get(r);if(!a.show)continue;let s=i[r],u=n.mappedPositionsForImageryLayer(a).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(a);for(let h=0;h<f.length;h++){let p=f[h],A=e._createImageryInput(a,p,u,s);l(A)&&o.push(A)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Hn.FAILED||r.state===Hn.INVALID)return;let a=r.textureWebMercator;if(!l(a)&&(a=r.texture,!l(a))){r.state===Hn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let s=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,u=new ie(c.minX,c.minY,c.maxX,c.maxY);return new _k(t,a,s,u,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,ZKe),a=o.rectangleToNativeRectangle(i,$Ke);return e._computeTextureTranslationAndScaleFromNative(r,a)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,a=t.south-n.south,s=r*i,c=a*o,u=t.width*i,f=t.height*o;return new ie(s,c,u,f)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let a=t[r],s=n.indexOf(a);i.push(s)}return i}},yk=Hq;var Ck=`#ifdef USE_IBL_LIGHTING
|
|
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
|
|
{
|
|
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
|
|
// Environment maps were provided, use them for IBL
|
|
vec3 viewDirection = -normalize(position);
|
|
vec3 iblColor = textureIBL(viewDirection, normal, material);
|
|
return iblColor;
|
|
#endif
|
|
|
|
return vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
#ifdef USE_CLEARCOAT
|
|
vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
|
|
{
|
|
vec3 viewDirection = -normalize(position);
|
|
vec3 halfwayDirection = normalize(viewDirection + lightDirection);
|
|
vec3 normal = material.clearcoatNormal;
|
|
float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);
|
|
|
|
// clearcoatF0 = vec3(pow((ior - 1.0) / (ior + 1.0), 2.0)), but without KHR_materials_ior, ior is a constant 1.5.
|
|
vec3 f0 = vec3(0.04);
|
|
vec3 f90 = vec3(1.0);
|
|
// Note: clearcoat Fresnel computed with dot(n, v) instead of dot(v, h).
|
|
// This is to make it energy conserving with a simple layering function.
|
|
float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
|
|
vec3 F = fresnelSchlick2(f0, f90, NdotV);
|
|
|
|
// compute specular reflection from direct lighting
|
|
float roughness = material.clearcoatRoughness;
|
|
float alphaRoughness = roughness * roughness;
|
|
float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
|
|
vec3 directReflection = F * directStrength * NdotL;
|
|
vec3 color = lightColorHdr * directReflection;
|
|
|
|
#ifdef SPECULAR_IBL
|
|
// Find the direction in which to sample the environment map
|
|
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
|
|
vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
|
|
color += iblColor * material.occlusion;
|
|
#endif
|
|
|
|
float clearcoatFactor = material.clearcoatFactor;
|
|
vec3 clearcoatColor = color * clearcoatFactor;
|
|
|
|
// Dim base layer based on transmission loss through clearcoat
|
|
return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
|
|
}
|
|
#endif
|
|
|
|
#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
|
|
vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
|
|
{
|
|
#ifdef USE_CUSTOM_LIGHT_COLOR
|
|
vec3 lightColorHdr = model_lightColorHdr;
|
|
#else
|
|
vec3 lightColorHdr = czm_lightColorHdr;
|
|
#endif
|
|
|
|
vec3 viewDirection = -normalize(position);
|
|
vec3 normal = material.normalEC;
|
|
vec3 lightDirection = normalize(czm_lightDirectionEC);
|
|
|
|
vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
|
|
vec3 directColor = lightColorHdr * directLighting;
|
|
|
|
// Accumulate colors from base layer
|
|
vec3 color = directColor + material.emissive;
|
|
#ifdef USE_IBL_LIGHTING
|
|
color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
|
|
#endif
|
|
|
|
#ifdef USE_CLEARCOAT
|
|
color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
|
|
#endif
|
|
|
|
return color;
|
|
}
|
|
#endif
|
|
|
|
/**
|
|
* Compute the material color under the current lighting conditions.
|
|
* All other material properties are passed through so further stages
|
|
* have access to them.
|
|
*
|
|
* @param {czm_modelMaterial} material The material properties from {@MaterialStageFS}
|
|
* @param {ProcessedAttributes} attributes
|
|
*/
|
|
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
|
|
{
|
|
#ifdef LIGHTING_PBR
|
|
#ifdef HAS_NORMALS
|
|
vec3 color = computePbrLighting(material, attributes.positionEC);
|
|
#else
|
|
vec3 color = material.diffuse * material.occlusion + material.emissive;
|
|
#endif
|
|
// In HDR mode, the frame buffer is in linear color space. The
|
|
// post-processing stages (see PostProcessStageCollection) will handle
|
|
// tonemapping. However, if HDR is not enabled, we must tonemap else large
|
|
// values may be clamped to 1.0
|
|
#ifndef HDR
|
|
color = czm_pbrNeutralTonemapping(color);
|
|
#endif
|
|
#else // unlit
|
|
vec3 color = material.diffuse;
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
// The colors resulting from point cloud styles are adjusted differently.
|
|
color = czm_gammaCorrect(color);
|
|
#elif !defined(HDR)
|
|
// If HDR is not enabled, the frame buffer stores sRGB colors rather than
|
|
// linear colors so the linear value must be converted.
|
|
color = czm_linearToSrgb(color);
|
|
#endif
|
|
|
|
material.diffuse = color;
|
|
}
|
|
`;var eXe={UNLIT:0,PBR:1},RA=Object.freeze(eXe);var $fe={name:"LightingPipelineStage"};$fe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,he.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",he.FRAGMENT);let a=e.uniformMap;a.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===RA.PBR?o.addDefine("LIGHTING_PBR",void 0,he.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,he.FRAGMENT),o.addFragmentLines(Ck)};var Ek=$fe;var Ik=`// If the style color is white, it implies the feature has not been styled.
|
|
bool isDefaultStyleColor(vec3 color)
|
|
{
|
|
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
|
|
}
|
|
|
|
vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
|
|
{
|
|
vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
|
|
vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
|
|
return color;
|
|
}
|
|
|
|
#ifdef HAS_NORMAL_TEXTURE
|
|
vec2 getNormalTexCoords()
|
|
{
|
|
vec2 texCoord = TEXCOORD_NORMAL;
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
texCoord = czm_computeTextureTransform(texCoord, u_normalTextureTransform);
|
|
#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;
|
|
#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
|
|
#else
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
|
|
#endif
|
|
#else
|
|
normalSample = texture(u_normalTexture, normalTexCoords).rgb;
|
|
#endif
|
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
#ifdef HAS_NORMAL_TEXTURE_SCALE
|
|
normalSample.xy *= u_normalTextureScale;
|
|
#endif
|
|
vec3 normal = normalize(tbn * normalSample);
|
|
#else
|
|
vec3 normal = geometryNormal;
|
|
#endif
|
|
|
|
#ifdef HAS_DOUBLE_SIDED_MATERIAL
|
|
if (czm_backFacing()) {
|
|
tangent *= -1.0;
|
|
bitangent *= -1.0;
|
|
normal *= -1.0;
|
|
geometryNormal *= -1.0;
|
|
}
|
|
#endif
|
|
|
|
NormalInfo normalInfo;
|
|
normalInfo.tangent = tangent;
|
|
normalInfo.bitangent = bitangent;
|
|
normalInfo.normal = normal;
|
|
normalInfo.geometryNormal = geometryNormal;
|
|
|
|
return normalInfo;
|
|
}
|
|
#endif
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
|
|
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
|
|
{
|
|
vec2 normalTexCoords = getNormalTexCoords();
|
|
|
|
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
|
|
#ifdef HAS_BITANGENTS
|
|
vec3 t = attributes.tangentEC;
|
|
vec3 b = attributes.bitangentEC;
|
|
#else
|
|
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
|
|
t = normalize(t - geometryNormal * dot(geometryNormal, t));
|
|
vec3 b = normalize(cross(geometryNormal, t));
|
|
#endif
|
|
|
|
mat3 tbn = mat3(t, b, geometryNormal);
|
|
|
|
vec3 normalSample;
|
|
#if defined(HAS_NORMAL_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
|
|
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams, u_normalTextureTransform).rgb;
|
|
#else
|
|
normalSample = constantLodTextureLookup(u_normalTexture, u_normalTextureConstantLodParams).rgb;
|
|
#endif
|
|
#else
|
|
normalSample = texture(u_normalTexture, normalTexCoords).rgb;
|
|
#endif
|
|
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
#ifdef HAS_NORMAL_TEXTURE_SCALE
|
|
normalSample.xy *= u_normalTextureScale;
|
|
#endif
|
|
return normalize(tbn * normalSample);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
|
|
{
|
|
vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
|
|
normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
|
|
#endif
|
|
|
|
// If HAS_BITANGENTS is set, then HAS_TANGENTS is also set
|
|
#ifdef HAS_BITANGENTS
|
|
vec3 t = attributes.tangentEC;
|
|
vec3 b = attributes.bitangentEC;
|
|
#else
|
|
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
|
|
t = normalize(t - geometryNormal * dot(geometryNormal, t));
|
|
vec3 b = normalize(cross(geometryNormal, t));
|
|
#endif
|
|
|
|
mat3 tbn = mat3(t, b, geometryNormal);
|
|
vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
|
|
normalSample = 2.0 * normalSample - 1.0;
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
|
|
normalSample.xy *= u_clearcoatNormalTextureScale;
|
|
#endif
|
|
return normalize(tbn * normalSample);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_NORMALS
|
|
vec3 computeNormal(ProcessedAttributes attributes)
|
|
{
|
|
// Geometry normal. This is already normalized
|
|
vec3 normal = attributes.normalEC;
|
|
|
|
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
|
|
normal = getNormalFromTexture(attributes, normal);
|
|
#endif
|
|
|
|
#ifdef HAS_DOUBLE_SIDED_MATERIAL
|
|
if (czm_backFacing()) {
|
|
normal = -normal;
|
|
}
|
|
#endif
|
|
|
|
return normal;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_BASE_COLOR_TEXTURE
|
|
vec4 getBaseColorFromTexture()
|
|
{
|
|
vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
|
|
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
|
|
baseColorTexCoords = czm_computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
|
|
#endif
|
|
|
|
vec4 baseColorWithAlpha;
|
|
#if defined(HAS_BASE_COLOR_CONSTANT_LOD) && defined(HAS_CONSTANT_LOD)
|
|
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
|
|
baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams, u_baseColorTextureTransform));
|
|
#else
|
|
baseColorWithAlpha = czm_srgbToLinear(constantLodTextureLookup(u_baseColorTexture, u_baseColorTextureConstantLodParams));
|
|
#endif
|
|
#else
|
|
baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
|
|
#endif
|
|
|
|
#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 = czm_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 = czm_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 = czm_computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
|
|
#endif
|
|
|
|
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
|
|
#ifdef HAS_DIFFUSE_FACTOR
|
|
diffuse *= u_diffuseFactor;
|
|
#endif
|
|
#elif defined(HAS_DIFFUSE_FACTOR)
|
|
vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
|
|
#else
|
|
vec4 diffuse = vec4(1.0);
|
|
#endif
|
|
|
|
material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
|
|
// the specular glossiness extension's alpha overrides anything set
|
|
// by the base material.
|
|
material.alpha = diffuse.a;
|
|
|
|
material.specular = specular;
|
|
|
|
// glossiness is the opposite of roughness, but easier for artists to use.
|
|
material.roughness = 1.0 - glossiness;
|
|
}
|
|
#elif defined(LIGHTING_PBR)
|
|
float setMetallicRoughness(inout czm_modelMaterial material)
|
|
{
|
|
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
|
|
vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
|
|
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
|
|
metallicRoughnessTexCoords = czm_computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
|
|
#endif
|
|
|
|
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
|
|
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
|
|
float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
|
|
#ifdef HAS_METALLIC_FACTOR
|
|
metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
|
|
#endif
|
|
|
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
|
|
#endif
|
|
#else
|
|
#ifdef HAS_METALLIC_FACTOR
|
|
float metalness = clamp(u_metallicFactor, 0.0, 1.0);
|
|
#else
|
|
float metalness = 1.0;
|
|
#endif
|
|
|
|
#ifdef HAS_ROUGHNESS_FACTOR
|
|
float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
|
|
#else
|
|
float roughness = 1.0;
|
|
#endif
|
|
#endif
|
|
|
|
// dielectrics use f0 = 0.04, metals use albedo as f0
|
|
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
|
|
vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
|
|
|
|
material.specular = f0;
|
|
|
|
// diffuse only applies to dielectrics.
|
|
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
|
|
|
|
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
material.roughness = roughness;
|
|
|
|
return metalness;
|
|
}
|
|
#ifdef USE_SPECULAR
|
|
void setSpecular(inout czm_modelMaterial material, in float metalness)
|
|
{
|
|
#ifdef HAS_SPECULAR_TEXTURE
|
|
vec2 specularTexCoords = TEXCOORD_SPECULAR;
|
|
#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
|
|
specularTexCoords = czm_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 = czm_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 = czm_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 = czm_computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
|
|
#endif
|
|
float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
|
|
#ifdef HAS_CLEARCOAT_FACTOR
|
|
clearcoatFactor *= u_clearcoatFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_CLEARCOAT_FACTOR
|
|
float clearcoatFactor = u_clearcoatFactor;
|
|
#else
|
|
// PERFORMANCE_IDEA: this case should turn the whole extension off
|
|
float clearcoatFactor = 0.0;
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
|
|
vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
|
|
clearcoatRoughnessTexCoords = czm_computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
|
|
#endif
|
|
float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
|
|
clearcoatRoughness *= u_clearcoatRoughnessFactor;
|
|
#endif
|
|
#else
|
|
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
|
|
float clearcoatRoughness = u_clearcoatRoughnessFactor;
|
|
#else
|
|
float clearcoatRoughness = 0.0;
|
|
#endif
|
|
#endif
|
|
|
|
material.clearcoatFactor = clearcoatFactor;
|
|
// This is perceptual roughness. The square of this value is used for direct lighting
|
|
material.clearcoatRoughness = clearcoatRoughness;
|
|
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
|
|
material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
|
|
#else
|
|
material.clearcoatNormal = attributes.normalEC;
|
|
#endif
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
|
|
{
|
|
#ifdef USE_ANISOTROPY
|
|
NormalInfo normalInfo = getNormalInfo(attributes);
|
|
material.normalEC = normalInfo.normal;
|
|
#elif defined(HAS_NORMALS)
|
|
material.normalEC = computeNormal(attributes);
|
|
#endif
|
|
|
|
vec4 baseColorWithAlpha = vec4(1.0);
|
|
// Regardless of whether we use PBR, set a base color
|
|
#ifdef HAS_BASE_COLOR_TEXTURE
|
|
baseColorWithAlpha = getBaseColorFromTexture();
|
|
#elif defined(HAS_BASE_COLOR_FACTOR)
|
|
baseColorWithAlpha = u_baseColorFactor;
|
|
#endif
|
|
|
|
#ifdef HAS_IMAGERY
|
|
baseColorWithAlpha = blendBaseColorWithImagery(baseColorWithAlpha);
|
|
#endif // HAS_IMAGERY
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
baseColorWithAlpha = v_pointCloudColor;
|
|
#elif defined(HAS_COLOR_0)
|
|
vec4 color = attributes.color_0;
|
|
// .pnts files store colors in the sRGB color space
|
|
#ifdef HAS_SRGB_COLOR
|
|
color = czm_srgbToLinear(color);
|
|
#endif
|
|
baseColorWithAlpha *= color;
|
|
#endif
|
|
|
|
#ifdef USE_CPU_STYLING
|
|
baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
|
|
#endif
|
|
material.baseColor = baseColorWithAlpha;
|
|
material.diffuse = baseColorWithAlpha.rgb;
|
|
material.alpha = baseColorWithAlpha.a;
|
|
|
|
#ifdef HAS_OCCLUSION_TEXTURE
|
|
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
|
|
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
|
|
occlusionTexCoords = czm_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 bk=`#ifdef HAS_CONSTANT_LOD
|
|
// Extract model scale to compensate for minimumPixelSize scaling
|
|
float modelScaleX = length(czm_model[0].xyz);
|
|
float modelScaleY = length(czm_model[1].xyz);
|
|
float modelScaleZ = length(czm_model[2].xyz);
|
|
float modelScale = (modelScaleX + modelScaleY + modelScaleZ) / 3.0;
|
|
|
|
// Transform model position through ENU but as direction only (w=0) to avoid position-dependent rotation
|
|
vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xyz;
|
|
v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale;
|
|
v_constantLodUvCustom.z = u_constantLodDistance / modelScale;
|
|
#endif`;var xk=`#ifdef HAS_CONSTANT_LOD
|
|
|
|
vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) {
|
|
bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
|
|
bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
|
|
bool atClampBoundary = atMaxClamp || atMinClamp;
|
|
|
|
float effectiveDistance = atMaxClamp ? constantLodParams.y :
|
|
(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
|
|
|
|
float logDepth = log2(effectiveDistance);
|
|
logDepth = clamp(logDepth, -10.0, 20.0);
|
|
|
|
float f = fract(logDepth);
|
|
float p = floor(logDepth);
|
|
|
|
if (atClampBoundary) {
|
|
float clampedP = ceil(logDepth);
|
|
vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
|
|
return texture(textureSampler, tc);
|
|
}
|
|
|
|
vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
|
|
vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
|
|
return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
|
|
}
|
|
|
|
vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams, mat3 textureTransform) {
|
|
bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y;
|
|
bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x;
|
|
bool atClampBoundary = atMaxClamp || atMinClamp;
|
|
|
|
float effectiveDistance = atMaxClamp ? constantLodParams.y :
|
|
(atMinClamp ? constantLodParams.x : v_constantLodUvCustom.z);
|
|
|
|
float logDepth = log2(effectiveDistance);
|
|
logDepth = clamp(logDepth, -10.0, 20.0);
|
|
|
|
float f = fract(logDepth);
|
|
float p = floor(logDepth);
|
|
|
|
if (atClampBoundary) {
|
|
float clampedP = ceil(logDepth);
|
|
vec2 tc = v_constantLodUvCustom.xy / pow(2.0, clampedP) * constantLodParams.z;
|
|
// Apply texture transform to the final texture coordinates
|
|
tc = czm_computeTextureTransform(tc, textureTransform);
|
|
return texture(textureSampler, tc);
|
|
}
|
|
|
|
vec2 tc1 = v_constantLodUvCustom.xy / pow(2.0, p) * constantLodParams.z;
|
|
vec2 tc2 = v_constantLodUvCustom.xy / pow(2.0, p + 1.0) * constantLodParams.z;
|
|
|
|
// Apply texture transform to both LOD texture coordinates before mixing
|
|
tc1 = czm_computeTextureTransform(tc1, textureTransform);
|
|
tc2 = czm_computeTextureTransform(tc2, textureTransform);
|
|
|
|
return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f);
|
|
}
|
|
|
|
#endif
|
|
`;var{Material:tXe,MetallicRoughness:Wq,SpecularGlossiness:jq,Specular:ede,Clearcoat:tde}=bn,nde={name:"MaterialPipelineStage",_processTexture:hu,_processTextureTransform:ide};nde.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:a}=e;l(r.u_constantLodDistance)||(r.u_constantLodDistance=function(){let C=o.boundingSphere,E=n.camera;if(l(C)&&l(E)){let I=d.distance(E.positionWC,C.center);return Math.max(I,.1)}return 1});let s=l(o.classificationType),c=s,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;rXe(i,r,a,u,f,h,c,e),l(i.specularGlossiness)?aXe(i.specularGlossiness,r,a,u,c,e):(l(i.specular)&&Tt.supportedExtensions.KHR_materials_specular&&sXe(i.specular,r,a,u,c),l(i.anisotropy)&&Tt.supportedExtensions.KHR_materials_anisotropy&&lXe(i.anisotropy,r,a,u,c),l(i.clearcoat)&&Tt.supportedExtensions.KHR_materials_clearcoat&&uXe(i.clearcoat,r,a,u,c),fXe(i.metallicRoughness,r,a,u,c,e));let p=Tt.getAttributeBySemantic(t,at.NORMAL),A=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading,m=e.lightingOptions;i.unlit||!p||s||A?m.lightingModel=RA.UNLIT:m.lightingModel=RA.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let y=e.alphaOptions;i.alphaMode===bA.BLEND?y.pass=Be.TRANSLUCENT:i.alphaMode===bA.MASK&&(y.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(a.addDefine("HAS_POINT_DIAMETER",void 0,he.BOTH),a.addUniform("float","u_pointDiameter",he.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&iXe(i.lineStyle,t,n,r,a),a.addFragmentLines(Ik),i.doubleSided&&a.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,he.BOTH)};function nXe(e,t,n,i,o,r){let a=n.constantLod;if(!l(a)||!l(r))return;let s=`HAS_${o}_CONSTANT_LOD`;if(e.addDefine(s,void 0,he.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,he.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",he.VERTEX),e.addUniform("float","u_constantLodDistance",he.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",he.VERTEX),e.addFragmentLines(xk);let u=bk.split(`
|
|
`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,he.FRAGMENT),t[c]=function(){return new d(a.minClampDistance,a.maxClampDistance,a.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return a.offset};let u=P.clone(P.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let h=r.model.boundingSphere;if(l(h)){let p=h.center,A=At.eastNorthUpToFixedFrame(p);P.inverse(A,u),f=!0}}return f?u:P.IDENTITY}}}function iXe(e,t,n,i,o){let{width:r,pattern:a}=e;l(r)&&(o.addUniform("float","u_lineWidth",he.VERTEX),i.u_lineWidth=function(){return r*n.pixelRatio}),l(a)&&(o.addDefine("HAS_LINE_PATTERN",void 0,he.BOTH),o.addUniform("float","u_linePattern",he.FRAGMENT),o.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return a});let s=Tt.getAttributeBySemantic(t,at.CUMULATIVE_DISTANCE);if(l(a)&&l(s)&&(t.primitiveType===Pe.LINES||t.primitiveType===Pe.TRIANGLE_STRIP)){o.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,he.VERTEX),s.normalized&&o.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,he.VERTEX),o.addUniform("float","u_cumulativeDistanceMax",he.VERTEX),o.addUniform("float","u_pixelsPerWorld",he.VERTEX);let c=l(s.max)?s.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,h=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(h=n.context.drawingBufferWidth/p),h};let u=Tt.getAttributeInfo(s).variableName;o.addVertexLines(`
|
|
#ifdef HAS_LINE_CUMULATIVE_DISTANCE
|
|
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
{
|
|
float cumDist = attributes.${u};
|
|
#ifdef LINE_CUM_DIST_NORMALIZED
|
|
cumDist *= u_cumulativeDistanceMax;
|
|
#endif
|
|
const float textureCoordinateBase = 8192.0;
|
|
v_lineCoord = textureCoordinateBase + cumDist * u_pixelsPerWorld;
|
|
}
|
|
#endif
|
|
`)}else l(a)&&o.addVertexLines(`
|
|
#ifdef HAS_LINE_PATTERN
|
|
void lineStyleStageVS(in ProcessedAttributes attributes)
|
|
{
|
|
vec4 posClip = gl_Position;
|
|
vec2 screenPos = ((posClip.xy / posClip.w) * 0.5 + 0.5) * czm_viewport.zw;
|
|
|
|
const float textureCoordinateBase = 8192.0;
|
|
if (czm_viewport.z > czm_viewport.w) {
|
|
v_lineCoord = textureCoordinateBase + screenPos.x;
|
|
} else {
|
|
v_lineCoord = textureCoordinateBase + screenPos.y;
|
|
}
|
|
}
|
|
#endif
|
|
`)}function ide(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,he.FRAGMENT);let a=`${i}Transform`;e.addUniform("mat3",a,he.FRAGMENT),t[a]=function(){return n.transform}}function oXe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,he.FRAGMENT);let a=`${i}Scale`;e.addUniform("float",a,he.FRAGMENT),t[a]=function(){return n.scale}}function hu(e,t,n,i,o,r,a){e.addUniform("sampler2D",i,he.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,he.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${o}`;e.addDefine(f,u,he.FRAGMENT);let h=n.transform;l(h)&&!J.equals(h,J.IDENTITY)&&ide(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&oXe(e,t,n,i,o),nXe(e,t,n,i,o,a)}function rXe(e,t,n,i,o,r,a,s){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:h}=e;l(c)&&!d.equals(c,tXe.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",he.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,he.FRAGMENT),l(u)&&!a&&hu(n,t,u,"u_emissiveTexture","EMISSIVE",r));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!a){let A=f;l(f.constantLod)&&l(p)&&(A=Object.create(Object.getPrototypeOf(f)),Object.assign(A,f),A.constantLod=p),hu(n,t,A,"u_normalTexture","NORMAL",o,s)}l(h)&&!a&&hu(n,t,h,"u_occlusionTexture","OCCLUSION",i)}function aXe(e,t,n,i,o,r){let{diffuseTexture:a,diffuseFactor:s,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,he.FRAGMENT),l(a)&&!o&&hu(n,t,a,"u_diffuseTexture","DIFFUSE",i,r),l(s)&&!ie.equals(s,jq.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",he.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,he.FRAGMENT)),l(c)&&!o&&hu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!d.equals(u,jq.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",he.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(f)&&f!==jq.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",he.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,he.FRAGMENT))}function sXe(e,t,n,i,o){let{specularTexture:r,specularFactor:a,specularColorTexture:s,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,he.FRAGMENT),l(r)&&!o&&hu(n,t,r,"u_specularTexture","SPECULAR",i),l(a)&&a!==ede.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",he.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,he.FRAGMENT)),l(s)&&!o&&hu(n,t,s,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!d.equals(c,ede.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",he.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,he.FRAGMENT))}var cXe=new d;function lXe(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:a,anisotropyTexture:s}=e;n.addDefine("USE_ANISOTROPY",void 0,he.FRAGMENT),l(s)&&!o&&hu(n,t,s,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(a),u=Math.sin(a);n.addUniform("vec3","u_anisotropy",he.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(c,u,r,cXe)}}function uXe(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:a,clearcoatRoughnessFactor:s,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,he.FRAGMENT),l(r)&&r!==tde.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",he.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,he.FRAGMENT)),l(a)&&!o&&hu(n,t,a,"u_clearcoatTexture","CLEARCOAT",i),l(s)&&r!==tde.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",he.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,he.FRAGMENT)),l(c)&&!o&&hu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!o&&hu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function fXe(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,he.FRAGMENT);let a=e.baseColorTexture;l(a)&&!o&&hu(n,t,a,"u_baseColorTexture","BASE_COLOR",i,r);let s=e.baseColorFactor;l(s)&&!ie.equals(s,Wq.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",he.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,he.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!o&&hu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==Wq.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",he.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,he.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==Wq.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",he.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,he.FRAGMENT))}var Tk=nde;var wl={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"};wl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(wl.METADATA_PICKING_VALUE_TYPE,"float",he.FRAGMENT),i.addDefine(wl.METADATA_PICKING_VALUE_STRING,"0.0",he.FRAGMENT),i.addDefine(wl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",he.FRAGMENT),i.addDefine(wl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",he.FRAGMENT),i.addDefine(wl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",he.FRAGMENT),i.addDefine(wl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",he.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",he.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${wl.METADATA_PICKING_VALUE_TYPE} value = ${wl.METADATA_PICKING_VALUE_TYPE}(${wl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${wl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${wl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${wl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${wl.METADATA_PICKING_VALUE_COMPONENT_W};`],he.FRAGMENT)};var rd=wl;var Sk=`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 gc={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)"};gc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,he.VERTEX),gXe(n);let i=t.morphTargets.length;for(let s=0;s<i;s++){let c=t.morphTargets[s].attributes,u=c.length;for(let f=0;f<u;f++){let h=c[f],p=h.semantic;p!==at.POSITION&&p!==at.NORMAL&&p!==at.TANGENT||(hXe(e,h,e.attributeIndex,s),e.attributeIndex++)}}_Xe(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,he.VERTEX),n.addVertexLines(Sk);let a={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Pt(a,e.uniformMap)};var dXe={attributeString:void 0,functionId:void 0};function hXe(e,t,n,i){let o=e.shaderBuilder;mXe(e,t,n);let r=pXe(t,dXe);AXe(o,r,i)}function mXe(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:zt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function pXe(e,t){switch(e.semantic){case at.POSITION:t.attributeString="Position",t.functionId=gc.FUNCTION_ID_GET_MORPHED_POSITION;break;case at.NORMAL:t.attributeString="Normal",t.functionId=gc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case at.TANGENT:t.attributeString="Tangent",t.functionId=gc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function AXe(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 gXe(e){e.addFunction(gc.FUNCTION_ID_GET_MORPHED_POSITION,gc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,he.VERTEX),e.addFunctionLines(gc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(gc.FUNCTION_ID_GET_MORPHED_NORMAL,gc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,he.VERTEX),e.addFunctionLines(gc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(gc.FUNCTION_ID_GET_MORPHED_TANGENT,gc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,he.VERTEX),e.addFunctionLines(gc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function _Xe(e){e.addFunctionLines(gc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(gc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(gc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var wk=gc;var ode={name:"PickingPipelineStage"};ode.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,a=e.model,s=o.node.instances;if(e.hasPropertyTable)yXe(e,t,s,i);else if(l(s))CXe(e,i);else{let c=rde(e),u=i.createPickId(c);a._pipelineResources.push(u),a._pickIds.push(u),r.addUniform("vec4","czm_pickColor",he.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function rde(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Vr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function yXe(e,t,n){let i=e.model,o,r,a=i.featureIdLabel,s=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Tt.getFeatureIdsByLabel(n.featureIds,s),o=r.propertyTableId):(r=Tt.getFeatureIdsByLabel(t.featureIds,a),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",he.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function CXe(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,a=r._pipelineResources;for(let h=0;h<n;h++){let p=rde(e,h),A=t.createPickId(p);a.push(A),i[h]=A;let m=A.color;o[h*4+0]=U.floatToByte(m.red),o[h*4+1]=U.floatToByte(m.green),o[h*4+2]=U.floatToByte(m.blue),o[h*4+3]=U.floatToByte(m.alpha)}r._pickIds=i;let s=tt.createVertexBuffer({context:t,typedArray:o,usage:Re.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.statistics.addBuffer(s,!1),a.push(s);let u={index:e.attributeIndex++,vertexBuffer:s,componentsPerAttribute:4,componentDatatype:j.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,he.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var Bk=ode;var EXe={ADD:0,REPLACE:1},Cr=Object.freeze(EXe);var Dk=`float getPointSizeFromAttenuation(vec3 positionEC) {
|
|
// Variables are packed into a single vector to minimize gl.uniformXXX() calls
|
|
float pointSize = model_pointCloudParameters.x;
|
|
float geometricError = model_pointCloudParameters.y;
|
|
float depthMultiplier = model_pointCloudParameters.z;
|
|
|
|
float depth = -positionEC.z;
|
|
return min((geometricError / depth) * depthMultiplier, pointSize);
|
|
}
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
float tiles3d_tileset_time = model_pointCloudParameters.w;
|
|
return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
float tiles3d_tileset_time = model_pointCloudParameters.w;
|
|
return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
|
|
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
float tiles3d_tileset_time = model_pointCloudParameters.w;
|
|
return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
|
|
}
|
|
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
|
|
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
|
|
return getPointSizeFromAttenuation(v_positionEC);
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
|
|
float pointCloudBackFaceCullingStage() {
|
|
#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
|
|
// This needs to be computed in eye coordinates so we can't use attributes.normalMC
|
|
return step(-v_normalEC.z, 0.0);
|
|
#else
|
|
return 1.0;
|
|
#endif
|
|
}
|
|
#endif
|
|
`;var IXe=new ie,sde={name:"PointCloudStylingPipelineStage"};sde.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,a=o.structuralMetadata,s=l(a)?a.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!l(s)&&c;if(l(r)&&!u){let _=SXe(s),y=wXe(r,_);BXe(i,y);let E=DXe(y).indexOf("normalMC")>=0,I=Tt.getAttributeBySemantic(t,at.NORMAL);if(E&&!I)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,he.VERTEX),y.styleTranslucent&&(e.alphaOptions.pass=Be.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,he.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,he.VERTEX);let h,p,A;Vr.is3DTiles(o.type)&&(p=!0,h=o.content,A=h.tile.refine===Cr.ADD),i.addUniform("vec4","model_pointCloudParameters",he.VERTEX),i.addVertexLines(Dk);let m=e.uniformMap;m.model_pointCloudParameters=function(){let _=IXe,y=1;p&&(y=A?5:h.tileset.memoryAdjustedScreenSpaceError),_.x=f.maximumAttenuation??y,_.x*=n.pixelRatio;let C=bXe(e,t,f,h);_.y=C*f.geometricErrorScale;let E=n.context,I=n.camera.frustum,x;return n.mode===oe.SCENE2D||I instanceof An?x=Number.POSITIVE_INFINITY:x=E.drawingBufferHeight/n.camera.frustum.sseDenominator,_.z=x,p&&(_.w=h.tileset.timeSinceLoad),_}};var ade=new d;function bXe(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let o=Tt.getAttributeBySemantic(t,at.POSITION),r=o.count,a=e.runtimeNode.transform,s=d.subtract(o.max,o.min,ade);s=P.multiplyByPointAsVector(a,s,ade);let c=s.x*s.y*s.z;return D.cbrt(c/r)}var xXe={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},TXe={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function SXe(e){let t=Ye(TXe);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var Yq="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function wXe(e,t){let n=xXe,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Yq})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Yq})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Yq})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function BXe(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,he.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,he.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,he.VERTEX),e.addVertexLines(o))}function qq(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 DXe(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&qq(t,o),l(n)&&qq(n,o),l(i)&&qq(i,o),o}var vk=sde;var Pk=`void primitiveOutlineStage() {
|
|
v_outlineCoordinates = a_outlineCoordinates;
|
|
}
|
|
`;var Rk=`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 cde={name:"PrimitiveOutlinePipelineStage"};cde.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,he.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,a={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:zt.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(a),i.addUniform("sampler2D","model_outlineTexture",he.FRAGMENT);let s=Kb.createTexture(n.context);o.model_outlineTexture=function(){return s};let c=e.model;i.addUniform("vec4","model_outlineColor",he.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",he.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(Pk),i.addFragmentLines(Rk)};var Mk=cde;var lde={name:"PrimitiveStatisticsPipelineStage",_countGeometry:ude,_count2DPositions:fde,_countMorphTargetAttributes:dde,_countMaterialTextures:hde,_countFeatureIdTextures:mde,_countBinaryMetadata:pde};lde.process=function(e,t,n){let i=e.model,o=i.statistics;ude(o,t),fde(o,e.runtimePrimitive),dde(o,t),hde(o,t.material),mde(o,t.featureIds),pde(o,i)};function ude(e,t){let n=l(t.indices)?t.indices.count:Tt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Pe.POINTS?e.pointsLength+=n:Pe.isTriangles(i)&&(e.trianglesLength+=vXe(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let u=o[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let a=t.outlineCoordinates;l(a)&&l(a.buffer)&&e.addBuffer(a.buffer,!1);let s=t.indices;if(l(s)&&l(s.buffer)){let c=l(s.typedArray);e.addBuffer(s.buffer,c)}}function vXe(e,t){switch(e){case Pe.TRIANGLES:return t/3;case Pe.TRIANGLE_STRIP:case Pe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function fde(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function dde(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let a=n[r].attributes,s=a.length;for(let c=0;c<s;c++){let u=a[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function hde(e,t){let n=PXe(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function PXe(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function mde(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof bn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function pde(e,t){let n=t.structuralMetadata;l(n)&&(RXe(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let a=i[r];e.addBatchTexture(a.batchTexture)}}function RXe(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let a=n[o].properties;for(let s in a)if(a.hasOwnProperty(s)){let u=a[s].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var Nk=lde;var MXe=new P,NXe=new P,Ade={name:"SceneMode2DPipelineStage"};Ade.process=function(e,t,n){let i=Tt.getAttributeBySemantic(t,at.POSITION),o=e.shaderBuilder,r=e.model,a=r.sceneGraph.computedModelMatrix,s=e.runtimeNode.computedTransform,c=P.multiplyTransformation(a,s,MXe),u=FXe(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(l(h))return;if(l(i.typedArray)){let _=UXe(i,c,u,n);f.positionBuffer2D=_,r._modelResources.push(_),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,he.VERTEX),o.addUniform("mat4","u_modelView2D",he.VERTEX);let p=P.fromTranslation(u.center,new P),A=n.context,m={u_modelView2D:function(){return P.multiplyTransformation(A.uniformState.view,p,NXe)}};e.uniformMap=Pt(m,e.uniformMap)};var LXe=new d,OXe=new d;function FXe(e,t,n){let i=P.multiplyByPoint(t,e.positionMin,LXe),o=co.computeActualEllipsoidPosition(n,i,i),r=P.multiplyByPoint(t,e.positionMax,OXe),a=co.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,a,new le)}var gde=new d;function QXe(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let a=0;a<n;a+=3){let s=d.fromArray(e,a,gde),c=d.multiplyComponents(s,r,s),u=d.add(c,o,c);i[a]=u.x,i[a+1]=u.y,i[a+2]=u.z}return i}function kXe(e,t,n,i){let o;l(e.quantization)?o=QXe(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,a=o.length,s=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<a;c+=s){let u=d.fromArray(o,c,gde);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=P.multiplyByPoint(t,u,u),h=co.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function UXe(e,t,n,i){let o=Ye(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,a=kXe(e,t,r,o),s=tt.createVertexBuffer({context:i.context,typedArray:a,usage:Re.STATIC_DRAW});return s.vertexArrayDestroyable=!1,s}var Lk=Ade;var Ok=`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 vE={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};vE.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,he.VERTEX),GXe(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,he.VERTEX),n.addVertexLines(Ok);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Pt(r,e.uniformMap)};function zXe(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===at.JOINTS||r.semantic===at.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function GXe(e,t){e.addFunction(vE.FUNCTION_ID_GET_SKINNING_MATRIX,vE.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,he.VERTEX),e.addFunctionLines(vE.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],a=zXe(t);for(i=0;i<=a;i++)for(o=0;o<=3;o++){let c=r[o],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(vE.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(vE.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var Fk=vE;var Qk=`void verticalExaggerationStage(
|
|
inout ProcessedAttributes attributes
|
|
) {
|
|
// Compute the distance from the camera to the local center of curvature.
|
|
vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
|
|
vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
|
|
// Curvature = 1 / radius of curvature.
|
|
float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
|
|
float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
|
|
|
|
// Compute the approximate ellipsoid normal at the vertex position.
|
|
// Uses a circular approximation for the Earth curvature along the geodesic.
|
|
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
|
|
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
|
|
vec3 vertexNormal = normalize(centerToVertex);
|
|
|
|
// Estimate the (sine of the) angle between the camera direction and the vertex normal
|
|
float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
|
|
float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
|
|
float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
|
|
bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
|
|
|
|
// Approximate the change in height above the ellipsoid, from camera to vertex position.
|
|
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
|
|
float smallAngleVersine = 0.5 * sinTheta * sinTheta;
|
|
float versine = isSmallAngle ? smallAngleVersine : exactVersine;
|
|
float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
|
|
float vertexHeight = czm_eyeHeight + dHeight;
|
|
|
|
// Transform the approximate vertex normal to model coordinates.
|
|
vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
|
|
vertexNormalMC = normalize(vertexNormalMC);
|
|
|
|
// Compute the exaggeration and apply it along the approximate vertex normal.
|
|
float stretch = u_verticalExaggerationAndRelativeHeight.x;
|
|
float shift = u_verticalExaggerationAndRelativeHeight.y;
|
|
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
|
|
attributes.positionMC += exaggeration * vertexNormalMC;
|
|
}
|
|
`;var _de={name:"VerticalExaggerationPipelineStage"},VXe=new Q;_de.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(Qk),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,he.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",he.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return Q.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,VXe)}};var kk=_de;var Kq={};function HXe(e){let t=Ue.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 WXe(e,t){let n=t.length,i=Ue.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let a=t[r],s=t[r+1],c=t[r+2];i[o++]=a,i[o++]=s,i[o++]=s,i[o++]=c,i[o++]=c,i[o++]=a}return i}function jXe(e){let t=e-2,n=2+t*4,i=Ue.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 YXe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),a=0;r[a++]=t[0],r[a++]=t[1];for(let s=0;s<i;s++){let c=t[s],u=t[s+1],f=t[s+2];r[a++]=u,r[a++]=f,r[a++]=f,r[a++]=c}return r}function qXe(e){let t=e-2,n=2+t*4,i=Ue.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 KXe(e,t){let i=t.length-2,o=2+i*4,r=Ue.createTypedArray(e,o),a=0,s=t[0];r[a++]=s,r[a++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];r[a++]=u,r[a++]=f,r[a++]=f,r[a++]=s}return r}Kq.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Pe.TRIANGLES)return i?WXe(t,n):HXe(t);if(e===Pe.TRIANGLE_STRIP)return i?YXe(t,n):jXe(t);if(e===Pe.TRIANGLE_FAN)return i?KXe(t,n):qXe(t)};Kq.getWireframeIndicesCount=function(e,t){return e===Pe.TRIANGLES?t*2:e===Pe.TRIANGLE_STRIP||e===Pe.TRIANGLE_FAN?2+(t-2)*4:t};var _D=Kq;var yde={name:"WireframePipelineStage"};yde.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,he.FRAGMENT);let o=e.model,r=XXe(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let s=e.primitiveType,c=e.count;e.primitiveType=Pe.LINES,e.count=_D.getWireframeIndicesCount(s,c)};function XXe(e,t,n){let o=Tt.getAttributeBySemantic(e,at.POSITION).count,r=n.context.webgl2,a;if(l(t)){let f=t.buffer,h=t.count;l(f)&&r?(a=f.sizeInBytes===h?new Uint8Array(h):Ue.createTypedArray(o,h),f.getBufferData(a)):a=t.typedArray}let s=e.primitiveType,c=_D.createWireframeIndices(s,o,a),u=Ue.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Re.STATIC_DRAW,indexDatatype:u})}var Uk=yde;function Cde(e){e=e??V.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Cde.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader;if(l(o._marsOptions)&&l(o._marsOptions.customShaders)){let g=Lg.getCache(o._marsOptions.customShaders);for(let b in g)if(Object.prototype.hasOwnProperty.call(g,b)){r=g[b];break}}let a=o.style,s=e.context.webgl2,u=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),A=l(o.imageryLayers),m=l(r),y=!(m&&l(r.fragmentShaderText))||r.mode!==U_.REPLACE_MATERIAL,C=Tt.hasQuantizedAttributes(n.attributes),E=o.debugWireframe&&Pe.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||s),I=o.pointCloudShading,x=l(I)&&I.attenuation,S=l(I)&&I.backFaceCulling,w=n.primitiveType===Pe.POINTS&&(l(a)||x||S),v=o._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),N=JXe(o,i,n),L=l(o.classificationType);u&&t.push(Lk),t.push(q2),E&&t.push(Uk),L&&t.push(D2),h&&t.push(wk),p&&t.push(Fk),w&&t.push(vk),C&&t.push(U2),A&&(v?bt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(yk)),y&&t.push(Tk),t.push(TE),t.push(ph),t.push(rd),N.hasPropertyTable&&(t.push(wE),t.push(B2),t.push(R2)),f&&t.push(kk),m&&t.push(k2),t.push(Ek),o.allowPicking&&t.push(Bk),v&&t.push(Mk),R&&(e.edgeVisibilityRequested=!0,t.push(W2),t.push(G2)),t.push(w2),t.push(Nk)};function JXe(e,t,n){let i;return l(t.instances)&&(i=Tt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Tt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var zk=Cde;function Xq(e){e=e??V.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],ZXe(this)}Object.defineProperties(Xq.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 ZXe(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,a=e.joints,s=e._jointMatrices;for(let c=0;c<o;c++){let u=i[c].index,f=r[u];a.push(f);let h=n[c],p=Ede(f,h,new P);s.push(p)}}function Ede(e,t,n){let i=P.multiplyTransformation(e.transformToRoot,e.transform,n);return n=P.multiplyTransformation(i,t,n),n}Xq.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]=Ede(i,o,e[n])}};var Gk=Xq;function $Xe(){this.pass=void 0,this.alphaCutoff=void 0}var Ex=$Xe;function eJe(e){this.shaderBuilder=new Xg,this.model=e,this.uniformMap={},this.alphaOptions=new Ex,this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var Vk=eJe;var Hk=`void silhouetteStage(inout vec4 color) {
|
|
if(model_silhouettePass) {
|
|
color = czm_gammaCorrect(model_silhouetteColor);
|
|
}
|
|
}`;var Wk=`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 jk={name:"ModelSilhouettePipelineStage"};jk.silhouettesLength=0;jk.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++jk.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,he.BOTH),i.addVertexLines(Wk),i.addFragmentLines(Hk),i.addUniform("vec4","model_silhouetteColor",he.FRAGMENT),i.addUniform("float","model_silhouetteSize",he.VERTEX),i.addUniform("bool","model_silhouettePass",he.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Pt(o,e.uniformMap),e.hasSilhouette=!0};var Yk=jk;var qk=`void modelSplitterStage()
|
|
{
|
|
// Don't split when rendering the shadow map, because it is rendered from
|
|
// the perspective of a totally different camera.
|
|
#ifndef SHADOW_MAP
|
|
if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
#endif
|
|
}
|
|
`;var Kk={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Kk.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,he.FRAGMENT),i.addFragmentLines(qk);let o={};i.addUniform("float",Kk.SPLIT_DIRECTION_UNIFORM_NAME,he.FRAGMENT),o[Kk.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Pt(o,e.uniformMap)};var Xk=Kk;function tJe(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var Jk=tJe;function nJe(e){e=e??V.EMPTY_OBJECT,this.lightingModel=e.lightingModel??RA.UNLIT}var Zk=nJe;function iJe(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ye(e.uniformMap),this.alphaOptions=Ye(e.alphaOptions),this.renderStateOptions=Ye(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Tt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Tt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new Zk,this.pickId=void 0}var $k=iJe;function Zq(e){e=e??V.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==ei.CESIUM_3D_TILE,this._classifies3DTiles=o!==ei.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],sJe(this)}function oJe(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:wt.KEEP,zFail:wt.DECREMENT_WRAP,zPass:wt.KEEP},backFunction:e,backOperation:{fail:wt.KEEP,zFail:wt.INCREMENT_WRAP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},depthMask:!1}}var rJe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND},aJe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:wt.ZERO,zFail:wt.ZERO,zPass:wt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},xde=[];function sJe(e){let t=e._command,n=xde;if(e._useDebugWireframe){t.pass=Be.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=yD(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,a=r.length;for(let s=0;s<a;s++){let c=r[s];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Be.TERRAIN_CLASSIFICATION,a=Jq(t,r),s=Ide(t,r);n.length=0,n.push(a,s),e._commandListTerrain=yD(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=bde(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Be.CESIUM_3D_TILE_CLASSIFICATION,a=Jq(t,r),s=Ide(t,r);n.length=0,n.push(a,s),e._commandList3DTiles=yD(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=bde(e,n,e._commandList3DTilesPicking))}}function yD(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,a=o.length,s=t.length;for(let c=0;c<a;c++){let u=o[c],f=r[c];for(let h=0;h<s;h++){let p=t[h],A=it.shallowClone(p);A.count=u,A.offset=f,n.push(A)}}return n}function Jq(e,t){let n=it.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Be.TERRAIN_CLASSIFICATION?ti.ALWAYS:ti.EQUAL,o=oJe(i);return n.renderState=Ve.fromCache(o),n}function Ide(e,t){let n=it.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ve.fromCache(rJe),n}var cJe=[];function bde(e,t,n){let i=Ve.fromCache(aJe),o=t[0],r=t[1],a=it.shallowClone(o);a.cull=!0,a.pickOnly=!0;let s=it.shallowClone(r);s.cull=!0,s.pickOnly=!0,s.renderState=i,s.pickId=e._pickId;let c=cJe;return c.length=0,c.push(a,s),yD(e,c,n)}Object.defineProperties(Zq.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=P.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=le.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});Zq.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){oi(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&oi(t,this._commandListTerrain),this._classifies3DTiles&&oi(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=Jq(this._command,o),a=xde;a.length=0,a.push(r),this._commandListIgnoreShow=yD(this,a,this._commandListIgnoreShow)}oi(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&oi(t,this._commandListTerrainPicking),this._classifies3DTiles&&oi(t,this._commandList3DTilesPicking)),t};var e3=Zq;function CD(e){e=e??V.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Be.TRANSLUCENT,s=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,u=!r&&!c,f=n.hasSkipLevelOfDetail&&!r,h=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=P.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new P,this._boundingVolume2D=new le,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=s,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=h,this._needsEdgeCommands=p,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,lJe(this)}function ip(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}ip.clone=function(e){return new ip({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function lJe(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new ip({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new ip({command:AJe(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new ip({command:bJe(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new ip({command:xJe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new ip({command:gJe(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new ip({command:_Je(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources;e._edgeCommand=new ip({command:yJe(t,r,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand)}}Object.defineProperties(CD.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=P.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=le.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,fJe(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,dJe(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,hJe(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,mJe(this))}}});function uJe(e,t){let n=e._modelMatrix;e._modelMatrix2D=P.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function fJe(e){let t=e.shadows,n=Bn.castShadows(t),i=Bn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let a=o[r];if(a.updateShadows){let s=a.command;s.castShadows=n,s.receiveShadows=i}}}function dJe(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,a=Ye(r.renderState,!0);a.cull.enabled=t,r.renderState=Ve.fromCache(a)}}}function hJe(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,a=Ye(r.renderState,!0);a.cull.face=t,r.renderState=Ve.fromCache(a)}}}function mJe(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}}}CD.prototype.pushCommands=function(e,t){let n=$q(this,e);n&&!this._has2DCommands&&(pJe(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(uJe(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Jm.ALL_OPAQUE&&W_(t,this._translucentCommand,n),i===Jm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||W_(o._backfaceCommands,this._skipLodBackfaceCommand,n),CJe(this,r,n),W_(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){W_(t,this._silhouetteModelCommand,n);return}return W_(t,this._originalCommand,n),this._needsEdgeCommands&&W_(t,this._edgeCommand,n),t}};CD.prototype.pushSilhouetteCommands=function(e,t){let n=$q(this,e);return W_(t,this._silhouetteColorCommand,n),t};CD.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=$q(this,e);return W_(t,this._edgeCommand,n),t};function W_(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function $q(e,t){if(t.mode!==oe.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,a=t.mapProjection.ellipsoid.maximumRadius*D.PI;return o<a&&r>a||o<-a&&r>-a}function PE(e,t){if(!l(t))return;let n=ip.clone(t),i=it.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 pJe(e){PE(e,e._originalCommand),PE(e,e._translucentCommand),PE(e,e._skipLodBackfaceCommand),PE(e,e._skipLodStencilCommand),PE(e,e._silhouetteModelCommand),PE(e,e._silhouetteColorCommand),PE(e,e._edgeCommand)}function AJe(e){let t=it.shallowClone(e);t.pass=Be.TRANSLUCENT;let n=Ye(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=sn.ALPHA_BLEND,t.renderState=Ve.fromCache(n),t}function gJe(e,t){let n=t._silhouetteId%255,i=it.shallowClone(e),o=Ye(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ee.ALWAYS,backFunction:ee.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ve.fromCache(o),i}function _Je(e,t){let n=t._silhouetteId%255,i=it.shallowClone(e),o=Ye(e.renderState,!0);o.cull.enabled=!1,(e.pass===Be.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Be.TRANSLUCENT,o.depthMask=!1,o.blending=sn.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ee.NOTEQUAL,backFunction:ee.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP},backOperation:{fail:ee.KEEP,zFail:ee.KEEP,zPass:ee.KEEP}};let a=Ye(e.uniformMap);return a.model_silhouettePass=function(){return!0},i.renderState=Ve.fromCache(o),i.uniformMap=a,i.castShadows=!1,i.receiveShadows=!1,i}function yJe(e,t){let n=t.edgeGeometry,i=it.shallowClone(e);i.vertexArray=n.vertexArray,i.primitiveType=n.primitiveType,i.count=n.indexCount,l(n.shaderProgram)&&(i.shaderProgram=n.shaderProgram),i.pass=n.pass;let o=Ye(e.uniformMap);return o.u_isEdgePass=function(){return!0},i.uniformMap=o,i.uniformMap=o,i.castShadows=!1,i.receiveShadows=!1,i}function CJe(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,a=EJe(o);if(r!==a){let s=IJe(r),c=Ye(o.renderState,!0);c.stencilTest.reference=s,o.renderState=Ve.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function EJe(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function IJe(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function bJe(e){let t=it.shallowClone(e),n=Ye(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Li.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ye(t.uniformMap),o=new Q(5,5);return i.u_polygonOffset=function(){return o},t.renderState=Ve.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function xJe(e){let t=it.shallowClone(e),n=Ye(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Yt.SKIP_LOD_MASK,i.reference=Yt.CESIUM_3D_TILE_MASK,i.frontFunction=ti.GREATER_OR_EQUAL,i.frontOperation.zPass=wt.REPLACE,i.backFunction=ti.GREATER_OR_EQUAL,i.backOperation.zPass=wt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=Ve.fromCache(n),t}var t3=CD;var n3=`precision highp float;
|
|
|
|
czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
|
|
czm_modelVertexOutput vsOutput;
|
|
vsOutput.positionMC = positionMC;
|
|
vsOutput.pointSize = 1.0;
|
|
return vsOutput;
|
|
}
|
|
|
|
void main()
|
|
{
|
|
// Initialize the attributes struct with all
|
|
// attributes except quantized ones.
|
|
ProcessedAttributes attributes;
|
|
initializeAttributes(attributes);
|
|
|
|
#ifdef HAS_IMAGERY
|
|
initializeImageryAttributes();
|
|
#endif
|
|
|
|
// Dequantize the quantized ones and add them to the
|
|
// attributes struct.
|
|
#ifdef USE_DEQUANTIZATION
|
|
dequantizationStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_MORPH_TARGETS
|
|
morphTargetsStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_SKINNING
|
|
skinningStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_PRIMITIVE_OUTLINE
|
|
primitiveOutlineStage();
|
|
#endif
|
|
|
|
// Compute the bitangent according to the formula in the glTF spec.
|
|
// Normal and tangents can be affected by morphing and skinning, so
|
|
// the bitangent should not be computed until their values are finalized.
|
|
#ifdef HAS_BITANGENTS
|
|
attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
|
|
#endif
|
|
|
|
FeatureIds featureIds;
|
|
featureIdStage(featureIds, attributes);
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
SelectedFeature feature;
|
|
selectedFeatureIdStage(feature, featureIds);
|
|
// Handle any show properties that come from the style.
|
|
cpuStylingStage(attributes.positionMC, feature);
|
|
#endif
|
|
|
|
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
|
|
// The scene mode 2D pipeline stage and instancing stage add a different
|
|
// model view matrix to accurately project the model to 2D. However, the
|
|
// output positions and normals should be transformed by the 3D matrices
|
|
// to keep the data the same for the fragment shader.
|
|
mat4 modelView = czm_modelView3D;
|
|
mat3 normal = czm_normal3D;
|
|
#else
|
|
// These are used for individual model projection because they will
|
|
// automatically change based on the scene mode.
|
|
mat4 modelView = czm_modelView;
|
|
mat3 normal = czm_normal;
|
|
#endif
|
|
|
|
// Update the position for this instance in place
|
|
#ifdef HAS_INSTANCING
|
|
|
|
// The legacy instance stage is used when rendering i3dm models that
|
|
// encode instances transforms in world space, as opposed to glTF models
|
|
// that use EXT_mesh_gpu_instancing, where instance transforms are encoded
|
|
// in object space.
|
|
#ifdef USE_LEGACY_INSTANCING
|
|
mat4 instanceModelView;
|
|
mat3 instanceModelViewInverseTranspose;
|
|
|
|
legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
|
|
|
|
modelView = instanceModelView;
|
|
normal = instanceModelViewInverseTranspose;
|
|
#else
|
|
instancingStage(attributes);
|
|
#endif
|
|
|
|
#ifdef USE_PICKING
|
|
v_pickColor = a_pickColor;
|
|
#endif
|
|
|
|
#endif
|
|
|
|
Metadata metadata;
|
|
MetadataClass metadataClass;
|
|
MetadataStatistics metadataStatistics;
|
|
metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
|
|
#ifdef HAS_VERTICAL_EXAGGERATION
|
|
verticalExaggerationStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_CUSTOM_VERTEX_SHADER
|
|
czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
|
|
customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
|
|
#endif
|
|
|
|
// Compute the final position in each coordinate system needed.
|
|
// This returns the value that will be assigned to gl_Position.
|
|
vec4 positionClip = geometryStage(attributes, modelView, normal);
|
|
|
|
#if defined(HAS_LINE_CUMULATIVE_DISTANCE) || defined(HAS_LINE_PATTERN)
|
|
lineStyleStageVS(attributes);
|
|
#endif
|
|
|
|
// This must go after the geometry stage as it needs v_positionWC
|
|
#ifdef HAS_ATMOSPHERE
|
|
atmosphereStage(attributes);
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
modelClippingPolygonsStage(attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_SILHOUETTE
|
|
silhouetteStage(attributes, positionClip);
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
float show = pointCloudShowStylingStage(attributes, metadata);
|
|
#else
|
|
float show = 1.0;
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
|
|
show *= pointCloudBackFaceCullingStage();
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
|
|
v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
|
|
#endif
|
|
|
|
#ifdef PRIMITIVE_TYPE_POINTS
|
|
#ifdef HAS_CUSTOM_VERTEX_SHADER
|
|
gl_PointSize = vsOutput.pointSize;
|
|
#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
|
|
gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
|
|
#elif defined(HAS_POINT_DIAMETER)
|
|
gl_PointSize = u_pointDiameter;
|
|
#else
|
|
gl_PointSize = 1.0;
|
|
#endif
|
|
|
|
gl_PointSize *= show;
|
|
#endif
|
|
|
|
// Important NOT to compute gl_Position = show * positionClip or we hit:
|
|
// https://github.com/CesiumGS/cesium/issues/11270
|
|
//
|
|
// We will discard points with v_pointCloudShow == 0 in the fragment shader.
|
|
gl_Position = positionClip;
|
|
|
|
#ifdef HAS_EDGE_VISIBILITY
|
|
edgeVisibilityStageVS();
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
v_pointCloudShow = show;
|
|
#endif
|
|
}
|
|
`;var i3=`
|
|
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);
|
|
}
|
|
|
|
void lineStyleStage()
|
|
{
|
|
#if defined(HAS_LINE_PATTERN) && !defined(HAS_EDGE_VISIBILITY)
|
|
const float maskLength = 16.0;
|
|
float dashPosition = fract(v_lineCoord / maskLength);
|
|
float maskIndex = floor(dashPosition * maskLength);
|
|
float maskTest = floor(u_linePattern / pow(2.0, maskIndex));
|
|
if (mod(maskTest, 2.0) < 1.0) {
|
|
discard;
|
|
}
|
|
#endif
|
|
}
|
|
|
|
SelectedFeature selectedFeature;
|
|
|
|
void main()
|
|
{
|
|
#if defined(PRIMITIVE_TYPE_POINTS) && defined(HAS_POINT_DIAMETER)
|
|
// Render points as circles
|
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
if (distanceToCenter > 0.5) {
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
|
|
if (v_pointCloudShow == 0.0)
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef HAS_MODEL_SPLITTER
|
|
modelSplitterStage();
|
|
#endif
|
|
|
|
czm_modelMaterial material = defaultModelMaterial();
|
|
|
|
ProcessedAttributes attributes;
|
|
geometryStage(attributes);
|
|
|
|
FeatureIds featureIds;
|
|
featureIdStage(featureIds, attributes);
|
|
|
|
Metadata metadata;
|
|
MetadataClass metadataClass;
|
|
MetadataStatistics metadataStatistics;
|
|
metadataStage(featureIds, metadata, metadataClass, metadataStatistics, attributes);
|
|
|
|
//========================================================================
|
|
// When not picking metadata START
|
|
#ifndef METADATA_PICKING_ENABLED
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
selectedFeatureIdStage(selectedFeature, featureIds);
|
|
#endif
|
|
|
|
#ifndef CUSTOM_SHADER_REPLACE_MATERIAL
|
|
materialStage(material, attributes, selectedFeature);
|
|
#endif
|
|
|
|
#ifdef HAS_CUSTOM_FRAGMENT_SHADER
|
|
customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
|
|
#endif
|
|
|
|
lightingStage(material, attributes);
|
|
|
|
#ifdef HAS_SELECTED_FEATURE_ID
|
|
cpuStylingStage(material, selectedFeature);
|
|
#endif
|
|
|
|
#ifdef HAS_MODEL_COLOR
|
|
modelColorStage(material);
|
|
#endif
|
|
|
|
#ifdef HAS_PRIMITIVE_OUTLINE
|
|
primitiveOutlineStage(material);
|
|
#endif
|
|
|
|
vec4 color = handleAlpha(material.diffuse, material.alpha);
|
|
|
|
// When not picking metadata END
|
|
//========================================================================
|
|
#else
|
|
//========================================================================
|
|
// When picking metadata START
|
|
|
|
vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
|
|
metadataPickingStage(metadata, metadataClass, metadataValues);
|
|
vec4 color = metadataValues;
|
|
|
|
#endif
|
|
// When picking metadata END
|
|
//========================================================================
|
|
|
|
lineStyleStage();
|
|
|
|
#ifdef HAS_CLIPPING_PLANES
|
|
modelClippingPlanesStage(color);
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
modelClippingPolygonsStage();
|
|
#endif
|
|
|
|
//========================================================================
|
|
// When not picking metadata START
|
|
#ifndef METADATA_PICKING_ENABLED
|
|
|
|
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
|
|
silhouetteStage(color);
|
|
#endif
|
|
|
|
#ifdef HAS_ATMOSPHERE
|
|
atmosphereStage(color, attributes);
|
|
#endif
|
|
|
|
#ifdef HAS_EDGE_VISIBILITY
|
|
edgeVisibilityStage(color, featureIds);
|
|
edgeDetectionStage(color, featureIds);
|
|
#endif
|
|
|
|
#endif
|
|
// When not picking metadata END
|
|
//========================================================================
|
|
|
|
out_FragColor = color;
|
|
}
|
|
|
|
`;function Tde(){}Tde.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=TJe(e,n,t),o=SJe(e,i,t),r=e.model;return l(r.classificationType)?new e3({primitiveRenderResources:e,command:o}):new t3({primitiveRenderResources:e,command:o})};function TJe(e,t,n){t.addVertexLines(n3),t.addFragmentLines(i3);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function SJe(e,t,n){let i=wJe(e),o=new Vn({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let a=e.alphaOptions.pass,s=r.sceneGraph,c=n.mode===oe.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&r._projectTo2D)u=P.multiplyTransformation(s._computedModelMatrix,e.runtimeNode.computedTransform,new P),f=e.runtimePrimitive.boundingSphere2D;else{let C=c?s._computedModelMatrix:s._computedModelMatrix2D;u=P.multiplyTransformation(C,e.runtimeNode.computedTransform,new P),f=le.transform(e.boundingSphere,u)}let h=Ye(Ve.fromCache(e.renderStateOptions),!0);h.cull.face=Tt.getCullFace(u,e.primitiveType),h=Ve.fromCache(h);let p=l(r.classificationType),A=p?!1:Bn.castShadows(r.shadows),m=p?!1:Bn.receiveShadows(r.shadows),_=p?void 0:e.pickId,y=new it({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:a,count:e.count,owner:r,pickId:_,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:A,receiveShadows:m});return r._marsOptions?.updateDrawCommand&&r._marsOptions.updateDrawCommand(y),y}function wJe(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var o3=Tde;function Hc(e){e=e??V.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=P.clone(P.IDENTITY),this._computedModelMatrix2D=P.clone(P.IDENTITY),this._axisCorrectionMatrix=Tt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P),this._runtimeArticulations={},BJe(this)}Object.defineProperties(Hc.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 BJe(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Sde(e,o);let r=t.articulations,a=r.length,s=e._runtimeArticulations;for(let E=0;E<a;E++){let I=r[E],x=new f2({articulation:I,sceneGraph:e}),S=x.name;s[S]=x}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=P.IDENTITY;for(let E=0;E<h;E++){let I=n.nodes[E],x=wde(e,I,p);e._rootNodes.push(x)}let A=t.skins,m=e._runtimeSkins,_=A.length;for(let E=0;E<_;E++){let I=A[E];m.push(new Gk({skin:I,sceneGraph:e}))}let y=e._skinnedNodes,C=y.length;for(let E=0;E<C;E++){let I=y[E],x=e._runtimeNodes[I],w=c[I].skin.index;x._runtimeSkin=m[w],x.updateJointMatrices()}e.applyArticulations()}function Sde(e,t){let n=e._components,i=e._model;e._computedModelMatrix=P.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=P.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=P.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var DJe=new d;function vJe(e,t){let n=e._computedModelMatrix,i=P.getTranslation(n,DJe);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=At.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=P.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function wde(e,t,n){let i=[],o=Tt.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=P.multiplyTransformation(n,o,new P),A=wde(e,h,p);i.push(A)}let a=new S2({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),s=t.primitives.length;for(let f=0;f<s;f++)a.runtimePrimitives.push(new zk({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=a,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,h=new _2(f,a);f._nodesByName[u]=h}return c}var PJe=new d,RJe=new d,MJe=new d,NJe=new d;Hc.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};Hc.prototype.buildRenderResources=function(e){let t=this._model,n=new Vk(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let a=r.pipelineStages,s=new Jk(n,r);n.nodeRenderResources[o]=s;for(let c=0;c<a.length;c++)a[c].process(s,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let u=r.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,h=new $k(s,u);s.primitiveRenderResources[c]=h;for(let p=0;p<f.length;p++)f[p].process(h,u.primitive,e)}}return n};Hc.prototype.computeBoundingVolumes=function(e){let t=this._model,n=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,PJe),i=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,RJe);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let a=e.nodeRenderResources[o],s=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let u=r.runtimePrimitives[c],f=a.primitiveRenderResources[c];u.boundingSphere=le.clone(f.boundingSphere,new le);let h=P.multiplyByPoint(s,f.positionMin,MJe),p=P.multiplyByPoint(s,f.positionMax,NJe);d.minimumByComponent(n,h,n),d.maximumByComponent(i,p,i)}}this._boundingSphere=le.fromCornerPoints(n,i,new le),this._boundingSphere=le.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=le.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=le.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};Hc.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let a=i.runtimePrimitives[r],s=o.primitiveRenderResources[r],c=o3.buildModelDrawCommand(s,t);a.drawCommand=c}}};Hc.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;l(n.color)&&t.push(xE),!l(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(c2),n.isClippingEnabled()&&t.push(m2),n.isClippingPolygonsEnabled()&&t.push(g2),n.hasSilhouette(e)&&t.push(Yk),l(n.splitDirection)&&n.splitDirection!==Qr.NONE&&t.push(Xk),Vr.is3DTiles(n.type)&&t.push(i2),i&&t.push(a2))};Hc.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let a=e.mode!==oe.SCENE3D&&this._model._projectTo2D;for(t&&!a&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let s=r.runtimePrimitives[i];for(o=0;o<s.updateStages.length;o++)s.updateStages[o].update(s,this)}}};Hc.prototype.updateModelMatrix=function(e,t){Sde(this,e),t.mode!==oe.SCENE3D&&vJe(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};Hc.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 Bde(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let u=t.getChild(c);Bde(e,u,n,i,o)}let a=t.runtimePrimitives,s=a.length;for(let c=0;c<s;c++){let u=a[c];i(u,o)}}function r3(e,t,n,i){let o=e._rootNodes,r=o.length;for(let a=0;a<r;a++){let s=o[a],c=e._runtimeNodes[s];Bde(e,c,t,n,i)}}var LJe={backFaceCulling:void 0};Hc.prototype.updateBackFaceCulling=function(e){let t=LJe;t.backFaceCulling=e,r3(this,!1,OJe,t)};function OJe(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var FJe={shadowMode:void 0};Hc.prototype.updateShadows=function(e){let t=FJe;t.shadowMode=e,r3(this,!1,QJe,t)};function QJe(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var kJe={debugShowBoundingVolume:void 0};Hc.prototype.updateShowBoundingVolume=function(e){let t=kJe;t.debugShowBoundingVolume=e,r3(this,!1,UJe,t)};function UJe(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Dde=[],vde=[],zJe={frameState:void 0,hasSilhouette:void 0};Hc.prototype.pushDrawCommands=function(e){let t=Dde;t.length=0;let n=vde;n.length=0;let i=zJe;i.hasSilhouette=this._model.hasSilhouette(e),i.frameState=e,r3(this,!0,GJe,i),oi(e.commandList,t),oi(e.commandList,n)};function GJe(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=Dde,a=vde,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r),l(s.pushEdgeCommands)&&s.pushEdgeCommands(n,a)}Hc.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};Hc.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var a3=Hc;function j_(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Ft}Object.defineProperties(j_.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}}});j_.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()};j_.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};j_.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};j_.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};j_.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};j_.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var s3=j_;var Nde=Na(aM(),1);var Pde={},RE=Uint32Array.BYTES_PER_ELEMENT;Pde.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=RE;let o=i.getUint32(t,!0);if(o!==1)throw new ue(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=RE,t+=RE;let r=i.getUint32(t,!0);if(r===0)throw new ue("Feature table must have a byte length greater than zero");t+=RE;let a=i.getUint32(t,!0);t+=RE;let s=i.getUint32(t,!0);t+=RE;let c=i.getUint32(t,!0);t+=RE;let u=Pr(n,t,r);t+=r;let f=new Uint8Array(e,t,a);t+=a;let h,p;s>0&&(h=Pr(n,t,s),Object.keys(h).length===0&&(h=void 0),t+=s,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p),t+=c));let A=new Km(u,f),m=A.getGlobalProperty("POINTS_LENGTH");if(A.featuresLength=m,!l(m))throw new ue("Feature table global property: POINTS_LENGTH must be defined");let _=A.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(_)&&(_=d.unpack(_));let y=HJe(A,h);if(y.rtcCenter=_,y.pointsLength=m,!y.hasPositions){let C=WJe(A);y.positions=C,y.hasPositions=y.hasPositions||l(C)}if(!y.hasPositions)throw new ue("Either POSITION or POSITION_QUANTIZED must be defined.");if(!y.hasNormals){let C=YJe(A);y.normals=C,y.hasNormals=y.hasNormals||l(C)}if(!y.hasColors){let C=jJe(A);y.colors=C,y.hasColors=y.hasColors||l(C),y.hasConstantColor=l(y.constantColor),y.isTranslucent=l(C)&&C.isTranslucent}if(!y.hasBatchIds){let C=qJe(A);y.batchIds=C,y.hasBatchIds=y.hasBatchIds||l(C)}if(y.hasBatchIds){let C=A.getGlobalProperty("BATCH_LENGTH");if(!l(C))throw new ue("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");y.batchLength=C}return(l(h)||l(p))&&(y.batchTableJson=h,y.batchTableBinary=p),VJe(y),y};function VJe(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let s=t[r].byteOffset;l(s)&&(i.includes(r)||o.push(r))}for(let r of o)bt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function HJe(e,t){let n=e.json,i,o,r,a=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,s=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(s)&&(r=s.properties);let c,u,f,h,p;if(l(a)){o=a.properties;let m=a.byteOffset,_=a.byteLength;if(!l(o)||!l(m)||!l(_))throw new ue("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+_),c=l(o.POSITION),u=l(o.RGB)||l(o.RGBA),f=l(o.NORMAL),h=l(o.BATCH_ID),p=l(o.RGBA)}let A;return l(i)&&(A={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:Pt(o,r),dequantizeInShader:!0}),{draco:A,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function WJe(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",j.FLOAT,3),{name:at.POSITION,semantic:at.POSITION,typedArray:n,isQuantized:!1,componentDatatype:j.FLOAT,type:zt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",j.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",j.FLOAT,3);if(!l(i))throw new ue("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",j.FLOAT,3);if(!l(r))throw new ue("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:at.POSITION,semantic:at.POSITION,typedArray:n,isQuantized:!0,componentDatatype:j.FLOAT,type:zt.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:j.UNSIGNED_SHORT,quantizedType:zt.VEC3}}}function jJe(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",j.UNSIGNED_BYTE,4),{name:at.COLOR,semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:j.UNSIGNED_BYTE,type:zt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",j.UNSIGNED_BYTE,3),{name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:j.UNSIGNED_BYTE,type:zt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",j.UNSIGNED_SHORT,1),{name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n,componentDatatype:j.FLOAT,type:zt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",j.UNSIGNED_BYTE,4),o=i[3],r=U.fromBytes(i[0],i[1],i[2],o),a=o<255;return{name:at.COLOR,semantic:at.COLOR,setIndex:0,constantColor:r,componentDatatype:j.FLOAT,type:zt.VEC4,isQuantized:!1,isTranslucent:a}}}function YJe(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",j.FLOAT,3),{name:at.NORMAL,semantic:at.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:j.FLOAT,type:zt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",j.UNSIGNED_BYTE,2),{name:at.NORMAL,semantic:at.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:zt.VEC2,quantizedComponentDatatype:j.UNSIGNED_BYTE,componentDatatype:j.FLOAT,type:zt.VEC3}}function qJe(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",j.UNSIGNED_SHORT,1);return{name:at.FEATURE_ID,semantic:at.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:j.fromTypedArray(n),type:zt.SCALAR}}}var Ix=Pde;var KJe=bn.Components,XJe=bn.Scene,JJe=bn.Node,ZJe=bn.Primitive,$Je=bn.Attribute,Rde=bn.Quantization,e7e=bn.FeatureIdAttribute,t7e=bn.Material,n7e=bn.MetallicRoughness,eK=class extends $i{constructor(t){super(),t=t??V.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=Ix.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=i7e(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function i7e(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=C_.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&o7e(e,i,r),p7e(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let a="Failed to load Draco pnts";e._error=e.getError(a,r)})}function o7e(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:at.POSITION,typedArray:n.POSITION.array,componentDatatype:j.FLOAT,type:zt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let s=n.POSITION.data.quantization,c=s.range,u=d.fromElements(c,c,c),f=d.unpack(s.minValues),h=(1<<s.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?j.UNSIGNED_BYTE:j.UNSIGNED_SHORT,o.quantizedType=zt.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:at.NORMAL,typedArray:n.NORMAL.array,componentDatatype:j.FLOAT,type:zt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let s=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=s,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=j.UNSIGNED_BYTE,o.quantizedType=zt.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:j.UNSIGNED_BYTE,type:zt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:at.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:j.UNSIGNED_BYTE,type:zt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let s=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:at.FEATURE_ID,setIndex:0,typedArray:s,componentDatatype:j.fromTypedArray(s),type:zt.SCALAR}}let r=i.batchTableJson,a=t.batchTableProperties;for(let s in a)if(a.hasOwnProperty(s)){let c=n[s];l(r)||(r={}),i.hasDracoBatchTable=!0;let u=c.data;r[s]={byteOffset:u.byteOffset,type:r7e(u.componentsPerAttribute),componentType:a7e(u.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function r7e(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function a7e(e){switch(e){case ee.BYTE:return"BYTE";case ee.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ee.SHORT:return"SHORT";case ee.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ee.INT:return"INT";case ee.UNSIGNED_INT:return"UNSIGNED_INT";case ee.DOUBLE:return"DOUBLE";case ee.FLOAT:return"FLOAT"}}function ED(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new Rde,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new Rde;let s=t.quantizedRange;o.normalizationRange=s,o.quantizedVolumeOffset=d.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=d.divideByScalar(c,s,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new $Je;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=tn.decodeRGB565(i)),l(t.constantColor)){let s=new Array(4);r.constant=U.pack(t.constantColor,s)}else{let s=tt.createVertexBuffer({typedArray:i,context:n,usage:Re.STATIC_DRAW});s.vertexArrayDestroyable=!1,e._buffers.push(s),r.buffer=s}let a=e._loadAttributesFor2D;return r.semantic===at.POSITION&&a&&(r.typedArray=i),r}var Mde,c3;function s7e(e){if(!l(c3)){Mde=new Nde.default(0),c3=new Array(e);for(let t=0;t<e;++t)c3[t]=Mde.random()}return c3}var c7e=new d,l7e=new d,u7e=new d;function f7e(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=s7e(n),a=Number.MAX_VALUE,s=-Number.MAX_VALUE,c=d.fromElements(a,a,a,c7e),u=d.fromElements(s,s,s,l7e),f,h,p;if(e.isQuantized)c=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,u7e),d.minimumByComponent(c,p,c),d.maximumByComponent(u,p,u);e.min=d.clone(c),e.max=d.clone(u)}var d7e={name:at.COLOR,semantic:at.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:j.FLOAT,type:zt.VEC4,isQuantized:!1,isTranslucent:!1};function h7e(e,t,n){let i=[],o,r=t.positions;return l(r)&&(f7e(r),o=ED(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=ED(e,t.normals,n),i.push(o)),l(t.colors)?(o=ED(e,t.colors,n),i.push(o)):(o=ED(e,d7e,n),i.push(o)),l(t.batchIds)&&(o=ED(e,t.batchIds,n),i.push(o)),i}function m7e(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,a=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?F_({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:a,customAttributeOutput:t}):new js({schema:{},propertyTables:[]})}function p7e(e,t){let n=e._parsedContent,i=new n7e;i.metallicFactor=0,i.roughnessFactor=.9;let o=new t7e;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=bA.BLEND);let a=!l(n.normals);o.unlit=a;let s=new ZJe;if(s.attributes=h7e(e,n,t),s.primitiveType=Pe.POINTS,s.material=o,l(n.batchIds)){let A=new e7e;A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0",s.featureIds.push(A)}let c=new JJe;c.index=0,c.primitives=[s];let u=new XJe;u.nodes=[c],u.upAxis=so.Z,u.forwardAxis=so.X;let f=new KJe;f.scene=u,f.nodes=[c];let h=[];f.structuralMetadata=m7e(n,h),h.length>0&&A7e(e,s,h,t),l(n.rtcCenter)&&(f.transform=P.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=P.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function A7e(e,t,n,i){let o=t.attributes,r=n.length;for(let a=0;a<r;a++){let s=n[a],c=tt.createVertexBuffer({typedArray:s.typedArray,context:i,usage:Re.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),s.buffer=c,s.typedArray=void 0,o.push(s)}t.propertyAttributeIds=[0]}var l3=eK;var g7e=new d,_7e=new d,y7e=new d,C7e=new P,E7e=new P,I7e=new P,b7e=new me,x7e=new le;function ID(e,t,n,i,o,r,a){if(!e._ready||n.mode===oe.MORPHING)return;let s=Number.MAX_VALUE,c=e.sceneGraph,u=c._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,A=P.clone(h.computedTransform,C7e),m=P.clone(c.computedModelMatrix,E7e),_=p.instances;l(_)&&_.transformInWorldSpace&&(m=P.multiplyTransformation(e.modelMatrix,c.components.transform,m),A=P.multiplyTransformation(c.axisCorrectionMatrix,h.computedTransform,A));let y=P.multiplyTransformation(m,A,I7e);n.mode!==oe.SCENE3D&&(y=At.basisTo2D(n.mapProjection,y,y));let C=[];if(l(_)){let I=_.attributes[0].count,x=_.attributes[0].componentDatatype,S=12,w=h.transformsTypedArray;if(!l(w)){let v=h.instancingTransformsBuffer;l(v)&&n.context.webgl2&&(w=j.createTypedArray(x,I*S),v.getBufferData(w))}if(l(w))for(let v=0;v<I;v++){let R=v*S,N=new P(w[R],w[R+1],w[R+2],w[R+3],w[R+4],w[R+5],w[R+6],w[R+7],w[R+8],w[R+9],w[R+10],w[R+11],0,0,0,1);_.transformInWorldSpace?(P.multiplyTransformation(N,A,N),P.multiplyTransformation(m,N,N)):P.multiplyTransformation(N,y,N),C.push(N)}}C.length===0&&C.push(y);let E=h.runtimePrimitives.length;for(let I=0;I<E;I++){let x=h.runtimePrimitives[I],S=x.primitive;if(l(x.boundingSphere)&&!l(_)){let Y=le.transform(x.boundingSphere,y,x7e),$=di.raySphere(t,Y);if(!l($))continue}let w=Tt.getAttributeBySemantic(S,at.POSITION),v=w.byteOffset,R=w.byteStride,N=w.count;if(!l(S.indices))continue;let L=S.indices.typedArray;if(!l(L)){let Y=S.indices.buffer,$=S.indices.count,W=S.indices.indexDatatype;l(Y)&&n.context.webgl2&&(W===Ue.UNSIGNED_BYTE?L=new Uint8Array($):W===Ue.UNSIGNED_SHORT?L=new Uint16Array($):W===Ue.UNSIGNED_INT&&(L=new Uint32Array($)),Y.getBufferData(L))}let g=w.typedArray,b=w.componentDatatype,T=w.type,B=w.quantization;l(B)&&(b=w.quantization.componentDatatype,T=w.quantization.type);let M=zt.getNumberOfComponents(T),O=j.getSizeInBytes(b),G=!l(g)&&l(R)&&R!==M*O,k=M,z=0;G&&(k=R/O,z=v/O);let F=N*k;if(!l(g)){let Y=w.buffer;l(Y)&&n.context.webgl2&&(g=j.createTypedArray(b,F),Y.getBufferData(g,G?0:v,0,F)),B&&w.normalized&&(g=tn.dequantize(g,b,T,N))}if(!l(L)||!l(g))return;r=r??te.default,i=i??1,o=o??0;let H=L.length;for(let Y=0;Y<H;Y+=3){let $=L[Y],W=L[Y+1],K=L[Y+2];for(let Z of C){let pe=tK(g,$,z,k,B,Z,i,o,r,g7e),ge=tK(g,W,z,k,B,Z,i,o,r,_7e),re=tK(g,K,z,k,B,Z,i,o,r,y7e),ye=di.rayTriangleParametric(t,pe,ge,re,e.backFaceCulling??!0);l(ye)&&ye<s&&ye>=0&&(s=ye)}}}}if(s!==Number.MAX_VALUE){if(a=In.getPoint(t,s,a),n.mode!==oe.SCENE3D){d.fromElements(a.y,a.z,a.x,a);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(a,b7e);h.cartographicToCartesian(p,a)}return a}}function tK(e,t,n,i,o,r,a,s,c,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],l(o))if(o.octEncoded){if(u=tn.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=P.multiplyByPoint(r,u,u),a!==1&&To.getPosition(u,c,a,s,u),u}var nK=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},u3=nK;var iK=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let a=n[r],s=a.runtimeNode,c=a.runtimePrimitive,u=new Cx(t,s,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let a=i[r];if(l(a))for(let s=0;s<a.runtimePrimitives.length;s++){let c=a.runtimePrimitives[s];o.push({runtimeNode:a,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new de("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),a=i[o];if(r.show!==a.show||r.alpha!==a.alpha||r.brightness!==a.brightness||r.contrast!==a.contrast||r.hue!==a.hue||r.saturation!==a.saturation||r.gamma!==a.gamma||r.colorToAlpha!==a.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new u3(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),fe(this)}},f3=iK;function wo(e){e=e??V.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Vr.GLTF,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=J.clone(J.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 e2(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=U.clone(e.color),this._colorBlendMode=e.colorBlendMode??bl.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??U.RED;this._silhouetteColor=U.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Be.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new le,this._initialRadius=void 0,this._heightReference=e.heightReference??ot.NONE,this._heightDirty=this._heightReference!==ot.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new TA(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let a=e.clippingPlanes;l(a)&&a.owner===void 0?Ca.setOwner(a,this,"_clippingPlanes"):this._clippingPlanes=a,this._clippingPlanesState=0,this._clippingPlanesMatrix=P.clone(P.IDENTITY);let s=e.clippingPolygons;l(s)&&s.owner===void 0?jm.setOwner(s,this,"_clippingPolygons"):this._clippingPolygons=s,this._clippingPolygonsState=0,this._modelImagery=new f3(this),this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new xb,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new R_(e.environmentMapOptions);R_.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Bn.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===Vr.GLTF&&bt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new Et(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Qr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new s3,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new _e,this._readyEvent=new _e,this._texturesReadyEvent=new _e,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject,this._marsOptions=e.marsOptions??{}}function oK(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function T7e(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let a=i[r],s=new n2({model:e,propertyTable:a});n.push(s)}return n}function S7e(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,a,s;for(o=0;o<e.nodes.length;o++)if(s=e.nodes[o],l(s.instances)&&(a=Tt.getFeatureIdsByLabel(s.instances.featureIds,i),l(a)&&l(a.propertyTableId)))return a.propertyTableId;for(o=0;o<e.nodes.length;o++)for(s=e.nodes[o],r=0;r<s.primitives.length;r++){let c=s.primitives[r],u=Tt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function sK(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(wo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Gt.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){sK(e,this._color)&&this.resetDrawCommands(),this._color=U.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(!U.equals(e,this._silhouetteColor)){let t=sK(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=U.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Fde(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===Vr.GLTF&&bt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(Ca.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(jm.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(R_.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}}});wo.prototype.getNode=function(e){return this._nodesByName[e]};wo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};wo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};wo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};wo.prototype.makeStyleDirty=function(){this._styleDirty=!0};wo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var w7e=new P,B7e=new J,D7e=new P;wo.prototype.update=function(e){let t=!1;try{t=v7e(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")oK(this,i);else{let o=Tt.getError("model",this._resource,i);oK(this,o)}}if(M7e(this,e),P7e(this,e),R7e(this,e),N7e(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let a=Tt.getError("model",this._resource,new ue("Failed to load model."));oK(a),this._rejectLoad=this._rejectLoad&&this._rejectLoad(a)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&T7e(this,o);let r=new a3({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===oe.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(L7e(this),O7e(this),F7e(this,e),Q7e(this),k7e(this,e),U7e(this,e),z7e(this,e),G7e(this,e),V7e(this,e),H7e(this,e),W7e(this,e),this._defaultTexture=e.context.defaultTexture,j7e(this,e),Y7e(this,e),q7e(this),K7e(this,e),$7e(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)),J7e(this),eZe(this,e),tZe(this),nZe(this,e)}};function v7e(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function P7e(e,t){l(e._customShader)&&e._customShader.update(t)}function R7e(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function M7e(e,t){if(l(e._marsOptions)&&l(e._marsOptions.customShaders)){let n=Lg.getCache(e._marsOptions.customShaders);for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&n[i].update(t)}}function N7e(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function L7e(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=S7e(t,e),e._styleDirty=!0,e.resetDrawCommands())}function O7e(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function F7e(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&&Ode(e)}function Ode(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Jm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Q7e(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 k7e(e,t){e._silhouetteDirty&&(Qde(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function U7e(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function z7e(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 G7e(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 V7e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function H7e(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function W7e(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 j7e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Y7e(e,t){P.equals(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=P.clone(e.modelMatrix,e._modelMatrix))}var Y_=new d,rK=new me;function q7e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!l(t)||e.heightReference===ot.NONE){e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??te.default,i=e.modelMatrix;Y_.x=i[12],Y_.y=i[13],Y_.z=i[14];let o=n.cartesianToCartographic(Y_);if(!l(o)){e._clampedModelMatrix=void 0;return}l(e._clampedModelMatrix)||(e._clampedModelMatrix=P.clone(i,new P)),e._removeUpdateHeightCallback=t.updateHeight(o,Lde(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(l(r)){let a=Lde(e,n,o);me.clone(o,rK),rK.height=r,a(rK)}e._heightDirty=!1,e._updateModelMatrix=!0}function K7e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Fde(e,n),X7e(e,n,t)}function Fde(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=le.transform(e._boundingSphere,t,e._boundingSphere)}function X7e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);P.getTranslation(t,Y_),e._sceneMode!==oe.SCENE3D&&co.computeActualEllipsoidPosition(n,Y_,Y_);let a=e._boundingSphere.radius,s=iZe(Y_,a,n),c=1/s;Math.min(c*(2*a),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*s/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function J7e(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 Z7e=new J(1,0,0,0,0,1,0,-1,0);function $7e(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=B7e,a=w7e;if(a=P.multiply(o.uniformState.view3D,i,a),r=P.getRotation(a,r),r=J.transpose(r,r),e._iblReferenceFrameMatrix=J.multiply(Z7e,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let s=D7e;s=P.multiply(o.uniformState.view3D,i,s),s=P.multiply(s,e._clippingPlanes.modelMatrix,s),e._clippingPlanesMatrix=P.inverseTranspose(s,e._clippingPlanesMatrix)}}function eZe(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;l(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function tZe(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let a=Et.clone(e._credit);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let n=e._resourceCredits,i=n.length;for(let a=0;a<i;a++){let s=Et.clone(n[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let o=e._gltfCredits,r=o.length;for(let a=0;a<r;a++){let s=Et.clone(o[a]);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}}function nZe(e,t){let n=rZe(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),a=t.passes,s=a.render||a.pick&&e.allowPicking;r&&!e._ignoreCommands&&s&&(aZe(e,t),e._sceneGraph.pushDrawCommands(t))}var aK=new le;function iZe(e,t,n){return aK.center=e,aK.radius=t,n.camera.getPixelSize(aK,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var d3=new d;function Lde(e,t,n){return function(i){XI(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,d3);let o=e._clampedModelMatrix;P.clone(e.modelMatrix,o),o[12]=d3.x,o[13]=d3.y,o[14]=d3.z,e._heightDirty=!0}}var oZe=new d;function rZe(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===oe.SCENE2D){let s=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=s*s}else{let a=P.getTranslation(e.modelMatrix,oZe);co.computeActualEllipsoidPosition(t,a,a),r=d.distanceSquared(a,t.camera.positionWC)}return r>=i&&r<=o}function aZe(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}wo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};wo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Qde(e){return e.context.stencilBuffer}wo.prototype.hasSilhouette=function(e){return Qde(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};wo.prototype.hasSkipLevelOfDetail=function(e){if(!Vr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};wo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};wo.prototype.pick=function(e,t,n,i,o){return ID(this,e,t,n,i,o)};wo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};wo.prototype.isDestroyed=function(){return!1};wo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let a=0;a<r;a++)t[a].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;l(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,fe(this)};wo.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};wo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};wo.fromGltfAsync=async function(e){e=e??V.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",o=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=De.createIfNeeded(t);let r=new td(n),s=l(e.content)?Vr.TILE_GLTF:Vr.GLTF,c=n.gltfResource,u=bD(r,s,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(A){throw r.destroy(),Tt.getError("model",c,A)}let f=e.gltfCallback;l(f)&&f(r.gltfJson);let h=new wo(u),p=h._resource.credits;if(l(p)){let A=p.length;for(let m=0;m<A;m++)h._resourceCredits.push(Et.clone(p[m]))}return h};wo.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new UQ(t);try{await n.load();let i=bD(n,Vr.TILE_B3DM,e);return new wo(i)}catch(i){throw n.destroy(),i}};wo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new l3(t);try{await n.load();let i=bD(n,Vr.TILE_PNTS,e);return new wo(i)}catch(i){throw n.destroy(),i}};wo.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 YQ(t);try{await n.load();let i=bD(n,Vr.TILE_I3DM,e);return new wo(i)}catch(i){throw n.destroy(),i}};wo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new GQ(t),i=bD(n,Vr.TILE_GEOJSON,e);return new wo(i)};var sZe=new U;wo.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,sZe),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):U.clone(U.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,sK(t,this._color)&&this.resetDrawCommands()};wo.prototype.applyStyle=function(e){let t=this.type===Vr.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Ode(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function bD(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,...n.marsOptions,marsOptions:n.marsOptions}}var ad=wo;function aa(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(aa.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return l(t)&&l(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(l(t)&&l(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});aa.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};aa.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};aa.prototype.getExtension=function(e){return this._model.getExtension(e)};aa.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;return t.featureTables[n].getFeature(e)};aa.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return l(i)?n.featureTables[i].hasProperty(e,t):!1};aa.prototype.applyDebugSettings=function(e,t){t=e?t:U.WHITE,this.featuresLength===0?this._model.color=t:l(this.batchTable)&&this.batchTable.setAllColor(t)};aa.prototype.applyStyle=function(e){this._model.style=e};aa.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,l(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),l(o)&&l(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let a=e.clippingPolygons;l(a)&&i.clippingPolygonsDirty&&(n._clippingPolygons=a.enabled&&i._isClippedByPolygon?a:void 0),l(a)&&l(n._clippingPolygons)&&n._clippingPolygons!==a&&(n._clippingPolygons=a,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:Ju.REPEAT}),this._ready=!0)};aa.prototype.isDestroyed=function(){return!1};aa.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),fe(this)};aa.fromGltf=async function(e,t,n,i){let o=new aa(e,t,n),a=xD(e,t,o,{gltf:i,basePath:n}),s=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=s;let c=await ad.fromGltfAsync(a);return o._model=c,o};aa.fromB3dm=async function(e,t,n,i,o){let r=new aa(e,t,n),s=xD(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=c;let u=await ad.fromB3dm(s);return r._model=u,r};aa.fromI3dm=async function(e,t,n,i,o){let r=new aa(e,t,n),s=xD(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ad.fromI3dm(s);return r._model=c,r};aa.fromPnts=async function(e,t,n,i,o){let r=new aa(e,t,n),s=xD(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),c=await ad.fromPnts(s);return r._model=c,r};aa.fromGeoJson=async function(e,t,n,i){let o=new aa(e,t,n),a=xD(e,t,o,{geoJson:i,resource:n}),s=await ad.fromGeoJson(a);return o._model=s,o};aa.prototype.pick=function(e,t,n){if(!l(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,te.WGS84,n)};function xD(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Be.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,marsOptions:e._marsOptions};return Pt(i,o)}var sd=aa;function cd(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(cd.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}}});cd.fromJson=function(e,t,n,i){let o=new cd(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};cd.prototype.hasProperty=function(e,t){return!1};cd.prototype.getFeature=function(e){};cd.prototype.applyDebugSettings=function(e,t){};cd.prototype.applyStyle=function(e){};cd.prototype.update=function(e,t){};cd.prototype.pick=function(e,t,n){};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){return fe(this)};var h3=cd;var m3=`uniform sampler2D u_atlas;
|
|
uniform float u_coarseDepthTestDistance;
|
|
uniform float u_threePointDepthTestDistance;
|
|
|
|
#ifdef VECTOR_TILE
|
|
uniform vec4 u_highlightColor;
|
|
#endif
|
|
|
|
in vec2 v_textureCoordinates;
|
|
in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
flat in vec2 v_splitDirectionAndEllipsoidDepthEC;
|
|
|
|
#ifdef SDF
|
|
in vec4 v_outlineColor;
|
|
in float v_outlineWidth;
|
|
#endif
|
|
|
|
in vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
|
|
const float SHIFT_LEFT1 = 2.0;
|
|
const float SHIFT_RIGHT1 = 1.0 / 2.0;
|
|
|
|
float getGlobeDepthAtCoords(vec2 st)
|
|
{
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
|
|
if (logDepthOrDepth == 0.0)
|
|
{
|
|
return 0.0; // not on the globe
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
return eyeCoordinate.z / eyeCoordinate.w;
|
|
}
|
|
|
|
#ifdef SDF
|
|
|
|
// Get the distance from the edge of a glyph at a given position sampling an SDF texture.
|
|
float getDistance(vec2 position)
|
|
{
|
|
return texture(u_atlas, position).r;
|
|
}
|
|
|
|
// Samples the sdf texture at the given position and produces a color based on the fill color and the outline.
|
|
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
|
|
{
|
|
float distance = getDistance(position);
|
|
|
|
if (outlineWidth > 0.0)
|
|
{
|
|
// Don't get the outline edge exceed the SDF_EDGE
|
|
float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
|
|
float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
|
|
vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
|
|
float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
|
|
return vec4(sdfColor.rgb, sdfColor.a * alpha);
|
|
}
|
|
else
|
|
{
|
|
float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
|
|
return vec4(v_color.rgb, v_color.a * alpha);
|
|
}
|
|
}
|
|
#endif
|
|
|
|
bool getDepthTestEnabled() {
|
|
float temp = v_compressed.y;
|
|
temp = temp * SHIFT_RIGHT1;
|
|
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
|
|
return temp2 != 0.0;
|
|
}
|
|
|
|
float getRelativeEyeDepth(float eyeDepth, float distanceToEllipsoid, float epsilon) {
|
|
float depthDifferential = eyeDepth - distanceToEllipsoid;
|
|
float depthRatio = abs(depthDifferential / distanceToEllipsoid);
|
|
if (depthRatio < epsilon) {
|
|
// The approximations are imprecise, so use an epsilon check for small value differences and assume a value of 0.0
|
|
return 0.0;
|
|
}
|
|
|
|
return depthDifferential;
|
|
}
|
|
|
|
// Extra manual depth testing is done to allow more control over how a billboard is occluded
|
|
// by the globe when near and far from the camera.
|
|
void doDepthTest(float eyeDepth, float globeDepth) {
|
|
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
// Since discarding vertices is not possible, the vertex shader sets eyeDepth to 0 to indicate the depth test failed. Apply the discard here.
|
|
if (eyeDepth > -u_threePointDepthTestDistance) {
|
|
if (eyeDepth == 0.0) {
|
|
discard;
|
|
}
|
|
return;
|
|
}
|
|
#endif
|
|
bool useGlobeDepth = eyeDepth > -u_coarseDepthTestDistance;
|
|
if (useGlobeDepth && globeDepth == 0.0) {
|
|
// Pixel is not on the globe, so there is no distance to compare against. Pass.
|
|
return;
|
|
}
|
|
|
|
// If the camera is close, compare against the globe depth texture that includes depth from the 3D tile pass.
|
|
if (useGlobeDepth && getRelativeEyeDepth(eyeDepth, globeDepth, czm_epsilon1) < 0.0) {
|
|
discard;
|
|
}
|
|
}
|
|
|
|
#ifdef LOG_DEPTH
|
|
void writeDepth(float eyeDepth, float globeDepth, float distanceToEllipsoid) {
|
|
// If we've made it here, the manual depth test above determined that this fragment should be visible.
|
|
// But the automatic depth test must still run in order to write the result to the depth buffer, and its results may
|
|
// disagree with our manual depth test's results. To prefer our manual results when in front of the globe, apply an offset towards the camera.
|
|
|
|
float depthArg = v_depthFromNearPlusOne;
|
|
|
|
if (globeDepth != 0.0 && getRelativeEyeDepth(eyeDepth, distanceToEllipsoid, czm_epsilon3) > 0.0) {
|
|
float globeDepthFromNearPlusOne = (-globeDepth - czm_currentFrustum.x) + 1.0;
|
|
float nudge = max(globeDepthFromNearPlusOne * 5e-6, czm_epsilon7);
|
|
float globeOnTop = max(1.0, globeDepthFromNearPlusOne - nudge);
|
|
depthArg = min(depthArg, globeOnTop);
|
|
}
|
|
|
|
czm_writeLogDepth(depthArg);
|
|
}
|
|
#endif
|
|
|
|
void main()
|
|
{
|
|
if (v_splitDirectionAndEllipsoidDepthEC.x < 0.0 && gl_FragCoord.x > czm_splitPosition) {
|
|
discard;
|
|
}
|
|
if (v_splitDirectionAndEllipsoidDepthEC.x > 0.0 && gl_FragCoord.x < czm_splitPosition) {
|
|
discard;
|
|
}
|
|
|
|
if (getDepthTestEnabled()) {
|
|
vec2 fragSt = gl_FragCoord.xy / czm_viewport.zw;
|
|
float eyeDepth = v_compressed.x;
|
|
float globeDepth = getGlobeDepthAtCoords(fragSt);
|
|
float distanceToEllipsoid = -v_splitDirectionAndEllipsoidDepthEC.y;
|
|
doDepthTest(eyeDepth, globeDepth);
|
|
|
|
#ifdef LOG_DEPTH
|
|
writeDepth(eyeDepth, globeDepth, distanceToEllipsoid);
|
|
#endif
|
|
}
|
|
|
|
vec4 color = texture(u_atlas, v_textureCoordinates);
|
|
|
|
#ifdef SDF
|
|
float outlineWidth = v_outlineWidth;
|
|
vec4 outlineColor = v_outlineColor;
|
|
|
|
// Get the current distance
|
|
float distance = getDistance(v_textureCoordinates);
|
|
|
|
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
|
|
float smoothing = fwidth(distance);
|
|
// Get an offset that is approximately half the distance to the neighbor pixels
|
|
// 0.354 is approximately half of 1/sqrt(2)
|
|
vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
|
|
|
|
// Sample the center point
|
|
vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
|
|
|
|
// Sample the 4 neighbors
|
|
vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
|
|
|
|
// Equally weight the center sample and the 4 neighboring samples
|
|
color = (center + color1 + color2 + color3 + color4)/5.0;
|
|
#else
|
|
// If no derivatives available (IE 10?), just do a single sample
|
|
float smoothing = 1.0/32.0;
|
|
color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
|
|
#endif
|
|
|
|
color = czm_gammaCorrect(color);
|
|
#else
|
|
color = czm_gammaCorrect(color);
|
|
color *= czm_gammaCorrect(v_color);
|
|
#endif
|
|
|
|
// Fully transparent parts of the billboard are not pickable.
|
|
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
// The billboard is rendered twice. The opaque pass discards translucent fragments
|
|
// and the translucent pass discards opaque fragments.
|
|
#ifdef OPAQUE
|
|
if (color.a < 0.995) // matches < 254/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
if (color.a >= 0.995) // matches 254/255 and 255/255
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef VECTOR_TILE
|
|
color *= u_highlightColor;
|
|
#endif
|
|
out_FragColor = color;
|
|
}
|
|
`;var p3=`uniform float u_threePointDepthTestDistance;
|
|
in vec2 direction;
|
|
in vec4 positionHighAndScale;
|
|
in vec4 positionLowAndRotation;
|
|
in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset)
|
|
in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width
|
|
in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free
|
|
in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range)
|
|
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale
|
|
in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistanceSq, dimensions
|
|
in vec2 sdf; // sdf outline color (rgb) and width (w)
|
|
in float splitDirection; // splitDirection
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates
|
|
#endif
|
|
#ifdef VECTOR_TILE
|
|
in float a_batchId;
|
|
#endif
|
|
|
|
out vec2 v_textureCoordinates;
|
|
out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
flat out vec2 v_splitDirectionAndEllipsoidDepthEC; // x: splitDirection, y: ellipsoid depth in eye coordinates
|
|
#ifdef SDF
|
|
out vec4 v_outlineColor;
|
|
out float v_outlineWidth;
|
|
#endif
|
|
|
|
const float UPPER_BOUND = 32768.0;
|
|
|
|
const float SHIFT_LEFT16 = 65536.0;
|
|
const float SHIFT_LEFT12 = 4096.0;
|
|
const float SHIFT_LEFT8 = 256.0;
|
|
const float SHIFT_LEFT7 = 128.0;
|
|
const float SHIFT_LEFT5 = 32.0;
|
|
const float SHIFT_LEFT3 = 8.0;
|
|
const float SHIFT_LEFT2 = 4.0;
|
|
const float SHIFT_LEFT1 = 2.0;
|
|
|
|
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
|
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
const float SHIFT_RIGHT7 = 1.0 / 128.0;
|
|
const float SHIFT_RIGHT5 = 1.0 / 32.0;
|
|
const float SHIFT_RIGHT3 = 1.0 / 8.0;
|
|
const float SHIFT_RIGHT2 = 1.0 / 4.0;
|
|
const float SHIFT_RIGHT1 = 1.0 / 2.0;
|
|
|
|
vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
|
|
{
|
|
// Note the halfSize cannot be computed in JavaScript because it is sent via
|
|
// compressed vertex attributes that coerce it to an integer.
|
|
vec2 halfSize = imageSize * scale * 0.5;
|
|
halfSize *= ((direction * 2.0) - 1.0);
|
|
|
|
vec2 originTranslate = origin * abs(halfSize);
|
|
|
|
#if defined(ROTATION) || defined(ALIGNED_AXIS)
|
|
if (validAlignedAxis || rotation != 0.0)
|
|
{
|
|
float angle = rotation;
|
|
if (validAlignedAxis)
|
|
{
|
|
vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
|
|
angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
|
|
(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
|
|
}
|
|
|
|
float cosTheta = cos(angle);
|
|
float sinTheta = sin(angle);
|
|
rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
|
|
halfSize = rotationMatrix * halfSize;
|
|
}
|
|
else
|
|
{
|
|
rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
|
|
}
|
|
#endif
|
|
|
|
mpp = czm_metersPerPixel(positionEC);
|
|
positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
|
|
positionEC.xy += (translate + pixelOffset) * mpp;
|
|
|
|
return positionEC;
|
|
}
|
|
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
float getGlobeDepth(vec4 positionEC)
|
|
{
|
|
vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
|
|
|
|
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
|
|
|
|
if (globeDepth == 0.0)
|
|
{
|
|
return 0.0; // not on the globe
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
|
|
return eyeCoordinate.z / eyeCoordinate.w;
|
|
}
|
|
#endif
|
|
void main()
|
|
{
|
|
// Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition
|
|
|
|
// unpack attributes
|
|
vec3 positionHigh = positionHighAndScale.xyz;
|
|
vec3 positionLow = positionLowAndRotation.xyz;
|
|
float scale = positionHighAndScale.w;
|
|
|
|
#if defined(ROTATION) || defined(ALIGNED_AXIS)
|
|
float rotation = positionLowAndRotation.w;
|
|
#else
|
|
float rotation = 0.0;
|
|
#endif
|
|
|
|
float compressed = compressedAttribute0.x;
|
|
|
|
vec2 pixelOffset;
|
|
pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
|
|
compressed -= pixelOffset.x * SHIFT_LEFT7;
|
|
pixelOffset.x -= UPPER_BOUND;
|
|
|
|
vec2 origin;
|
|
origin.x = floor(compressed * SHIFT_RIGHT5);
|
|
compressed -= origin.x * SHIFT_LEFT5;
|
|
|
|
origin.y = floor(compressed * SHIFT_RIGHT3);
|
|
compressed -= origin.y * SHIFT_LEFT3;
|
|
|
|
origin -= vec2(1.0);
|
|
|
|
float show = floor(compressed * SHIFT_RIGHT2);
|
|
compressed -= show * SHIFT_LEFT2;
|
|
|
|
vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
|
|
vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
|
|
vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
|
|
|
|
float temp = compressedAttribute0.y * SHIFT_RIGHT8;
|
|
pixelOffset.y = -(floor(temp) - UPPER_BOUND);
|
|
|
|
vec2 translate;
|
|
translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
|
|
|
|
temp = compressedAttribute0.z * SHIFT_RIGHT8;
|
|
translate.x = floor(temp) - UPPER_BOUND;
|
|
translate.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)
|
|
|
|
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
|
|
translate.y -= UPPER_BOUND;
|
|
translate.y *= SHIFT_RIGHT2;
|
|
|
|
temp = compressedAttribute1.x * SHIFT_RIGHT8;
|
|
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
|
|
|
|
vec2 imageSize = vec2(floor(temp), temp2);
|
|
|
|
#ifdef 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
|
|
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
temp = compressedAttribute3.w;
|
|
temp = temp * SHIFT_RIGHT12;
|
|
|
|
vec2 dimensions;
|
|
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
|
|
dimensions.x = floor(temp);
|
|
#endif
|
|
|
|
#ifdef ALIGNED_AXIS
|
|
vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
|
|
temp = compressedAttribute2.z * SHIFT_RIGHT5;
|
|
bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
|
|
#else
|
|
vec3 alignedAxis = vec3(0.0);
|
|
bool validAlignedAxis = false;
|
|
#endif
|
|
|
|
vec4 color = czm_decodeRGB8(compressedAttribute2.x);
|
|
vec4 pickColor = czm_decodeRGB8(compressedAttribute2.y);
|
|
|
|
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.a /= 255.0;
|
|
|
|
color.a = floor(temp);
|
|
color.a /= 255.0;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
|
|
positionEC.xyz *= show;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
|
|
float lengthSq;
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
{
|
|
// 2D camera distance is a special case
|
|
// treat all billboards as flattened to the z=0.0 plane
|
|
lengthSq = czm_eyeHeight2D.y;
|
|
}
|
|
else
|
|
{
|
|
lengthSq = dot(positionEC.xyz, positionEC.xyz);
|
|
}
|
|
#endif
|
|
|
|
#ifdef EYE_DISTANCE_SCALING
|
|
float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
|
|
scale *= distanceScale;
|
|
translate *= distanceScale;
|
|
// push vertex behind near plane for clipping
|
|
if (scale == 0.0)
|
|
{
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
float translucency = 1.0;
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
|
|
// push vertex behind near plane for clipping
|
|
if (translucency == 0.0)
|
|
{
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
#ifdef EYE_DISTANCE_PIXEL_OFFSET
|
|
float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
|
|
pixelOffset *= pixelOffsetScale;
|
|
#endif
|
|
|
|
#ifdef DISTANCE_DISPLAY_CONDITION
|
|
float nearSq = compressedAttribute3.x;
|
|
float farSq = compressedAttribute3.y;
|
|
if (lengthSq < nearSq || lengthSq > farSq)
|
|
{
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
mat2 rotationMatrix;
|
|
float mpp;
|
|
|
|
float enableDepthCheck = 1.0;
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
float disableDepthTestDistanceSq = compressedAttribute3.z;
|
|
if (disableDepthTestDistanceSq == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
|
|
{
|
|
disableDepthTestDistanceSq = czm_minimumDisableDepthTestDistance;
|
|
}
|
|
|
|
if (lengthSq < disableDepthTestDistanceSq || disableDepthTestDistanceSq < 0.0)
|
|
{
|
|
enableDepthCheck = 0.0;
|
|
}
|
|
#endif
|
|
|
|
v_splitDirectionAndEllipsoidDepthEC.y = czm_infinity;
|
|
vec3 ellipsoidCenter = czm_view[3].xyz;
|
|
vec3 rayDirection = normalize(positionEC.xyz);
|
|
czm_ray ray = czm_ray(vec3(0.0), rayDirection);
|
|
vec3 ellipsoid_inverseRadii = czm_ellipsoidInverseRadii;
|
|
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
|
|
|
|
if (!czm_isEmpty(intersection))
|
|
{
|
|
v_splitDirectionAndEllipsoidDepthEC.y = intersection.start;
|
|
}
|
|
|
|
v_compressed.y = enableDepthCheck;
|
|
|
|
#ifdef VS_THREE_POINT_DEPTH_CHECK
|
|
if (lengthSq < (u_threePointDepthTestDistance * u_threePointDepthTestDistance) && (enableDepthCheck == 1.0)) {
|
|
float depthsilon = 10.0;
|
|
vec2 depthOrigin;
|
|
// Horizontal origin for labels comes from a special attribute. If that value is 0, this is a billboard - use the regular origin.
|
|
// Otherwise, transform the label origin to -1, 0, 1 (right, center, left).
|
|
depthOrigin.x = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
|
|
depthOrigin.x = czm_branchFreeTernary(depthOrigin.x == 0.0, origin.x, depthOrigin.x - 2.0);
|
|
depthOrigin.y = origin.y;
|
|
|
|
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
float globeDepth1 = getGlobeDepth(pEC1);
|
|
|
|
if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
|
|
{
|
|
vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
float globeDepth2 = getGlobeDepth(pEC2);
|
|
|
|
if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
|
|
{
|
|
vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), depthOrigin, vec2(0.0), pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
float globeDepth3 = getGlobeDepth(pEC3);
|
|
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
|
|
{
|
|
// "Discard" this vertex, as three key points fail depth test.
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
// Write out the eyespace depth before applying the screen space offset, but after potentially "discarding" the vertex
|
|
// by setting its eyespace position to zero, via the three-point depth test above.
|
|
v_compressed.x = positionEC.z;
|
|
|
|
positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
|
|
gl_Position = czm_projection * positionEC;
|
|
v_textureCoordinates = textureCoordinates;
|
|
|
|
#ifdef LOG_DEPTH
|
|
czm_vertexLogDepth();
|
|
#endif
|
|
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
|
|
if (disableDepthTestDistanceSq != 0.0)
|
|
{
|
|
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
|
|
float zclip = gl_Position.z / gl_Position.w;
|
|
bool clipped = (zclip < -1.0 || zclip > 1.0);
|
|
// disableDepthTestDistanceSq can be less than zero if it's explicitly set to -1 in JS (as a sentinel value equivalent to infinity)
|
|
if (!clipped && (disableDepthTestDistanceSq < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistanceSq)))
|
|
{
|
|
// Position z on the near plane.
|
|
gl_Position.z = -gl_Position.w;
|
|
#ifdef LOG_DEPTH
|
|
v_depthFromNearPlusOne = 1.0;
|
|
#endif
|
|
}
|
|
}
|
|
#endif
|
|
|
|
#ifdef SDF
|
|
vec4 outlineColor = czm_decodeRGB8(sdf.x);
|
|
float outlineWidth;
|
|
|
|
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.a /= 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_splitDirectionAndEllipsoidDepthEC.x = splitDirection;
|
|
}
|
|
`;var cZe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Ga=cZe;function gh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Ga.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(gh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Ga.LOADED}},hasImage:{get:function(){return this._loadState!==Ga.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});gh.prototype.unload=async function(){this._loadState!==Ga.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Ga.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};gh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,a=r.get(e);if(l(a)&&t.loadState===Ga.LOADING||t.loadState===Ga.LOADED){gh.clone(a,this);return}l(a)||(a=new gh(o),r.set(e,a)),a._id=this._id=e,a._loadState=this._loadState=Ga.LOADING,a._loadError=this._loadError=void 0;let s,c=this._billboardCollection.textureAtlas;try{s=c.addImage(e,t,n,i),s instanceof Promise&&(s=await s)}catch(f){if(a._loadState=Ga.ERROR,a._loadError=f,this._id!==e)return;this._loadState=Ga.ERROR,this._loadError=f;return}if(!l(s)||s===-1){if(a._loadState=Ga.FAILED,a._index=-1,this._id!==e)return;this._loadState=Ga.FAILED,this._index=-1;return}a._index=s,a._loadState=Ga.LOADED;let u=c.rectangles[s];a._width=u.width,a._height=u.height,this._id===e&&(this._index=s,this._loadState=Ga.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};gh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};gh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Ga.LOADING,i=await n}catch(o){this._loadState=Ga.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=Ga.LOADED,this.setImageSubRegion(i,t))};gh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Ga.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};gh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};gh.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 q_=gh;function Bi(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Ht.clone(o)),l(r)&&(r=Gt.clone(r)),this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=Q.clone(e.pixelOffset??Q.ZERO),this._translate=new Q(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??ot.NONE,this._verticalOrigin=e.verticalOrigin??Yn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Ni.CENTER,this._scale=e.scale??1,this._color=U.clone(e.color??U.WHITE),this._rotation=e.rotation??0,this._alignedAxis=d.clone(e.alignedAxis??d.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new q_(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let a=e.image;l(a)&&(this._computeImageTextureProperties(e.imageId,a),this._imageTexture.loadImage(this._imageId,a,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Qr.NONE,this._positionFromParent=!1}var kde=Bi.SHOW_INDEX=0,g3=Bi.POSITION_INDEX=1,Wde=Bi.PIXEL_OFFSET_INDEX=2,lZe=Bi.EYE_OFFSET_INDEX=3,uZe=Bi.HORIZONTAL_ORIGIN_INDEX=4,fZe=Bi.VERTICAL_ORIGIN_INDEX=5,dZe=Bi.SCALE_INDEX=6,Ude=Bi.IMAGE_INDEX_INDEX=7,zde=Bi.COLOR_INDEX=8,hZe=Bi.ROTATION_INDEX=9,mZe=Bi.ALIGNED_AXIS_INDEX=10,pZe=Bi.SCALE_BY_DISTANCE_INDEX=11,AZe=Bi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,gZe=Bi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,_Ze=Bi.DISTANCE_DISPLAY_CONDITION=14,yZe=Bi.DISABLE_DEPTH_DISTANCE=15;Bi.TEXTURE_COORDINATE_BOUNDS=16;var Gde=Bi.SDF_INDEX=17,CZe=Bi.SPLIT_DIRECTION_INDEX=18;Bi.NUMBER_OF_PROPERTIES=19;function Er(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(Bi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Er(this,kde))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),Er(this,g3))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Er(this,g3))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;Q.equals(t,e)||(Q.clone(e,t),Er(this,Wde))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ht.equals(t,e)||(this._scaleByDistance=Ht.clone(e,t),Er(this,pZe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ht.equals(t,e)||(this._translucencyByDistance=Ht.clone(e,t),Er(this,AZe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Ht.equals(t,e)||(this._pixelOffsetScaleByDistance=Ht.clone(e,t),Er(this,gZe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),Er(this,lZe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Er(this,uZe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Er(this,fZe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Er(this,dZe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Er(this,zde))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Er(this,hZe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),Er(this,mZe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Er(this,Ude))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Er(this,Ude))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Er(this,zde))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Er(this,_Ze))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Er(this,yZe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition),Er(this,g3)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Er(this,kde))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Er(this,Gde))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Er(this,Gde))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Er(this,CZe))}}});Bi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Bi.prototype._updateClamping=function(){Bi._updateClamping(this._billboardCollection,this)};var _3=new me;Bi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??te.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===ot.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===ot.NONE||t._positionFromParent||!l(t._position))return;l(t._removeCallbackFunc)&&t._removeCallbackFunc();let a=i.cartesianToCartographic(t._position);if(!l(a)){t._actualClampedPosition=void 0;return}function s(u){let f=i.cartographicToCartesian(u,t._clampedPosition);XI(t._heightReference)&&(t._mode===oe.SCENE3D?(u.height+=a.height,i.cartographicToCartesian(u,f)):f.x+=a.height),t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(a,s,t._heightReference),me.clone(a,_3);let c=n.getHeight(a,t._heightReference);l(c)&&(_3.height=c),s(_3)};Bi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Bi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Bi.prototype.setImageTexture=function(e){q_.clone(e,this._imageTexture)};var Vde=512;Bi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Jn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Jn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&EZe(n)&&(this._imageWidth=Math.min(this._width,Vde),this._imageHeight=Math.min(this._height,Vde))};function EZe(e){return l(e)?Am(e)?e.startsWith("data:image/svg+xml"):Ug(e)==="svg":!1}Bi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Bi.prototype._setTranslate=function(e){let t=this._translate;Q.equals(t,e)||(Q.clone(e,t),Er(this,Wde))};Bi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Bi.prototype._setActualPosition=function(e){l(this._clampedPosition)||d.clone(e,this._actualPosition),Er(this,g3)};var Hde=new ie;Bi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(P.multiplyByPoint(i,t,Hde),co.computeActualEllipsoidPosition(n,Hde))};var jde=new d;Bi._computeScreenSpacePosition=function(e,t,n,i,o,r){let a=P.multiplyByPoint(e,t,jde),s=co.worldWithEyeOffsetToWindowCoordinates(o,a,n,r);if(l(s))return Q.add(s,i,s),s};var A3=new Q(0,0);Bi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new Q),Q.clone(this._pixelOffset,A3),Q.add(A3,this._translate,A3);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let a=e.mapProjection,s=a.ellipsoid,c=a.unproject(o,_3);o=s.cartographicToCartesian(c,jde),i=P.IDENTITY}return Bi._computeScreenSpacePosition(i,o,this._eyeOffset,A3,e,t)};Bi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let a=t.x;e.horizontalOrigin===Ni.RIGHT?a-=i:e.horizontalOrigin===Ni.CENTER&&(a-=i*.5);let s=t.y;return e.verticalOrigin===Yn.BOTTOM||e.verticalOrigin===Yn.BASELINE?s-=o:e.verticalOrigin===Yn.CENTER&&(s-=o*.5),l(n)||(n=new et),n.x=a,n.y=s,n.width=i,n.height=o,n};Bi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&U.equals(this._color,e._color)&&Q.equals(this._pixelOffset,e._pixelOffset)&&Q.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Bi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Ro=Bi;var IZe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},nr=Object.freeze(IZe);var bZe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ys=Object.freeze(bZe);var xZe=Ro.SHOW_INDEX,TD=Ro.POSITION_INDEX,qde=Ro.PIXEL_OFFSET_INDEX,Kde=Ro.EYE_OFFSET_INDEX,TZe=Ro.HORIZONTAL_ORIGIN_INDEX,SZe=Ro.VERTICAL_ORIGIN_INDEX,wZe=Ro.SCALE_INDEX,ME=Ro.IMAGE_INDEX_INDEX,Xde=Ro.COLOR_INDEX,BZe=Ro.ROTATION_INDEX,DZe=Ro.ALIGNED_AXIS_INDEX,Jde=Ro.SCALE_BY_DISTANCE_INDEX,Zde=Ro.TRANSLUCENCY_BY_DISTANCE_INDEX,$de=Ro.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,ehe=Ro.DISTANCE_DISPLAY_CONDITION,vZe=Ro.DISABLE_DEPTH_DISTANCE,PZe=Ro.TEXTURE_COORDINATE_BOUNDS,the=Ro.SDF_INDEX,nhe=Ro.SPLIT_DIRECTION_INDEX,hK=Ro.NUMBER_OF_PROPERTIES,Mo={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 ud(e){e=e??V.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new KI),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(hK),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??nr.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW],this._highlightColor=U.clone(U.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??te.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??te.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(ud.prototype,{length:{get:function(){return mK(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function ihe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ud.prototype.add=function(e){let t=new Ro(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};ud.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ud.prototype.removeAll=function(){ihe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function mK(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 a=n[o];l(a)&&(a._index=r++,t.push(a))}e._billboards=t}}ud.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};ud.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};ud.prototype.get=function(e){return mK(this),this._billboards[e]};function Yde(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function RZe(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Re.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}ud.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<hK;++i){let o=n[i]===0?Re.STATIC_DRAW:Re.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function MZe(e,t,n,i,o){let r=[{index:Mo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[TD]},{index:Mo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[TD]},{index:Mo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[qde]},{index:Mo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[Zde]},{index:Mo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[Xde]},{index:Mo.eyeOffset,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[Kde]},{index:Mo.scaleByDistance,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[Jde]},{index:Mo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[$de]},{index:Mo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[ehe]},{index:Mo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[PZe]},{index:Mo.splitDirection,componentsPerAttribute:1,componentDatatype:j.FLOAT,usage:n[nhe]},{index:Mo.direction,componentsPerAttribute:2,componentDatatype:j.FLOAT,vertexBuffer:RZe(e)}];return l(i)&&r.push({index:Mo.a_batchId,componentsPerAttribute:1,componentDatatype:j.FLOAT,bufferUsage:Re.STATIC_DRAW}),o&&r.push({index:Mo.sdf,componentsPerAttribute:2,componentDatatype:j.FLOAT,usage:n[the]}),new Zg(e,r,t,!0)}var cK=new xn;function ohe(e,t,n,i){let o=n[Mo.positionHighAndScale],r=n[Mo.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),xn.fromCartesian(a,cK);let s=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,s);let u=cK.high,f=cK.low;o(i._index,u.x,u.y,u.z,s),r(i._index,f.x,f.y,f.z,c)}var K_=new Q,ld=32768,pK=65536,lK=4096,NE=256,NZe=128,LZe=32,OZe=8,y3=4,FZe=1/256,rhe=new et;function ahe(e,t,n,i){let o=n[Mo.compressedAttribute0],r=i.pixelOffset,a=r.x,s=r.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+u),Math.abs(-s+f));let h=i.horizontalOrigin,p=i._verticalOrigin,A=i.show&&i.clusterShow;i.color.alpha===0&&(A=!1),p===Yn.BASELINE&&(p=Yn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&h===Ni.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Yn.CENTER;let m=0,_=0;if(i.ready){let v=i.computeTextureCoordinates(rhe);m=v.x,_=v.y}let y=Math.floor(D.clamp(a,-ld,ld)+ld)*NZe;y+=(h+1)*LZe,y+=(p+1)*OZe,y+=(A?1:0)*y3;let C=Math.floor(D.clamp(s,-ld,ld)+ld)*NE,E=Math.floor(D.clamp(u*y3,-ld,ld)+ld)*NE,I=(D.clamp(f*y3,-ld,ld)+ld)*FZe,x=Math.floor(I),S=Math.floor((I-x)*NE);C+=x,E+=S,K_.x=m,K_.y=_;let w=tn.compressTextureCoordinates(K_);o(i._index,y,C,E,w)}function she(e,t,n,i){let o=n[Mo.compressedAttribute1],r=i.alignedAxis;d.equals(r,d.ZERO)||(e._shaderAlignedAxis=!0);let a=0,s=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let h=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,h);let p=D.clamp(h,0,pK),A=0;Math.abs(d.magnitudeSquared(r)-1)<D.EPSILON6&&(A=tn.octEncodeFloat(r)),s=D.clamp(s,0,1),s=s===1?255:s*255|0,p=p*NE+s,u=D.clamp(u,0,1),u=u===1?255:u*255|0,A=A*NE+u,o(i._index,p,A,a,c)}function fK(e,t,n,i){let o=n[Mo.compressedAttribute2],r=i.color,a=l(e._batchTable)?U.WHITE:i.getPickId(t.context).color,s=i.sizeInMeters?1:0,c=Math.abs(d.magnitudeSquared(i.alignedAxis)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&s===1;let u=i.height??0;e._maxSize=Math.max(e._maxSize,u);let f=i._labelHorizontalOrigin??-2;f+=2;let h=tn.encodeRGB8(r),p=tn.encodeRGB8(a),A=U.floatToByte(r.alpha)*pK+U.floatToByte(a.alpha)*NE+(s*2+c),m=u*y3+f;o(i._index,h,p,A,m)}function dK(e,t,n,i){let o=n[Mo.eyeOffset],r=i.eyeOffset,a=r.z;if(i._heightReference!==ot.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(r.x),Math.abs(r.y),Math.abs(a)),K_.x=0,K_.y=0,i.ready){let c=i.computeTextureCoordinates(rhe);K_.x=c.width,K_.y=c.height}let s=tn.compressTextureCoordinates(K_);o(i._index,r.x,r.y,a,s)}function che(e,t,n,i){let o=n[Mo.scaleByDistance],r=0,a=1,s=1,c=1,u=i.scaleByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderScaleByDistance=!0)),o(i._index,r,a,s,c)}function lhe(e,t,n,i){let o=n[Mo.pixelOffsetScaleByDistance],r=0,a=1,s=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),o(i._index,r,a,s,c)}function uhe(e,t,n,i){let o=n[Mo.compressedAttribute3],r=0,a=Number.MAX_VALUE,s=i.distanceDisplayCondition;l(s)&&(r=s.near,a=s.far,r*=r,a*=a,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=Hf(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,h;l(i._labelDimensions)?(h=i._labelDimensions.x,f=i._labelDimensions.y):(h=i.width??0,f=i.height??0);let p=Math.floor(D.clamp(h,0,lK)),A=Math.floor(D.clamp(f,0,lK)),m=p*lK+A;o(i._index,r,a,c,m)}function fhe(e,t,n,i){if(Hf(i.heightReference)){let s=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(s.globe)&&s.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let o=n[Mo.textureCoordinateBoundsOrLabelTranslate],r=0,a=0;l(i._labelTranslate)&&(r=i._labelTranslate.x,a=i._labelTranslate.y),o(i._index,r,a,0,0)}function QZe(e,t,n,i){if(!l(e._batchTable))return;let o=n[Mo.a_batchId],r=i._batchIndex;o(i._index,r)}function dhe(e,t,n,i){if(!e._sdf)return;let o=n[Mo.sdf],r=i.outlineColor,a=i.outlineWidth,s=tn.encodeRGB8(r),c=a/Ys.RADIUS,u=U.floatToByte(r.alpha)*pK+U.floatToByte(c)*NE;o(i._index,s,u)}function hhe(e,t,n,i){let o=n[Mo.splitDirection],r=0,a=i.splitDirection;l(a)&&(r=a),o(i._index,r)}function kZe(e,t,n,i){ohe(e,t,n,i),ahe(e,t,n,i),she(e,t,n,i),fK(e,t,n,i),dK(e,t,n,i),che(e,t,n,i),lhe(e,t,n,i),uhe(e,t,n,i),fhe(e,t,n,i),QZe(e,t,n,i),dhe(e,t,n,i),hhe(e,t,n,i)}function uK(e,t,n,i,o,r){let a;i.mode===oe.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=Ro._computeActualPosition(u,f,i,o);l(h)&&(u._setActualPosition(h),r?s.push(h):le.expand(a,h,a))}r&&le.fromPoints(s,a)}function UZe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!P.equals(r,e.modelMatrix)?(e._mode=n,P.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&uK(e,i,i.length,t,r,!0)):n===oe.MORPHING?uK(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&uK(e,o,e._billboardsToUpdateIndex,t,r,!1)}function zZe(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 GZe(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=Be.OVERLAY,i}var VZe=[];ud.prototype.update=function(e){if(mK(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Nt.maximumVertexTextureImageUnits>0))throw new de("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,o=!0;for(let v=0;v<i;++v){let R=n[v];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,ME),R.show&&(o=o&&R.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;UZe(this,e),n=this._billboards,i=n.length;let a=this._billboardsToUpdate,s=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,A=p.pick;if(f||!A&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<hK;++v)c[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=MZe(t,i,this._buffersUsage,this._batchTable,this._sdf),h=this._vaf.writers;for(let v=0;v<i;++v){let R=this._billboards[v];R._dirty=!1,R.textureDirty=!1,kZe(this,e,h,R)}this._vaf.commit(Yde(t))}this._billboardsToUpdateIndex=0}else if(s>0){let v=VZe;v.length=0,(c[TD]||c[BZe]||c[wZe])&&v.push(ohe),(c[ME]||c[qde]||c[TZe]||c[SZe]||c[xZe])&&(v.push(ahe),v.push(dK)),(c[ME]||c[DZe]||c[Zde])&&(v.push(she),v.push(fK)),(c[ME]||c[Xde])&&v.push(fK),(c[ME]||c[Kde])&&v.push(dK),c[Jde]&&v.push(che),c[$de]&&v.push(lhe),(c[ehe]||c[vZe]||c[ME]||c[TD])&&v.push(uhe),(c[ME]||c[TD])&&v.push(fhe),c[the]&&v.push(dhe),c[nhe]&&v.push(hhe);let R=v.length;if(h=this._vaf.writers,s/i>.1){for(let N=0;N<s;++N){let L=a[N];L._dirty=!1,L.textureDirty=!1;for(let g=0;g<R;++g)v[g](this,e,h,L)}this._vaf.commit(Yde(t))}else{for(let N=0;N<s;++N){let L=a[N];L._dirty=!1,L.textureDirty=!1;for(let g=0;g<R;++g)v[g](this,e,h,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(s>i*1.5&&(a.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,_=P.IDENTITY;e.mode===oe.SCENE3D?(_=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),zZe(this,e,m);let y=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,y){this._blendOption===nr.OPAQUE||this._blendOption===nr.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!0}):this._rsOpaque=void 0;let v=this._blendOption===nr.TRANSLUCENT;this._blendOption===nr.TRANSLUCENT||this._blendOption===nr.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:v?ee.LEQUAL:ee.LESS},depthMask:v,blending:sn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let C,E,I,x,S;if(y||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){C=p3,E=m3,S=["INSTANCED"],l(this._batchTable)&&(S.push("VECTOR_TILE"),C=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(C),E=this._batchTable.getFragmentShaderCallback(!1,void 0)(E)),I=new We({defines:S,sources:[C]}),this._shaderRotation&&I.defines.push("ROTATION"),this._shaderAlignedAxis&&I.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&I.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&I.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&I.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&I.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&I.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&I.defines.push("VS_THREE_POINT_DEPTH_CHECK");let v=1-Ys.CUTOFF;this._sdf&&I.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===nr.OPAQUE_AND_TRANSLUCENT&&(x=new We({defines:["OPAQUE",R],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Mo}),x=new We({defines:["TRANSLUCENT",R],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=$t.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Mo})),this._blendOption===nr.OPAQUE&&(x=new We({defines:[R],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Mo})),this._blendOption===nr.TRANSLUCENT&&(x=new We({defines:[R],sources:[E]}),this._shaderClampToGround&&x.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(x.defines.push("SDF"),x.defines.push(`SDF_EDGE ${v}`)),this._spTranslucent=$t.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:x,attributeLocations:Mo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let w=e.commandList;if(p.render||p.pick){let v=this._colorCommands,R=this._blendOption===nr.OPAQUE,N=this._blendOption===nr.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,g=L.length,b=this._uniforms,T;l(this._batchTable)?(b=this._batchTable.getUniformMapCallback()(b),T=this._batchTable.getPickId()):T="v_pickColor",v.length=g;let B=N?g*2:g;for(let M=0;M<B;++M){let O=v[M];l(O)||(O=v[M]=new it);let G=R||N&&M%2===0;O.pass=G||!N?Be.OPAQUE:Be.TRANSLUCENT,O.owner=this;let k=N?Math.floor(M/2):M;O.boundingVolume=m,O.modelMatrix=_,O.count=L[k].indicesCount,O.shaderProgram=G?this._sp:this._spTranslucent,O.uniformMap=b,O.vertexArray=L[k].va,O.renderState=G?this._rsOpaque:this._rsTranslucent,O.debugShowBoundingVolume=this.debugShowBoundingVolume,O.pickId=T,O.count=6,O.instanceCount=i,w.push(O)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=GZe(this,e.context)),w.push(this.debugCommand))}this._allBillboardsReady=o};ud.prototype.isDestroyed=function(){return!1};ud.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),ihe(this._billboards),fe(this)};var fd=ud;function HZe(e,t,n,i,o){return function(){let r=document.createElement("canvas"),a=o+2*i;r.height=r.width=a;let s=r.getContext("2d");return s.clearRect(0,0,a,a),i!==0&&(s.beginPath(),s.arc(a/2,a/2,a/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=n,s.fill(),e<1&&(s.save(),s.globalCompositeOperation="destination-out",s.beginPath(),s.arc(a/2,a/2,o/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle="black",s.fill(),s.restore())),s.beginPath(),s.arc(a/2,a/2,o/2,0,2*Math.PI,!0),s.closePath(),s.fillStyle=t,s.fill(),r}}var bx=HZe;var WZe=new me,_h=class{constructor(t,n,i,o,r){this._content=t,this._billboard=i,this._label=o,this._polyline=r,this._batchId=n,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),xx(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=U.clone(t,this._color),xx(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,xx(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),xx(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,xx(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,o=i.cartesianToCartographic(this._billboard.position,WZe);o.height=o.height-n+t;let r=i.cartographicToCartesian(o);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=U.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&xx(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return Vs.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};vn(_h,"defaultColor",U.WHITE),vn(_h,"defaultPointOutlineColor",U.BLACK),vn(_h,"defaultPointOutlineWidth",0),vn(_h,"defaultPointSize",8);function xx(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??_h.defaultColor,i=e._pointOutlineColor??_h.defaultPointOutlineColor,o=e._pointOutlineWidth??_h.defaultPointOutlineWidth,r=e._pointSize??_h.defaultPointSize,a=e._billboardColor,s=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(U.equals(n,a)&&U.equals(i,s)&&o===c&&r===u)return;e._billboardColor=U.clone(n,e._billboardColor),e._billboardOutlineColor=U.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),A=JSON.stringify([h,r,p,o]);t.setImage(A,bx(f,h,p,o,r))}var X_=_h;function jZe(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let o=Math.round(n.actualBoundingBoxAscent),r=Math.round(n.actualBoundingBoxDescent),a=Math.max(o+r,1);return{width:n.width,height:a,ascent:o,descent:r,minx:-Math.round(n.actualBoundingBoxLeft)}}var LE;function YZe(e,t){if(e==="")return;t=t??V.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,a=t.backgroundColor??U.TRANSPARENT,s=t.padding??0,c=s*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(LE)||(l(f.imageSmoothingEnabled)?LE="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?LE="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?LE="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(LE="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[LE]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=jZe(f,e);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),A=i&&!p?Math.ceil(r/2):0,m=A*2,_=-h.minx+A,y=Math.ceil(h.width)+_+c+A,C=h.height+c+m,E=h.ascent+s+A;if(u.width=y,u.height=C,f.font=n,f.lineJoin="round",f.lineWidth=r,f[LE]=!1,a!==U.TRANSPARENT&&(f.fillStyle=a.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let I=t.strokeColor??U.BLACK;f.strokeStyle=I.toCssColorString(),f.strokeText(e,_+s,E)}if(o){let I=t.fillColor??U.WHITE;f.fillStyle=I.toCssColorString(),f.fillText(e,_+s,E)}return u}var Tx=YZe;var The=Na(ghe(),1);var KZe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Ir=Object.freeze(KZe);var _he={},yhe=0,XZe=256,JZe=new U(.165,.165,.165,.8),ZZe=new Q(7,5),Va=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function OE(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function wD(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function BD(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Ehe(e){let t=_he[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(BD(n,"line-height"));isNaN(i)&&(i=void 0),t={family:BD(n,"font-family"),size:BD(n,"font-size").replace("px",""),style:BD(n,"font-style"),weight:BD(n,"font-weight"),lineHeight:i},document.body.removeChild(n),yhe<XZe&&(_he[e._font]=t,yhe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function yh(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Ht.clone(o)),l(r)&&(r=Gt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=U.clone(e.fillColor??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=U.clone(e.backgroundColor??JZe),this._backgroundPadding=Q.clone(e.backgroundPadding??ZZe),this._style=e.style??Ir.FILL,this._verticalOrigin=e.verticalOrigin??Yn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Ni.LEFT,this._pixelOffset=Q.clone(e.pixelOffset??Q.ZERO),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._position=d.clone(e.position??d.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??ot.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,Ehe(this),this._updateClamping()}Object.defineProperties(yh.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o].billboard;l(a)&&(a.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),wD(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=yh.filterUnsupportedCharacters(e);this._renderedText=yh.enableRightToLeftDetection?o$e(t):t,OE(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,OE(this),Ehe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),OE(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),OE(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,OE(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,OE(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!U.equals(t,e)){U.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;Q.equals(t,e)||(Q.clone(e,t),wD(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,OE(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!Q.equals(t,e)){Q.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Ht.equals(t,e)){this._translucencyByDistance=Ht.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Ht.equals(t,e)){this._pixelOffsetScaleByDistance=Ht.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Ht.equals(t,e)){this._scaleByDistance=Ht.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let a=n[o];l(a.billboard)&&(a.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wD(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),wD(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),wD(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Gt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});yh.prototype._updateClamping=function(){Ro._updateClamping(this._labelCollection,this)};yh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new Q);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Ro._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};yh.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,a=0,s=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*s,a=c.height*s,e.verticalOrigin===Yn.BOTTOM||e.verticalOrigin===Yn.BASELINE?o-=a:e.verticalOrigin===Yn.CENTER&&(o-=a*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let A=0;A<p;++A){let m=h[A],_=m.billboard;if(!l(_))continue;let y=t.x+_._translate.x,C=t.y-_._translate.y,E=m.dimensions.width*s,I=m.dimensions.height*s;e.verticalOrigin===Yn.BOTTOM||e.verticalOrigin===Yn.BASELINE?C-=I:e.verticalOrigin===Yn.CENTER&&(C-=I*.5),e._verticalOrigin===Yn.TOP?C+=Ys.PADDING*s:(e._verticalOrigin===Yn.BOTTOM||e._verticalOrigin===Yn.BASELINE)&&(C-=Ys.PADDING*s),i=Math.min(i,y),o=Math.min(o,C),u=Math.max(u,y+E),f=Math.max(f,C+I)}r=u-i,a=f-o}return l(n)||(n=new et),n.x=i,n.y=o,n.width=r,n.height=a,n};yh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};yh.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&d.equals(this._position,e._position)&&U.equals(this._fillColor,e._fillColor)&&U.equals(this._outlineColor,e._outlineColor)&&U.equals(this._backgroundColor,e._backgroundColor)&&Q.equals(this._backgroundPadding,e._backgroundPadding)&&Q.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};yh.prototype.isDestroyed=function(){return!1};yh.enableRightToLeftDetection=!1;function $Ze(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",a=Va.LTR,s="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?s=Va.RTL:n.test(f)?s=Va.LTR:i.test(f)?s=Va.BRACKETS:s=Va.WEAK,u===0&&(a=s),a===s&&s!==Va.BRACKETS?r+=f:(r!==""&&o.push({Type:a,Word:r}),a=s,r=f)}return o.push({Type:s,Word:r}),o}function e$e(e){return e.split("").reverse().join("")}function DD(e,t,n){return e.slice(0,t)+n+e.slice(t)}function t$e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var n$e="\u05D0-\u05EA",i$e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Che=new RegExp(`[${n$e}${i$e}]`);function o$e(e){let t=e.split(`
|
|
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Che.test(o.charAt(0)),a=$Ze(o,Che),s=0,c="";for(let u=0;u<a.length;++u){let f=a[u],h=f.Type===Va.BRACKETS?t$e(f.Word):e$e(f.Word);r?f.Type===Va.RTL?(c=h+c,s=0):f.Type===Va.LTR?(c=DD(c,s,f.Word),s+=f.Word.length):(f.Type===Va.WEAK||f.Type===Va.BRACKETS)&&(f.Type===Va.WEAK&&a[u-1].Type===Va.BRACKETS?c=h+c:a[u-1].Type===Va.RTL?(c=h+c,s=0):a.length>u+1?a[u+1].Type===Va.RTL?(c=h+c,s=0):(c=DD(c,s,f.Word),s+=f.Word.length):c=DD(c,0,h)):f.Type===Va.RTL?c=DD(c,s,h):f.Type===Va.LTR?(c+=f.Word,s=c.length):(f.Type===Va.WEAK||f.Type===Va.BRACKETS)&&(u>0&&a[u-1].Type===Va.RTL?a.length>u+1?a[u+1].Type===Va.RTL?c=DD(c,s,h):(c+=f.Word,s=c.length):c+=f.Word:(c+=f.Word,s=c.length))}n+=c,i<t.length-1&&(n+=`
|
|
`)}return n}var FE=yh;var She=Na(Ihe(),1);function a$e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var s$e=1.2,bhe="ID_WHITE_PIXEL",AK=new Q(4,4),c$e=new et(1,1,1,1);function l$e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=AK.x,o.height=AK.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(bhe,o),n.addImageSubRegion(bhe,c$e)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new Q,i}var MA={};function u$e(e,t,n,i,o,r){return MA.font=t,MA.fillColor=n,MA.strokeColor=i,MA.strokeWidth=o,MA.padding=Ys.PADDING,MA.fill=r===Ir.FILL||r===Ir.FILL_AND_OUTLINE,MA.stroke=r===Ir.OUTLINE||r===Ir.FILL_AND_OUTLINE,MA.backgroundColor=U.BLACK,Tx(e,MA)}function gK(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var f$e=new She.default,d$e=/\s/;function h$e(e,t){let n=t._renderedText,i=f$e.splitGraphemes(n),o=i.length,r=t._glyphs,a=r.length;if(t._relativeSize=t._fontSize/Ys.FONT_SIZE,o<a)for(let p=o;p<a;++p)gK(e,r[p]);r.length=o;let s=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(s)&&(s=l$e(c,e),t._backgroundBillboard=s),m$e(c,t,s);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,h=e._textDimensionsCache;for(let p=0;p<o;++p){let A=i[p],m=t._verticalOrigin,_=JSON.stringify([A,t._fontFamily,t._fontStyle,t._fontWeight,+m]),y=h[_],C=f.get(_);if(!l(C)||!l(y)){C=new q_(u),f.set(_,C);let S=`${t._fontStyle} ${t._fontWeight} ${Ys.FONT_SIZE}px ${t._fontFamily}`,w=u$e(A,S,U.WHITE,U.WHITE,0,Ir.FILL);if(y=w.dimensions,h[_]=y,w.width>0&&w.height>0&&!d$e.test(A)){let v=(0,The.default)(w,{cutoff:Ys.CUTOFF,radius:Ys.RADIUS}),R=w.getContext("2d"),N=w.width,L=w.height,g=R.getImageData(0,0,N,L);for(let b=0;b<N;b++)for(let T=0;T<L;T++){let B=T*N+b,M=v[B]*255,O=B*4;g.data[O+0]=M,g.data[O+1]=M,g.data[O+2]=M,g.data[O+3]=M}R.putImageData(g,0,0),C.loadImage(_,w)}}let E=r[p];if(l(E)||(E=new a$e,E.dimensions=y,E.billboardTexture=C,r[p]=E),E.billboardTexture.id!==_&&(E.billboardTexture=C,E.dimensions=y),!C.hasImage){gK(e,E);continue}let I=E.billboard,x=e._spareBillboards;l(I)||(x.length>0?I=x.pop():(I=u.add({collection:e}),I._labelDimensions=new Q,I._labelTranslate=new Q,I._positionFromParent=!0),E.billboard=I),I.setImageTexture(C),I.show=t._show,I.position=t._position,I.eyeOffset=t._eyeOffset,I.pixelOffset=t._pixelOffset,I.horizontalOrigin=Ni.LEFT,I.verticalOrigin=t._verticalOrigin,I.heightReference=t._heightReference,l(t._clampedPosition)&&(I._clampedPosition=t._clampedPosition),I.scale=t.totalScale,I.pickPrimitive=t,I.id=t._id,I.translucencyByDistance=t._translucencyByDistance,I.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,I.scaleByDistance=t._scaleByDistance,I.distanceDisplayCondition=t._distanceDisplayCondition,I.disableDepthTestDistance=t._disableDepthTestDistance,I._batchIndex=t._batchIndex,I.outlineColor=t.outlineColor,t.style===Ir.FILL_AND_OUTLINE?(I.color=t._fillColor,I.outlineWidth=t.outlineWidth):t.style===Ir.FILL?(I.color=t._fillColor,I.outlineWidth=0):t.style===Ir.OUTLINE&&(I.color=U.TRANSPARENT,I.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function m$e(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(`
|
|
`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=n=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Ni.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function xhe(e,t,n){return t===Ni.CENTER?-e/2:t===Ni.RIGHT?-(e+n.x):n.x}var Rr=new Q,p$e=new Q;function A$e(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],a=Number.NEGATIVE_INFINITY,s=0,c=1,u=t.length,f=e._backgroundBillboard,h=Q.clone(l(f)?e._backgroundPadding:Q.ZERO,p$e);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let N=0;N<u;++N){if(n.charAt(N)===`
|
|
`){r.push(i),++c,i=0;continue}let g=t[N].dimensions;l(g)&&(s=Math.max(s,g.height-g.descent),a=Math.max(a,g.descent),i+=g.width-g.minx,N<u-1&&(i+=t[N+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=s+a,A=e.totalScale,m=e._horizontalOrigin,_=e._verticalOrigin,y=0,C=r[y],E=xhe(C,m,h),I=(l(e._lineHeight)?e._lineHeight:s$e*e._fontSize)/e._relativeSize,x=I*(c-1),S=o,w=p+x;l(f)&&(S+=h.x*2,w+=h.y*2,f._labelHorizontalOrigin=m),Rr.x=E*A,Rr.y=0;let v=!0,R=0;for(let N=0;N<u;++N){if(n.charAt(N)===`
|
|
`){++y,R+=I,C=r[y],E=xhe(C,m,h),Rr.x=E*A,v=!0;continue}let L=t[N],g=L.dimensions;if(l(g)&&(_===Yn.TOP?(Rr.y=g.height-s-h.y,Rr.y+=Ys.PADDING):_===Yn.CENTER?Rr.y=(x+g.height-s)/2:_===Yn.BASELINE?(Rr.y=x,Rr.y-=Ys.PADDING):(Rr.y=x+a+h.y,Rr.y-=Ys.PADDING),Rr.y=(Rr.y-g.descent-R)*A,v&&(Rr.x-=Ys.PADDING*A,v=!1),l(L.billboard)&&(L.billboard._setTranslate(Rr),L.billboard._labelDimensions.x=S,L.billboard._labelDimensions.y=w,L.billboard._labelHorizontalOrigin=m,Hf(e.heightReference)&&(L.billboard._labelTranslate=Q.clone(Rr,L.billboard._labelTranslate))),N<u-1)){let b=t[N+1];Rr.x+=(g.width-g.minx+b.dimensions.minx)*A}}l(f)&&n.split(`
|
|
`).join("").length>0&&(m===Ni.CENTER?E=-o/2-h.x:m===Ni.RIGHT?E=-(o+h.x*2):E=0,Rr.x=E*A,_===Yn.TOP?Rr.y=p-s-a:_===Yn.CENTER?Rr.y=(p-s)/2-a:_===Yn.BASELINE?Rr.y=-h.y-a:Rr.y=0,Rr.y=Rr.y*A,f.width=S,f.height=w,f._setTranslate(Rr),f._labelTranslate=Q.clone(Rr,f._labelTranslate))}function whe(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)gK(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),fe(t)}function op(e){e=e??V.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new fd({scene:this._scene,textureAtlas:new KI({initialSize:AK}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new q_(t),this._glyphBillboardCollection=new fd({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=U.clone(U.WHITE),this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??nr.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(op.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});op.prototype.add=function(e){let t=new FE(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};op.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),whe(this,e),!0}return!1};op.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)whe(this,e[t]);e.length=0};op.prototype.contains=function(e){return l(e)&&e._labelCollection===this};op.prototype.get=function(e){return this._labels[e]};op.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 a=this._labelsToUpdate[r];if(a.isDestroyed())continue;let s=a._glyphs.length;a._rebindAllGlyphs&&(h$e(this,a),a._rebindAllGlyphs=!1),a._repositionAllGlyphs&&(A$e(a),a._repositionAllGlyphs=!1);let c=a._glyphs.length-s;this._totalGlyphCount+=c}let o=n.length>0?nr.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)};op.prototype.isDestroyed=function(){return!1};op.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),fe(this)};var NA=op;var E3=`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 Bl={};Bl.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};Bl.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 g$e=new me;Bl.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,g$e).height}return i};var _$e=new P,y$e=new d,Bhe=new d,C$e=new cn(d.UNIT_X,0),Dhe=new d,E$e=new cn(d.UNIT_X,0),I$e=new d,b$e=new d,yK=[];function Phe(e,t,n){let i=yK;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let a=(n-t)/e;for(o=0;o<e;o++){let s=t+o*a;i[o]=s}return i}var b3=new me,I3=new me,J_=new d,CK=new d,x$e=new d,_K=new i_,vD=new Oc;function T$e(e,t,n,i,o,r,a,s){let c=i.scaleToGeodeticSurface(e,CK),u=i.scaleToGeodeticSurface(t,x$e),f=Bl.numberOfPoints(e,t,n),h=i.cartesianToCartographic(c,b3),p=i.cartesianToCartographic(u,I3),A=Phe(f,o,r);_K.setEndPoints(h,p);let m=_K.surfaceDistance/f,_=s;h.height=o;let y=i.cartographicToCartesian(h,J_);d.pack(y,a,_),_+=3;for(let C=1;C<f;C++){let E=_K.interpolateUsingSurfaceDistance(C*m,I3);E.height=A[C],y=i.cartographicToCartesian(E,J_),d.pack(y,a,_),_+=3}return _}function S$e(e,t,n,i,o,r,a,s){let c=i.cartesianToCartographic(e,b3),u=i.cartesianToCartographic(t,I3),f=Bl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let h=Phe(f,o,r);vD.ellipsoid.equals(i)||(vD=new Oc(void 0,void 0,i)),vD.setEndPoints(c,u);let p=vD.surfaceDistance/f,A=s;c.height=o;let m=i.cartographicToCartesian(c,J_);d.pack(m,a,A),A+=3;for(let _=1;_<f;_++){let y=vD.interpolateUsingSurfaceDistance(_*p,I3);y.height=h[_],m=i.cartographicToCartesian(y,J_),d.pack(m,a,A),A+=3}return A}Bl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??P.IDENTITY;let o=P.inverseTransformation(t,_$e),r=P.multiplyByPoint(o,d.ZERO,y$e),a=d.normalize(P.multiplyByPointAsVector(o,d.UNIT_Y,Bhe),Bhe),s=cn.fromPointNormal(r,a,C$e),c=d.normalize(P.multiplyByPointAsVector(o,d.UNIT_X,Dhe),Dhe),u=cn.fromPointNormal(r,c,E$e),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let A=1;A<p;++A){let m=e[A];if(cn.getPointDistance(u,h)<0||cn.getPointDistance(u,m)<0){let _=di.lineSegmentPlane(h,m,s,I$e);if(l(_)){let y=d.multiplyByScalar(a,5e-9,b$e);cn.getPointDistance(s,h)<0&&d.negate(y,y),n.push(d.add(_,y,new d)),i.push(f+1),d.negate(y,y),n.push(d.add(_,y,new d)),f=1}}n.push(d.clone(e[A])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};Bl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let _=i.scaleToGeodeticSurface(t[0],CK);if(o=r?o[0]:o,o!==0){let y=i.geodeticSurfaceNormal(_,J_);d.multiplyByScalar(y,o,y),d.add(_,y,_)}return[_.x,_.y,_.z]}let a=e.minDistance;if(!l(a)){let _=e.granularity??D.RADIANS_PER_DEGREE;a=D.chordLength(_,i.maximumRadius)}let s=0,c;for(c=0;c<n-1;c++)s+=Bl.numberOfPoints(t[c],t[c+1],a);let u=(s+1)*3,f=new Array(u),h=0;for(c=0;c<n-1;c++){let _=t[c],y=t[c+1],C=r?o[c]:o,E=r?o[c+1]:o;h=T$e(_,y,a,i,C,E,f,h)}yK.length=0;let p=t[n-1],A=i.cartesianToCartographic(p,b3);A.height=r?o[n-1]:o;let m=i.cartographicToCartesian(A,J_);return d.pack(m,f,u-3),f};var vhe=new me,w$e=new me;Bl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??te.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let C=i.scaleToGeodeticSurface(t[0],CK);if(o=r?o[0]:o,o!==0){let E=i.geodeticSurfaceNormal(C,J_);d.multiplyByScalar(E,o,E),d.add(C,E,C)}return[C.x,C.y,C.z]}let a=e.granularity??D.RADIANS_PER_DEGREE,s=0,c,u=i.cartesianToCartographic(t[0],vhe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],w$e),s+=Bl.numberOfPointsRhumbLine(u,f,a),u=me.clone(f,vhe);let h=(s+1)*3,p=new Array(h),A=0;for(c=0;c<n-1;c++){let C=t[c],E=t[c+1],I=r?o[c]:o,x=r?o[c+1]:o;A=S$e(C,E,a,i,I,x,p,A)}yK.length=0;let m=t[n-1],_=i.cartesianToCartographic(m,b3);_.height=r?o[n-1]:o;let y=i.cartographicToCartesian(_,J_);return d.pack(y,p,h-3),p};Bl.generateCartesianArc=function(e){let t=Bl.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};Bl.generateCartesianRhumbArc=function(e){let t=Bl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var to=Bl;function ef(e,t){e=e??V.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Xi.fromType(Xi.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=jo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=P.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=to.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Mhe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var Rhe=ef.POSITION_INDEX=0,B$e=ef.SHOW_INDEX=1,D$e=ef.WIDTH_INDEX=2,v$e=ef.MATERIAL_INDEX=3,PD=ef.POSITION_SIZE_INDEX=4,P$e=ef.DISTANCE_DISPLAY_CONDITION=5,Mhe=ef.NUMBER_OF_PROPERTIES=6;function LA(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(ef.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,LA(this,B$e))}},positions:{get:function(){return this._positions},set:function(e){let t=jo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&LA(this,PD),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),LA(this,Rhe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,LA(this,v$e))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,LA(this,D$e))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,LA(this,PD)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),LA(this,P$e))}}});ef.prototype.update=function(){let e=P.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[Rhe]>0||this._propertiesChanged[PD]>0;if((!P.equals(e,this._modelMatrix)||i)&&(this._segments=to.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=P.clone(e,this._modelMatrix),this._segments.positions.length!==t)LA(this,PD);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){LA(this,PD);break}}};ef.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};ef.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Mhe-1;++t)e[t]=0};ef.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Ch=ef;var R$e=Ch.SHOW_INDEX,M$e=Ch.WIDTH_INDEX,IK=Ch.POSITION_INDEX,N$e=Ch.MATERIAL_INDEX,Nhe=Ch.POSITION_SIZE_INDEX,L$e=Ch.DISTANCE_DISPLAY_CONDITION,zhe=Ch.NUMBER_OF_PROPERTIES,mu={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 Eh(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.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(zhe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Re.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=U.clone(U.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Eh.prototype,{length:{get:function(){return bK(this),this._polylines.length}}});Eh.prototype.add=function(e){let t=new Ch(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Eh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Eh.prototype.removeAll=function(){xK(this),jhe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Eh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Eh.prototype.get=function(e){return bK(this),this._polylines[e]};function O$e(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:j.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:j.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:j.FLOAT,componentsPerAttribute:2}];e._batchTable=new nb(t,n,e._polylines.length)}var Ghe=new xn,Vhe=new ie,Hhe=new Q;Eh.prototype.update=function(e){if(bK(this),this._polylines.length===0||!this.show)return;G$e(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(Nt.maximumVertexTextureImageUnits===0)throw new ue("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");O$e(this,t),this._createBatchTable=!1}if(this._createVertexArray||Q$e(this))Fhe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(o[Nhe]||o[N$e])Fhe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=c[h],o=i._propertiesChanged;let p=i._bucket,A=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[IK]&&p.writeUpdate(A,i,this._positionBuffer,n);break}A+=f[m].lengthOfPositions}if((o[R$e]||o[M$e])&&this._batchTable.setBatchedAttribute(i._index,0,new Q(i._width,i._show)),this._batchTable.attributes.length>2){if(o[IK]||o[Nhe]){let m=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,_=xn.fromCartesian(m.center,Ghe),y=ie.fromElements(_.low.x,_.low.y,_.low.z,m.radius,Vhe);this._batchTable.setBatchedAttribute(i._index,2,_.high),this._batchTable.setBatchedAttribute(i._index,3,y)}if(o[L$e]){let m=Hhe;m.x=0,m.y=Number.MAX_VALUE;let _=i.distanceDisplayCondition;l(_)&&(m.x=_.near,m.y=_.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<zhe;++c)o[c]=0;let r=P.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let a=e.passes,s=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==s)&&(this._opaqueRS=Ve.fromCache({depthMask:s,depthTest:{enabled:s}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==s)&&(this._translucentRS=Ve.fromCache({blending:sn.ALPHA_BLEND,depthMask:!s,depthTest:{enabled:s}})),this._batchTable.update(e),a.render||a.pick){let c=this._colorCommands;F$e(this,e,c,r)}};var RD=new le,Lhe=new le;function F$e(e,t,n,i){let o=t.context,r=t.commandList,a=n.length,s=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),A=u.length;for(let m=0;m<A;++m){let _=u[m],y=_.buckets,C=y.length;for(let E=0;E<C;++E){let I=y[E],x=I.offset,S=I.bucket.shaderProgram,w=I.bucket.polylines,v=w.length,R,N,L=0,g,b;for(let T=0;T<v;++T){let B=w[T],M=U$e(B._material);if(M!==R){if(l(R)&&L>0){let z=N.isTranslucent();s>=a?(g=new it({owner:e}),n.push(g)):g=n[s],++s,b=Pt(p(N._uniforms),e._uniformMap),g.boundingVolume=le.clone(RD,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=_.va,g.renderState=z?e._translucentRS:e._opaqueRS,g.pass=z?Be.TRANSLUCENT:Be.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=b,g.count=L,g.offset=x,x+=L,L=0,c=!0,r.push(g)}N=B._material,N.update(o),R=M}let O=B._locatorBuckets,G=O.length;for(let z=0;z<G;++z){let F=O[z];F.locator===I&&(L+=F.count)}let k;t.mode===oe.SCENE3D?k=B._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?k=B._boundingVolume2D:t.mode===oe.SCENE2D?l(B._boundingVolume2D)&&(k=le.clone(B._boundingVolume2D,Lhe),k.center.x=0):l(B._boundingVolumeWC)&&l(B._boundingVolume2D)&&(k=le.union(B._boundingVolumeWC,B._boundingVolume2D,Lhe)),c?(c=!1,le.clone(k,RD)):le.union(k,RD,RD)}l(R)&&L>0&&(s>=a?(g=new it({owner:e}),n.push(g)):g=n[s],++s,b=Pt(p(N._uniforms),e._uniformMap),g.boundingVolume=le.clone(RD,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=S,g.vertexArray=_.va,g.renderState=N.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=N.isTranslucent()?Be.TRANSLUCENT:Be.OPAQUE,g.debugShowBoundingVolume=f,g.pickId="v_pickColor",g.uniformMap=b,g.count=L,g.offset=x,c=!0,r.push(g)),R=void 0}}n.length=s}Eh.prototype.isDestroyed=function(){return!1};Eh.prototype.destroy=function(){return Whe(this),xK(this),jhe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};function Q$e(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[IK]?(i.bufferUsage!==Re.STREAM_DRAW&&(t=!0,i.bufferUsage=Re.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Re.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Re.STATIC_DRAW):i.frameCount--),t}var Ohe=[0,0,0];function Fhe(e,t,n){e._createVertexArray=!1,xK(e),Whe(e),z$e(e);let i=[[]],o=i[0],r=e._batchTable,a=e._useHighlightColor,s=[0],c=0,u=[[]],f=0,h=e._polylineBuckets,p,A;for(p in h)h.hasOwnProperty(p)&&(A=h[p],A.updateShader(t,r,a),f+=A.lengthOfPositions);if(f>0){let m=e._mode,_=new Float32Array(6*f*3),y=new Float32Array(f*4),C,E=0,I=0,x=0;for(p in h)if(h.hasOwnProperty(p)){A=h[p],A.write(_,y,E,I,x,r,t,n),m===oe.MORPHING&&(l(C)||(C=new Float32Array(6*f*3)),A.writeForMorph(C,E));let b=A.lengthOfPositions;E+=6*b*3,I+=b*4,x+=b*4,c=A.updateIndices(i,s,u,c)}let S=e._positionBufferUsage.bufferUsage,w=Re.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:_,usage:S});let v;l(C)&&(v=tt.createVertexBuffer({context:t,typedArray:C,usage:S})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:w});let R=3*Float32Array.BYTES_PER_ELEMENT,N=4*Float32Array.BYTES_PER_ELEMENT,L=0,g=i.length;for(let b=0;b<g;++b)if(o=i[b],o.length>0){let T=new Uint16Array(o),B=tt.createIndexBuffer({context:t,typedArray:T,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});L+=s[b];let M=6*(b*(R*D.SIXTY_FOUR_KILOBYTES)-L*R),O=R+M,G=R+O,k=R+G,z=R+k,F=R+z,H=b*(N*D.SIXTY_FOUR_KILOBYTES)-L*N,Y=[{index:mu.position3DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:mu.position3DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:O,strideInBytes:6*R},{index:mu.position2DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:mu.position2DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:O,strideInBytes:6*R},{index:mu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:mu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:mu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:G,strideInBytes:6*R},{index:mu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:mu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:mu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:mu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:z,strideInBytes:6*R},{index:mu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:j.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:mu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:j.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:H}],$,W,K,Z;m===oe.SCENE3D?(W=e._positionBuffer,$="vertexBuffer",K=Ohe,Z="value"):m===oe.SCENE2D||m===oe.COLUMBUS_VIEW?(W=Ohe,$="value",K=e._positionBuffer,Z="vertexBuffer"):(W=v,$="vertexBuffer",K=e._positionBuffer,Z="vertexBuffer"),Y[0][$]=W,Y[1][$]=W,Y[2][Z]=K,Y[3][Z]=K,Y[4][$]=W,Y[5][$]=W,Y[6][Z]=K,Y[7][Z]=K,Y[8][$]=W,Y[9][$]=W,Y[10][Z]=K,Y[11][Z]=K;let pe=new Vn({context:t,attributes:Y,indexBuffer:B});e._vertexArrays.push({va:pe,buckets:u[b]})}}}function k$e(e,t){return t instanceof vt?t.id:t}var x3=[];function U$e(e){let t=Xi._uniformList[e.type],n=t.length;x3.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];x3[i]=r,x3[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(x3,k$e)}`}function z$e(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let a=0;a<r;++a){let s=o[a];if(s._actualPositions.length>1){s.update();let c=s.material,u=i[c.type];l(u)||(u=i[c.type]=new rp(c,t,n)),u.addPolyline(s)}}}function G$e(e,t){let n=t.mode;(e._mode!==n||!P.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=P.clone(e.modelMatrix),e._createVertexArray=!0)}function bK(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let a=0;a<r;++a)o=e._polylines[a],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function xK(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function Whe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Eh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function jhe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function EK(e,t,n){this.count=e,this.offset=t,this.bucket=n}function rp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}rp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};rp.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let o=new We({defines:i,sources:[`in vec4 v_pickColor;
|
|
`,this.material.shaderSource,cb]}),r=t.getVertexShaderCallback()(E3),a=new We({defines:i,sources:[$l,r]});this.shaderProgram=$t.fromCache({context:e,vertexShaderSource:a,fragmentShaderSource:o,attributeLocations:mu})};function Yhe(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===Xt.INTERSECTING}rp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!Yhe(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 as=new d,dd=new d,hd=new d,T3=new d,V$e=new ie,H$e=new Q;rp.prototype.write=function(e,t,n,i,o,r,a,s){let c=this.mode,u=s.ellipsoid.maximumRadius*D.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let A=f[p],m=A.width,_=A.show&&m>0,y=A._index,C=this.getSegments(A,s),E=C.positions,I=C.lengths,x=E.length,S=A.getPickId(a).color,w=0,v=0,R;for(let G=0;G<x;++G){G===0?A._loop?R=E[x-2]:(R=T3,d.subtract(E[0],E[1],R),d.add(E[0],R,R)):R=E[G-1],d.clone(R,dd),d.clone(E[G],as),G===x-1?A._loop?R=E[1]:(R=T3,d.subtract(E[x-1],E[x-2],R),d.add(E[x-1],R,R)):R=E[G+1],d.clone(R,hd);let k=I[w];G===v+k&&(v+=k,++w);let z=G-v===0,F=G===v+I[w]-1;c===oe.SCENE2D&&(dd.z=0,as.z=0,hd.z=0),(c===oe.SCENE2D||c===oe.MORPHING)&&(z||F)&&u-Math.abs(as.x)<1&&((as.x<0&&dd.x>0||as.x>0&&dd.x<0)&&d.clone(as,dd),(as.x<0&&hd.x>0||as.x>0&&hd.x<0)&&d.clone(as,hd));let H=z?2:0,Y=F?2:4;for(let $=H;$<Y;++$){xn.writeElements(as,e,n),xn.writeElements(dd,e,n+6),xn.writeElements(hd,e,n+12);let W=$-2<0?-1:1;t[o]=G/(x-1),t[o+1]=2*($%2)-1,t[o+2]=W,t[o+3]=y,n+=18,o+=4}}let N=V$e;N.x=U.floatToByte(S.red),N.y=U.floatToByte(S.green),N.z=U.floatToByte(S.blue),N.w=U.floatToByte(S.alpha);let L=H$e;L.x=m,L.y=_?1:0;let g=c===oe.SCENE2D?A._boundingVolume2D:A._boundingVolumeWC,b=xn.fromCartesian(g.center,Ghe),T=b.high,B=ie.fromElements(b.low.x,b.low.y,b.low.z,g.radius,Vhe),M=Hhe;M.x=0,M.y=Number.MAX_VALUE;let O=A.distanceDisplayCondition;l(O)&&(M.x=O.near,M.y=O.far),r.setBatchedAttribute(y,0,L),r.setBatchedAttribute(y,1,N),r.attributes.length>2&&(r.setBatchedAttribute(y,2,T),r.setBatchedAttribute(y,3,B),r.setBatchedAttribute(y,4,M))}};var W$e=new d,j$e=new d,Y$e=new d,Qhe=new d;rp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let a=i[r],s=a._segments.positions,c=a._segments.lengths,u=s.length,f=0,h=0;for(let p=0;p<u;++p){let A;p===0?a._loop?A=s[u-2]:(A=Qhe,d.subtract(s[0],s[1],A),d.add(s[0],A,A)):A=s[p-1],A=P.multiplyByPoint(n,A,j$e);let m=P.multiplyByPoint(n,s[p],W$e),_;p===u-1?a._loop?_=s[1]:(_=Qhe,d.subtract(s[u-1],s[u-2],_),d.add(s[u-1],_,_)):_=s[p+1],_=P.multiplyByPoint(n,_,Y$e);let y=c[f];p===h+y&&(h+=y,++f);let C=p-h===0,E=p===h+c[f]-1,I=C?2:0,x=E?2:4;for(let S=I;S<x;++S)xn.writeElements(m,e,t),xn.writeElements(A,e,t+6),xn.writeElements(_,e,t+12),t+=18}}};var q$e=new Array(1);rp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new EK(0,i,this);n[o].push(r);let a=0,s=e[e.length-1],c=0;s.length>0&&(c=s[s.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let A;if(this.mode===oe.SCENE3D){A=q$e;let _=p._actualPositions.length;if(_>0)A[0]=_;else continue}else A=p._segments.lengths;let m=A.length;if(m>0){let _=0;for(let y=0;y<m;++y){let C=A[y]-1;for(let E=0;E<C;++E)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:_}),_=0,t.push(4),s=[],e.push(s),c=0,r.count=a,a=0,i=0,r=new EK(0,0,this),n[++o]=[r]),s.push(c,c+2,c+1),s.push(c+1,c+2,c+3),_+=6,a+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:_}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),s=[],e.push(s),c=0,r.count=a,i=0,a=0,r=new EK(0,0,this),n[++o]=[r])}p._clean()}return r.count=a,i};rp.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 Sx={positions:void 0,lengths:void 0},khe=new Array(1),K$e=new d,X$e=new me;rp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return khe[0]=n.length,Sx.positions=n,Sx.lengths=khe,Sx;Yhe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,a=n.length,s,c=K$e;for(let u=0;u<a;++u)s=n[u],c=P.multiplyByPoint(r,s,c),o.push(t.project(i.cartesianToCartographic(c,X$e)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return Sx.positions=o,Sx.lengths=e._segments.lengths,Sx};var Uhe;rp.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*D.PI,a=t._actualLength;if(a){e+=this.getPolylineStartIndex(t);let s=Uhe,c=6*a*3;!l(s)||s.length<c?s=Uhe=new Float32Array(c):s.length>c&&(s=new Float32Array(s.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,A=0,m=0,_;a=f.length;for(let y=0;y<a;++y){y===0?t._loop?_=f[a-2]:(_=T3,d.subtract(f[0],f[1],_),d.add(f[0],_,_)):_=f[y-1],d.clone(_,dd),d.clone(f[y],as),y===a-1?t._loop?_=f[1]:(_=T3,d.subtract(f[a-1],f[a-2],_),d.add(f[a-1],_,_)):_=f[y+1],d.clone(_,hd);let C=h[A];y===m+C&&(m+=C,++A);let E=y-m===0,I=y===m+h[A]-1;o===oe.SCENE2D&&(dd.z=0,as.z=0,hd.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(E||I)&&r-Math.abs(as.x)<1&&((as.x<0&&dd.x>0||as.x>0&&dd.x<0)&&d.clone(as,dd),(as.x<0&&hd.x>0||as.x>0&&hd.x<0)&&d.clone(as,hd));let x=E?2:0,S=I?2:4;for(let w=x;w<S;++w)xn.writeElements(as,s,p),xn.writeElements(dd,s,p+6),xn.writeElements(hd,s,p+12),p+=18}n.copyFromArrayView(s,18*Float32Array.BYTES_PER_ELEMENT*e)}};var ap=Eh;function Z_(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new fd({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new NA({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new ap,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Z_.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 J$e(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+te.packedLength,a=new Float64Array(r),s=0;return a[s++]=i,a[s++]=o,ce.pack(n,a,s),s+=ce.packedLength,te.pack(t,a,s),a}var Z$e=new Zn("createVectorTilePoints",5),$$e=new d;function eet(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=J$e(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},a=Z$e.scheduleTask(r,o);if(l(a))return a.then(s=>{if(e.isDestroyed())return;e._positions=new Float64Array(s.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3,A=e._heightReference??ot.NONE;for(let m=0;m<p;++m){let _=h[m],y=d.unpack(n,m*3,$$e),C=c.add();C.position=y,C._batchIndex=_,C.heightReference=A;let E=u.add();E.text=" ",E.position=y,E._batchIndex=_,E.heightReference=A;let I=f.add();I.positions=[d.clone(y),d.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(s=>{e.isDestroyed()||(e._error=s)})}Z_.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,a=r.length;for(let s=0;s<a;++s){let c=r[s],u=n.get(s),f=i.get(s),h=o.get(s);t[c]=new X_(e,c,u,f,h)}};Z_.prototype.applyDebugSettings=function(e,t){e?(U.clone(t,this._billboardCollection._highlightColor),U.clone(t,this._labelCollection._highlightColor),U.clone(t,this._polylineCollection._highlightColor)):(U.clone(U.WHITE,this._billboardCollection._highlightColor),U.clone(U.WHITE,this._labelCollection._highlightColor),U.clone(U.WHITE,this._polylineCollection._highlightColor))};function tet(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.pointSize=X_.defaultPointSize,a.color=X_.defaultColor,a.pointOutlineColor=X_.defaultPointOutlineColor,a.pointOutlineWidth=X_.defaultPointOutlineWidth,a.labelColor=U.WHITE,a.labelOutlineColor=U.WHITE,a.labelOutlineWidth=1,a.font="30px sans-serif",a.labelStyle=Ir.FILL,a.labelText=void 0,a.backgroundColor=new U(.165,.165,.165,.8),a.backgroundPadding=new Q(7,5),a.backgroundEnabled=!1,a.scaleByDistance=void 0,a.translucencyByDistance=void 0,a.distanceDisplayCondition=void 0,a.heightOffset=0,a.anchorLineEnabled=!1,a.anchorLineColor=U.WHITE,a.image=void 0,a.disableDepthTestDistance=0,a.horizontalOrigin=Ni.CENTER,a.verticalOrigin=Yn.CENTER,a.labelHorizontalOrigin=Ni.RIGHT,a.labelVerticalOrigin=Yn.BASELINE}}var net=new U,iet=new U,oet=new U,ret=new U,aet=new U,set=new U,MD=new Ht,ND=new Ht,TK=new Gt;Z_.prototype.applyStyle=function(e,t){if(!l(e)){tet(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];if(l(e.show)&&(a.show=e.show.evaluate(a)),l(e.pointSize)&&(a.pointSize=e.pointSize.evaluate(a)),l(e.color)&&(a.color=e.color.evaluateColor(a,net)),l(e.pointOutlineColor)&&(a.pointOutlineColor=e.pointOutlineColor.evaluateColor(a,iet)),l(e.pointOutlineWidth)&&(a.pointOutlineWidth=e.pointOutlineWidth.evaluate(a)),l(e.labelColor)&&(a.labelColor=e.labelColor.evaluateColor(a,oet)),l(e.labelOutlineColor)&&(a.labelOutlineColor=e.labelOutlineColor.evaluateColor(a,ret)),l(e.labelOutlineWidth)&&(a.labelOutlineWidth=e.labelOutlineWidth.evaluate(a)),l(e.font)&&(a.font=e.font.evaluate(a)),l(e.labelStyle)&&(a.labelStyle=e.labelStyle.evaluate(a)),l(e.labelText)?a.labelText=e.labelText.evaluate(a):a.labelText=void 0,l(e.backgroundColor)&&(a.backgroundColor=e.backgroundColor.evaluateColor(a,aet)),l(e.backgroundPadding)&&(a.backgroundPadding=e.backgroundPadding.evaluate(a)),l(e.backgroundEnabled)&&(a.backgroundEnabled=e.backgroundEnabled.evaluate(a)),l(e.scaleByDistance)){let s=e.scaleByDistance.evaluate(a);l(s)?(MD.near=s.x,MD.nearValue=s.y,MD.far=s.z,MD.farValue=s.w,a.scaleByDistance=MD):a.scaleByDistance=void 0}else a.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let s=e.translucencyByDistance.evaluate(a);l(s)?(ND.near=s.x,ND.nearValue=s.y,ND.far=s.z,ND.farValue=s.w,a.translucencyByDistance=ND):a.translucencyByDistance=void 0}else a.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let s=e.distanceDisplayCondition.evaluate(a);l(s)?(TK.near=s.x,TK.far=s.y,a.distanceDisplayCondition=TK):a.distanceDisplayCondition=void 0}else a.distanceDisplayCondition=void 0;l(e.heightOffset)&&(a.heightOffset=e.heightOffset.evaluate(a)),l(e.anchorLineEnabled)&&(a.anchorLineEnabled=e.anchorLineEnabled.evaluate(a)),l(e.anchorLineColor)&&(a.anchorLineColor=e.anchorLineColor.evaluateColor(a,set)),l(e.image)?a.image=e.image.evaluate(a):a.image=void 0,l(e.disableDepthTestDistance)&&(a.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(a)),l(e.horizontalOrigin)&&(a.horizontalOrigin=e.horizontalOrigin.evaluate(a)),l(e.verticalOrigin)&&(a.verticalOrigin=e.verticalOrigin.evaluate(a)),l(e.labelHorizontalOrigin)&&(a.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(a)),l(e.labelVerticalOrigin)&&(a.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(a))}};Z_.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=eet(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Z_.prototype.isDestroyed=function(){return!1};Z_.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),fe(this)};var S3=Z_;function OA(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??d.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ei.BOTH}Object.defineProperties(OA.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function cet(e){let t=new Float64Array(3+d.packedLength+te.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ce.pack(e._rectangle,t,n),t}function uet(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let s=0;s<i;++s)o[s]=en.unpack(t,n),n+=en.packedLength;let r=t[n++],a=e._batchedIndices=new Array(r);for(let s=0;s<r;++s){let c=U.unpack(t,n);n+=U.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let A=0;A<h;++A)p[A]=t[n++];a[s]=new _A({color:c,offset:u,count:f,batchIds:p})}}var fet=new Zn("createVectorTilePolygons",5),det=new U;function het(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,a=e._batchTableColors,s=e._packedBuffer;if(!l(a)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),a=e._batchTableColors=new Uint32Array(r.length);let A=e._batchTable,m=a.length;for(let _=0;_<m;++_){let y=A.getColor(_,det);a[_]=y.toRgba()}s=e._packedBuffer=cet(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,a.buffer,s.buffer],u={packedBuffer:s.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:a.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;l(f)&&l(h)&&(f=f.slice(),h=h.slice(),c.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=fet.scheduleTask(u,c);if(l(p))return p.then(A=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(A.packedBuffer),_=m[0];uet(e,m),e._indices=Ue.getSizeInBytes(_)===2?new Uint16Array(A.indices):new Uint32Array(A.indices),e._indexOffsets=new Uint32Array(A.indexOffsets),e._indexCounts=new Uint32Array(A.indexCounts),e._batchedPositions=new Float32Array(A.positions),e._vertexBatchIds=new Uint16Array(A.batchIds),met(e),e._ready=!0}).catch(A=>{e.isDestroyed()||(e._error=A)})}function met(e){l(e._primitive)||(e._primitive=new wb({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)}OA.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};OA.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};OA.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};OA.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};OA.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=het(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};OA.prototype.isDestroyed=function(){return!1};OA.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var w3=OA;var B3=`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 Ih(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Ih.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function pet(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,a=2+ce.packedLength+te.packedLength+d.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,ce.pack(t,s,c),c+=ce.packedLength,te.pack(o,s,c),c+=te.packedLength,d.pack(r,s,c),s}var Aet=new Zn("createVectorTilePolylines",5),wx={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function get(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=pet(e));let s=[n.buffer,i.buffer,o.buffer,r.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Aet.scheduleTask(c,s);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),_et(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function _et(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,a=e._vertexBatchIds,s=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+a.byteLength+s.byteLength,e._trianglesLength=s.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Re.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Re.STATIC_DRAW}),h=tt.createVertexBuffer({context:t,typedArray:o,usage:Re.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:r,usage:Re.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Re.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:s,usage:Re.STATIC_DRAW,indexDatatype:s.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),_=[{index:wx.previousPosition,vertexBuffer:u,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:wx.currentPosition,vertexBuffer:f,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:wx.nextPosition,vertexBuffer:h,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:wx.expandAndWidth,vertexBuffer:p,componentDatatype:j.FLOAT,componentsPerAttribute:2},{index:wx.a_batchId,vertexBuffer:A,componentDatatype:j.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:_,indexBuffer:m}),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 LD=new P,qhe=new d;function yet(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,LD),P.multiplyByPoint(LD,e._center,qhe),P.setTranslation(LD,qhe,LD),LD},u_highlightColor:function(){return e._highlightColor}})}function Cet(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ve.fromCache({blending:sn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Eet=`uniform vec4 u_highlightColor;
|
|
void main()
|
|
{
|
|
out_FragColor = u_highlightColor;
|
|
}
|
|
`;function Iet(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(B3),o=n.getFragmentShaderCallback(!1,void 0,!1)(Eet),r=new We({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[$l,i]}),a=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:wx})}function bet(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new it({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Be.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Ih.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,a,s=n.length,c=0,u=0;for(r=0;r<s;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let f=new Float64Array(c*3);for(r=0;r<s;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(a=0;a<p;++a){let A=(h+a)*3;f[u++]=i[A],f[u++]=i[A+1],f[u++]=i[A+2]}}return f};Ih.prototype.getPositions=function(e){return Ih.getPolylinePositions(this,e)};Ih.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 Vs(e,r)}};Ih.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function xet(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.color=U.WHITE}}var Tet=new U,wet=U.WHITE,Bet=!0;Ih.prototype.applyStyle=function(e,t){if(!l(e)){xet(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.color=l(e.color)?e.color.evaluateColor(a,Tet):wet,a.show=l(e.show)?e.show.evaluate(a):Bet}};Ih.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=get(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}yet(this,t),Iet(this,t),Cet(this);let n=e.passes;(n.render||n.pick)&&bet(this,e)};Ih.prototype.isDestroyed=function(){return!1};Ih.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var Bx=Ih;var D3=`in vec3 startEllipsoidNormal;
|
|
in vec3 endEllipsoidNormal;
|
|
in vec4 startPositionAndHeight;
|
|
in vec4 endPositionAndHeight;
|
|
in vec4 startFaceNormalAndVertexCorner;
|
|
in vec4 endFaceNormalAndHalfWidth;
|
|
in float a_batchId;
|
|
|
|
uniform mat4 u_modifiedModelView;
|
|
uniform vec2 u_minimumMaximumVectorHeights;
|
|
|
|
out vec4 v_startPlaneEC;
|
|
out vec4 v_endPlaneEC;
|
|
out vec4 v_rightPlaneEC;
|
|
out float v_halfWidth;
|
|
out vec3 v_volumeUpEC;
|
|
|
|
void main()
|
|
{
|
|
// vertex corner IDs
|
|
// 3-----------7
|
|
// /| left /|
|
|
// / | 1 / |
|
|
// 2-----------6 5 end
|
|
// | / | /
|
|
// start |/ right |/
|
|
// 0-----------4
|
|
//
|
|
float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251); // 0 for front, 1 for end
|
|
float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd)); // 0 for bottom, 1 for top
|
|
|
|
vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
|
|
vec3 right = normalize(cross(forward, startEllipsoidNormal));
|
|
|
|
vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
|
|
position.xyz += forward * isEnd;
|
|
|
|
v_volumeUpEC = czm_normal * normalize(cross(right, forward));
|
|
|
|
// Push for volume height
|
|
float offset;
|
|
vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
|
|
|
|
// offset height to create volume
|
|
offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
|
|
offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
|
|
position.xyz += offset * ellipsoidNormal;
|
|
|
|
// move from RTC to EC
|
|
position = u_modifiedModelView * position;
|
|
right = czm_normal * right;
|
|
|
|
// Push for width in a direction that is in the start or end plane and in a plane with right
|
|
// N = normalEC ("right-facing" direction for push)
|
|
// R = right
|
|
// p = angle between N and R
|
|
// w = distance to push along R if R == N
|
|
// d = distance to push along N
|
|
//
|
|
// N R
|
|
// { p| } * cos(p) = dot(N, R) = w / d
|
|
// d | |w * d = w / dot(N, R)
|
|
// { | }
|
|
// o---------- polyline segment ---->
|
|
//
|
|
vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
|
|
scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
|
|
vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
|
|
|
|
offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC
|
|
offset = offset / dot(miterPushNormal, right);
|
|
position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
|
|
|
|
gl_Position = czm_depthClamp(czm_projection * position);
|
|
|
|
position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
|
|
vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
|
|
v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
|
|
v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
|
|
|
|
position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
|
|
vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
|
|
v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
|
|
v_halfWidth = endFaceNormalAndHalfWidth.w;
|
|
}
|
|
`;var v3=`in vec4 v_startPlaneEC;
|
|
in vec4 v_endPlaneEC;
|
|
in vec4 v_rightPlaneEC;
|
|
in float v_halfWidth;
|
|
in vec3 v_volumeUpEC;
|
|
|
|
uniform vec4 u_highlightColor;
|
|
void main()
|
|
{
|
|
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
|
|
|
|
// Discard for sky
|
|
if (logDepthOrDepth == 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
eyeCoordinate /= eyeCoordinate.w;
|
|
|
|
float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
|
|
|
|
// Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction
|
|
halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
|
|
|
|
// Check distance of the eye coordinate against the right-facing plane
|
|
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
|
|
|
|
// Check eye coordinate against the mitering planes
|
|
float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
|
|
float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
|
|
|
|
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
|
|
#ifdef DEBUG_SHOW_VOLUME
|
|
out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
|
|
return;
|
|
#else // DEBUG_SHOW_VOLUME
|
|
discard;
|
|
#endif // DEBUG_SHOW_VOLUME
|
|
}
|
|
out_FragColor = u_highlightColor;
|
|
|
|
czm_writeDepthClamp();
|
|
}
|
|
`;function FA(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??te.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new Q(vi._defaultMinTerrainHeight,vi._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,vi._defaultMinTerrainHeight,vi._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=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(FA.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Det(e,t,n){let i=vi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,a=e._minimumMaximumVectorHeights;a.x=o,a.y=r;let s=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,o,r,n,s)}function vet(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,a=2+ce.packedLength+te.packedLength+d.packedLength,s=new Float64Array(a),c=0;return s[c++]=n,s[c++]=i,ce.pack(t,s,c),c+=ce.packedLength,te.pack(o,s,c),c+=te.packedLength,d.pack(r,s,c),s}var Pet=new Zn("createVectorTileClampedPolylines"),$_={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Ret(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,a=e._packedBuffer;l(a)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),a=e._packedBuffer=vet(e));let s=[n.buffer,i.buffer,o.buffer,r.buffer,a.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:a.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Pet.scheduleTask(c,s);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Ue.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Met(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Met(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,a=e._startFaceNormalAndVertexCornerIds,s=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=a.byteLength+s.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=tt.createVertexBuffer({context:t,typedArray:n,usage:Re.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Re.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:o,usage:Re.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:r,usage:Re.STATIC_DRAW}),_=tt.createVertexBuffer({context:t,typedArray:a,usage:Re.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Re.STATIC_DRAW}),C=tt.createVertexBuffer({context:t,typedArray:c,usage:Re.STATIC_DRAW}),E=tt.createIndexBuffer({context:t,typedArray:u,usage:Re.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Ue.UNSIGNED_SHORT:Ue.UNSIGNED_INT}),I=[{index:$_.startEllipsoidNormal,vertexBuffer:h,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:$_.endEllipsoidNormal,vertexBuffer:p,componentDatatype:j.FLOAT,componentsPerAttribute:3},{index:$_.startPositionAndHeight,vertexBuffer:A,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:$_.endPositionAndHeight,vertexBuffer:m,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:$_.startFaceNormalAndVertexCorner,vertexBuffer:_,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:$_.endFaceNormalAndHalfWidth,vertexBuffer:y,componentDatatype:j.FLOAT,componentsPerAttribute:4},{index:$_.a_batchId,vertexBuffer:C,componentDatatype:j.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:I,indexBuffer:E}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var OD=new P,Khe=new d;function Net(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,OD),P.multiplyByPoint(OD,e._center,Khe),P.setTranslation(OD,Khe,OD),OD},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Xhe(e){return Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},blending:sn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function Let(e){l(e._rs)||(e._rs=Xhe(!1),e._rs3DTiles=Xhe(!0))}function Oet(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(D3),o=n.getFragmentShaderCallback(!1,void 0,!0)(v3),r=new We({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[$l,i]}),a=new We({defines:["VECTOR_TILE"],sources:[o]});e._sp=$t.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:$_})}function Fet(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new it({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Be.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=it.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Be.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===ei.TERRAIN||i===ei.BOTH)&&t.commandList.push(n),(i===ei.CESIUM_3D_TILE||i===ei.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}FA.prototype.getPositions=function(e){return Bx.getPolylinePositions(this,e)};FA.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 Vs(e,r)}};FA.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Qet(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.show=!0,a.color=U.WHITE}}var ket=new U,Uet=U.WHITE,zet=!0;FA.prototype.applyStyle=function(e,t){if(!l(e)){Qet(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],a=t[r];a.color=l(e.color)?e.color.evaluateColor(a,ket):Uet,a.show=l(e.show)?e.show.evaluate(a):zet}};function Get(e){return vi.initialize().then(function(){Det(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}FA.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Get(this).then(Ret(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Net(this,t),Oet(this,t),Let(this);let n=e.passes;(n.render||n.pick)&&Fet(this,e)};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),fe(this)};var P3=FA;var SK=32767,Vet=new me,Het=new d;function Wet(e,t,n,i,o){let r=e.length/3,a=e.subarray(0,r),s=e.subarray(r,2*r),c=e.subarray(2*r,3*r);tn.zigZagDeltaDecode(a,s,c);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=a[f],p=s[f],A=c[f],m=D.lerp(t.west,t.east,h/SK),_=D.lerp(t.south,t.north,p/SK),y=D.lerp(n,i,A/SK),C=me.fromRadians(m,_,y,Vet),E=o.cartographicToCartesian(C,Het);d.pack(E,u,f*3)}return u}var R3=Wet;function xh(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,Xet(this,i,o)}Object.defineProperties(xh.prototype,{featuresLength:{get:function(){return l(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return l(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.trianglesLength),l(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return l(this._polygons)&&(e+=this._polygons.geometryByteLength),l(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return l(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function jet(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Yet(e,t){let n,i,o,r,a=e.POLYGONS_LENGTH??0,s=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(a>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,a)}if(s>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,s)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(o),f=a>0&&!l(n)||s>0&&!l(i)||c>0&&!l(o);if(u&&f)throw new ue("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),r=0;r<a;++r)n[r]=p++;if(!l(i)&&s>0)for(i=new Uint16Array(s),r=0;r<s;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var bh=Uint32Array.BYTES_PER_ELEMENT;function qet(e){return new Bx(e)}function Ket(e){return new P3(e)}function Xet(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=bh;let r=o.getUint32(n,!0);if(r!==1)throw new ue(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=bh;let a=o.getUint32(n,!0);if(n+=bh,a===0){e._ready=!0;return}let s=o.getUint32(n,!0);if(n+=bh,s===0)throw new ue("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=bh;let u=o.getUint32(n,!0);n+=bh;let f=o.getUint32(n,!0);n+=bh;let h=o.getUint32(n,!0);n+=bh;let p=o.getUint32(n,!0);n+=bh;let A=o.getUint32(n,!0);n+=bh;let m=o.getUint32(n,!0);n+=bh;let _=Pr(i,n,s);n+=s;let y=new Uint8Array(t,n,c);n+=c;let C,E;u>0&&(C=Pr(i,n,u),n+=u,f>0&&(E=new Uint8Array(t,n,f),E=new Uint8Array(E),n+=f));let I=_.POLYGONS_LENGTH??0,x=_.POLYLINES_LENGTH??0,S=_.POINTS_LENGTH??0,w=I+x+S,v=new Um(e,w,C,E,jet(e));if(e._batchTable=v,w===0)return;let R=new Km(_,y),N=R.getGlobalProperty("REGION");if(!l(N))throw new ue("Feature table global property: REGION must be defined");let L=ce.unpack(N),g=N[4],b=N[5],T=e._tile.computedTransform,B=R.getGlobalProperty("RTC_CENTER",j.FLOAT,3);l(B)?(B=d.unpack(B),P.multiplyByPoint(T,B,B)):(B=ce.center(L),B.height=D.lerp(g,b,.5),B=te.WGS84.cartographicToCartesian(B));let M=Yet(_,y);if(n+=(4-n%4)%4,I>0){R.featuresLength=I;let G=R.getPropertyArray("POLYGON_COUNTS",j.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_COUNT",j.UNSIGNED_INT,1);if(!l(G))throw new ue("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let k=R.getPropertyArray("POLYGON_INDEX_COUNTS",j.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_INDEX_COUNT",j.UNSIGNED_INT,1);if(!l(k))throw new ue("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let z=G.reduce(function(K,Z){return K+Z*2},0),F=k.reduce(function(K,Z){return K+Z},0),H=new Uint32Array(t,n,F);n+=h;let Y=new Uint16Array(t,n,z);n+=p;let $,W;l(_.POLYGON_MINIMUM_HEIGHTS)&&l(_.POLYGON_MAXIMUM_HEIGHTS)&&($=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",j.FLOAT,1),W=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",j.FLOAT,1)),e._polygons=new w3({positions:Y,counts:G,indexCounts:k,indices:H,minimumHeight:g,maximumHeight:b,polygonMinimumHeights:$,polygonMaximumHeights:W,center:B,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,batchIds:M.polygons,modelMatrix:T})}let O=e._tileset;if(x>0){R.featuresLength=x;let G=R.getPropertyArray("POLYLINE_COUNTS",j.UNSIGNED_INT,1)??R.getPropertyArray("POLYLINE_COUNT",j.UNSIGNED_INT,1);if(!l(G))throw new ue("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let k=R.getPropertyArray("POLYLINE_WIDTHS",j.UNSIGNED_SHORT,1);if(!l(k)){k=new Uint16Array(x);for(let $=0;$<x;++$)k[$]=2}let z=G.reduce(function($,W){return $+W*3},0),F=new Uint16Array(t,n,z);n+=A;let H=O.examineVectorLinesFunction;if(l(H)){let $=R3(new Uint16Array(F),L,g,b,te.WGS84);Jet($,G,M.polylines,v,e.url,H)}let Y=qet;l(O.classificationType)&&(Y=Ket),e._polylines=Y({positions:F,widths:k,counts:G,batchIds:M.polylines,minimumHeight:g,maximumHeight:b,center:B,rectangle:L,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:v,classificationType:O.classificationType,keepDecodedPositions:O.vectorKeepDecodedPositions})}if(S>0){let G=new Uint16Array(t,n,S*3);n+=m,e._points=new S3({positions:G,batchIds:M.points,minimumHeight:g,maximumHeight:b,rectangle:L,batchTable:v,heightReference:O.heightReference,scene:O.scene})}}function wK(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}xh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};xh.prototype.getFeature=function(e){return l(this._features)||wK(this),this._features[e]};xh.prototype.applyDebugSettings=function(e,t){l(this._polygons)&&this._polygons.applyDebugSettings(e,t),l(this._polylines)&&this._polylines.applyDebugSettings(e,t),l(this._points)&&this._points.applyDebugSettings(e,t)};xh.prototype.applyStyle=function(e){l(this._features)||wK(this),l(this._polygons)&&this._polygons.applyStyle(e,this._features),l(this._polylines)&&this._polylines.applyStyle(e,this._features),l(this._points)&&this._points.applyStyle(e,this._features)};xh.prototype.update=function(e,t){let n=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),l(this._points)&&(this._points.update(t),n=n&&this._points.ready),l(this._batchTable)&&n&&(l(this._features)||wK(this),this._batchTable.update(e,t),this._ready=!0)};xh.prototype.pick=function(e,t,n){};xh.prototype.getPolylinePositions=function(e){let t=this._polylines;if(l(t))return t.getPositions(e)};xh.prototype.isDestroyed=function(){return!1};xh.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),fe(this)};function Jet(e,t,n,i,o,r){let a=t.length,s=0;for(let c=0;c<a;c++){let u=t[c]*3,f=e.slice(s,s+u);s+=u,r(f,n[c],o,i)}}var M3=xh;var Th=class Th{constructor(){vn(this,"_collection",null);vn(this,"_index",-1);vn(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(Th.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Th.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Th.Layout.SHOW_U8)===1}set show(t){this._setUint8(Th.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(Th.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Th.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Th.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Th.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};vn(Th,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var BK=Th,sa=BK;var Dx=class Dx{constructor(t=V.EMPTY_OBJECT){vn(this,"_renderContext",null);this.show=t.show??!0,this.modelMatrix=P.clone(t.modelMatrix??P.IDENTITY),this.boundingVolume=new le,this.boundingVolumeWC=new le,this._allowPicking=t.allowPicking??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??Dx.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??Dx.DEFAULT_CAPACITY,this._positionView=null,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(t.positionDatatype??j.DOUBLE),this._allocateMaterialBuffer()}_getCollectionClass(){de.throwInstantiationError()}_getPrimitiveClass(){de.throwInstantiationError()}_getMaterialClass(){de.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(t){this._positionView=j.createTypedArray(t,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),o=this._getCollectionClass(),{primitiveCount:r}=this,a=new i,s=new i,c=new Uint32Array(r);for(let f=0;f<r;f++)c[f]=f;c.sort((f,h)=>t(this.get(f,a),this.get(h,s)));for(let f=0;f<r;f++)n[c[f]]=f;let u=o._cloneEmpty(this);for(let f=0;f<r;f++){let h=this.get(c[f],a),p=u.add({},s);i.clone(h,p)}return o._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=r,n}static clone(t,n){let i=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),r=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*i.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n.show=t.show,n.debugShowBoundingVolume=t.debugShowBoundingVolume,n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=new r;for(let s=0,c=n.primitiveCount;s<c;s++)n.get(s,a)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneEmpty(t){de.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.constructor,n=new t(this._positionView.buffer,this._positionView.byteOffset,this._positionCount*3);le.fromVertices(n,d.ZERO,3,this.boundingVolume),le.transform(this.boundingVolume,this.modelMatrix,this.boundingVolumeWC),this._dirtyBoundingVolume=!1}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=V.EMPTY_OBJECT,n){let i=this._getMaterialClass();return n=this.get(this._primitiveCount++,n),n.featureId=this._primitiveCount-1,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeDirtyBoundingVolume(){this._dirtyBoundingVolume=!0}update(t){t.mode!==oe.SCENE3D&&bt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume()}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}static _copySubArray(t,n,i){for(let o=0;o<i;o++)n[o]=t[o]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let o=0,r=this.primitiveCount;o<r;o++)i.push(this.get(o,n).toJSON());return i}};vn(Dx,"DEFAULT_CAPACITY",1024),vn(Dx,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var DK=Dx,ss=DK;var{ERR_CAPACITY:h8n}=ss.Error,Zet=new d,N3=class N3 extends sa{constructor(){super(...arguments);vn(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Zet)),i}get vertexOffset(){return this._getUint32(N3.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return d.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,o=this.vertexOffset;i._positionView[o*3]=n.x,i._positionView[o*3+1]=n.y,i._positionView[o*3+2]=n.z,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:d.pack(this.getPosition(),[])}}};vn(N3,"Layout",{...sa.Layout,POSITION_OFFSET_U32:sa.Layout.__BYTE_LENGTH,__BYTE_LENGTH:sa.Layout.__BYTE_LENGTH+4});var vK=N3,tf=vK;var L3=`in vec3 positionHigh;
|
|
in vec3 positionLow;
|
|
in vec4 pickColor;
|
|
in vec3 showPixelSizeAndColor;
|
|
in vec2 outlineWidthAndOutlineColor;
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
out vec4 v_outlineColor;
|
|
out float v_innerRadiusFrac;
|
|
|
|
void main()
|
|
{
|
|
// Unpack attributes.
|
|
float show = showPixelSizeAndColor.x;
|
|
float pixelSize = showPixelSizeAndColor.y;
|
|
vec4 color = czm_decodeRGB8(showPixelSizeAndColor.z);
|
|
float outlineWidth = outlineWidthAndOutlineColor.x;
|
|
vec4 outlineColor = czm_decodeRGB8(outlineWidthAndOutlineColor.y);
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
float innerRadius = 0.5 * pixelSize * czm_pixelRatio;
|
|
float outerRadius = (0.5 * pixelSize + outlineWidth) * czm_pixelRatio;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
gl_Position = czm_projection * positionEC;
|
|
czm_vertexLogDepth();
|
|
|
|
v_pickColor = pickColor / 255.0;
|
|
|
|
v_color = color;
|
|
v_color.a *= show;
|
|
|
|
v_outlineColor = outlineColor;
|
|
v_outlineColor.a *= show;
|
|
|
|
v_innerRadiusFrac = innerRadius / outerRadius;
|
|
|
|
gl_PointSize = 2.0 * outerRadius * show;
|
|
gl_Position *= show;
|
|
}
|
|
`;var O3=`in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
in vec4 v_outlineColor;
|
|
in float v_innerRadiusFrac;
|
|
|
|
void main()
|
|
{
|
|
// Distance between fragment and point center, 0 to 0.5.
|
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
float delta = fwidth(distanceToCenter);
|
|
|
|
float outerLimit = 0.5;
|
|
float innerLimit = 0.5 * v_innerRadiusFrac;
|
|
|
|
float outerAlpha = 1.0 - smoothstep(max(0.0, outerLimit - delta), outerLimit, distanceToCenter);
|
|
float innerAlpha = 1.0 - smoothstep(innerLimit - delta, innerLimit, distanceToCenter);
|
|
|
|
vec4 color = vec4(mix(v_outlineColor.rgb, v_color.rgb, innerAlpha), outerAlpha);
|
|
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var FD=class{constructor(t=V.EMPTY_OBJECT){this.color=U.clone(t.color??U.WHITE),this.outlineColor=U.clone(t.outlineColor??U.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return U.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),U.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};vn(FD,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),vn(FD,"DEFAULT_MATERIAL");var pu=FD;var QD=class QD extends pu{constructor(t=V.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};vn(QD,"Layout",{...pu.Layout,SIZE_U8:pu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:pu.Layout.__BYTE_LENGTH+4}),vn(QD,"DEFAULT_MATERIAL",Object.freeze(new QD));var PK=QD,ey=PK;var QA={positionHigh:0,positionLow:1,pickColor:2,showSizeAndColor:3,outlineWidthAndOutlineColor:4},kA=new tf,kD=new ey,UD=new U,Jhe=new d,QE=new xn;function $et(e,t,n){let i=t.context;if(n=n||{destroy:ttt},!l(n.attributeArrays)){let o=e.primitiveCountMax;n.attributeArrays={positionHigh:new Float32Array(o*3),positionLow:new Float32Array(o*3),pickColor:new Uint8Array(o*4),showSizeAndColor:new Float32Array(o*3),outlineWidthAndOutlineColor:new Float32Array(o*2)}}if(l(n.pickIds)||(n.pickIds=[]),e._dirtyCount>0){let{attributeArrays:o,pickIds:r}=n,a=o.positionHigh,s=o.positionLow,c=o.pickColor,u=o.showSizeAndColor,f=o.outlineWidthAndOutlineColor,{_dirtyOffset:h,_dirtyCount:p}=e;for(let A=h,m=h+p;A<m;A++)if(e.get(A,kA),!!kA._dirty){if(e._allowPicking&&kA._pickId===0){let _=i.createPickId({collection:e,index:A,get primitive(){return e.get(this.index,new tf)}});kA._pickId=_.key,r.push(_)}kA.getPosition(Jhe),xn.fromCartesian(Jhe,QE),kA.getMaterial(kD),U.fromRgba(kA._pickId,UD),a[A*3]=QE.high.x,a[A*3+1]=QE.high.y,a[A*3+2]=QE.high.z,s[A*3]=QE.low.x,s[A*3+1]=QE.low.y,s[A*3+2]=QE.low.z,c[A*4]=U.floatToByte(UD.red),c[A*4+1]=U.floatToByte(UD.green),c[A*4+2]=U.floatToByte(UD.blue),c[A*4+3]=U.floatToByte(UD.alpha),u[A*3]=kA.show?1:0,u[A*3+1]=kD.size,u[A*3+2]=tn.encodeRGB8(kD.color),f[A*2]=kD.outlineWidth,f[A*2+1]=tn.encodeRGB8(kD.outlineColor),kA._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let o in QA)if(Object.hasOwn(QA,o)){let r=o;n.vertexArray.copyAttributeFromRange(QA[r],n.attributeArrays[r],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:o}=n;n.vertexArray=new Vn({context:i,attributes:[{index:QA.positionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionHigh,context:i,usage:Re.STATIC_DRAW})},{index:QA.positionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionLow,context:i,usage:Re.STATIC_DRAW})},{index:QA.pickColor,componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.pickColor,context:i,usage:Re.STATIC_DRAW})},{index:QA.showSizeAndColor,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.showSizeAndColor,context:i,usage:Re.STATIC_DRAW})},{index:QA.outlineWidthAndOutlineColor,componentDatatype:j.FLOAT,componentsPerAttribute:2,vertexBuffer:tt.createVertexBuffer({typedArray:o.outlineWidthAndOutlineColor,context:i,usage:Re.STATIC_DRAW})}]})}return l(n.renderState)||(n.renderState=Ve.fromCache({blending:sn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=$t.fromCache({context:i,vertexShaderSource:new We({sources:[L3]}),fragmentShaderSource:new We({sources:[O3]}),attributeLocations:QA})),(!l(n.command)||ett(e,n.command))&&(n.command=new it({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Pe.POINTS,pass:Be.OPAQUE,pickId:"v_pickColor",owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolumeWC,debugShowBoundingVolume:e.debugShowBoundingVolume})),t.commandList.push(n.command),e._dirtyCount=0,e._dirtyOffset=0,n}function ett(e,t){let n=P.equals(e.modelMatrix,t._modelMatrix),i=le.equals(e.boundingVolumeWC,t._boundingVolume);return e.primitiveCount!==t._count||e.debugShowBoundingVolume!==t.debugShowBoundingVolume||!n||!i}function ttt(){let e=this;if(l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState),l(e.pickIds))for(let t of e.pickIds)t.destroy()}var F3=$et;var RK=class e extends ss{constructor(t=V.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return tf}_getMaterialClass(){return ey}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax})}add(t,n=new tf){return super.add(t,n),n._setUint32(tf.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??d.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=F3(this,t,this._renderContext))}},ty=RK;var{ERR_CAPACITY:rHn,ERR_RESIZE:aHn,ERR_OUT_OF_RANGE:sHn}=ss.Error,md=class md extends sa{constructor(){super(...arguments);vn(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(md.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(md.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,a=n.length/3,s=i.vertexCount+a-r;i._positionCount=s,this._setUint32(md.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(md.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(md.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:o}=this,r=this._collection._holeIndexView;if(!l(n)){let a=r.byteOffset+i*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o)}for(let a=0;a<o;a++)n[a]=r[i+a];return n}setHoles(n){let i=this._collection,o=this.holeOffset,r=this.holeCount,a=n.length,s=i.holeCount+a-r;i._holeCount=s,this._setUint32(md.Layout.HOLE_COUNT_U32,a);let c=i._holeIndexView;for(let u=0;u<a;u++)c[o+u]=n[u];i._makeDirtyBoundingVolume()}getHoleVertexCount(n){let i=this.getHoles(),o=i[n];return n===i.length-1?this.vertexCount-o:i[n+1]-o}getHolePositions(n,i){let r=this.getHoles()[n],a=this.getHoleVertexCount(n);return this._getPositionsRange(r,a,i)}_getPositionsRange(n,i,o){let r=this._collection,a=this._collection._positionView,s=this.vertexOffset+n;if(!l(o)){let c=a.byteOffset+s*3*a.BYTES_PER_ELEMENT,u=a.constructor;return new u(a.buffer,c,i*3)}for(let c=0;c<i;c++)o[c*3]=a[(s+c)*3],o[c*3+1]=a[(s+c)*3+1],o[c*3+2]=a[(s+c)*3+2];return o}get triangleOffset(){return this._getUint32(md.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(md.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:o}=this,r=this._collection._triangleIndexView;if(!l(n)){let a=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o*3)}for(let a=0;a<o;a++)n[a*3]=r[(i+a)*3],n[a*3+1]=r[(i+a)*3+1],n[a*3+2]=r[(i+a)*3+2];return n}setTriangles(n){let i=this._collection,o=this.triangleOffset,r=this.triangleCount,a=n.length/3,s=i.triangleCount+a-r;i._triangleCount+=a-r,this._setUint32(md.Layout.TRIANGLE_COUNT_U32,a);let c=i._triangleIndexView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};vn(md,"Layout",{...sa.Layout,POSITION_OFFSET_U32:sa.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:sa.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:sa.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:sa.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:sa.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:sa.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:sa.Layout.__BYTE_LENGTH+24});var MK=md,qs=MK;var Q3=`in vec3 positionHigh;
|
|
in vec3 positionLow;
|
|
in vec4 pickColor;
|
|
in vec2 showAndColor;
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
float show = showAndColor.x;
|
|
vec4 color = czm_decodeRGB8(showAndColor.y);
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
gl_Position = czm_projection * positionEC;
|
|
czm_vertexLogDepth();
|
|
|
|
v_pickColor = pickColor / 255.0;
|
|
|
|
v_color = color;
|
|
v_color.a *= show;
|
|
|
|
gl_Position *= show;
|
|
}
|
|
`;var k3=`in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
if (v_color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var U3=class U3 extends pu{constructor(t=V.EMPTY_OBJECT){super(t)}};vn(U3,"DEFAULT_MATERIAL",Object.freeze(new U3));var NK=U3,ny=NK;var iy={positionHigh:0,positionLow:1,pickColor:2,showAndColor:3},Sa=new qs,Zhe=new ny,zD=new U,$he=new d,kE=new xn;function ntt(e,t,n){let i=t.context;if(n=n||{destroy:rtt},!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:o,triangleCountMax:r}=e;n.indexArray=Ue.createTypedArray(o,r*3),n.attributeArrays={positionHigh:new Float32Array(o*3),positionLow:new Float32Array(o*3),pickColor:new Uint8Array(o*4),showAndColor:new Float32Array(o*2)}}if(l(n.pickIds)||(n.pickIds=[]),e._dirtyCount>0){let{attributeArrays:o,pickIds:r}=n,{_dirtyOffset:a,_dirtyCount:s}=e,c=n.indexArray,u=o.positionHigh,f=o.positionLow,h=o.pickColor,p=o.showAndColor;for(let A=a,m=a+s;A<m;A++){if(e.get(A,Sa),!Sa._dirty)continue;if(e._allowPicking&&Sa._pickId===0){let S=i.createPickId({collection:e,index:A,get primitive(){return e.get(A,new qs)}});Sa._pickId=S.key,r.push(S)}let _=Sa.triangleOffset,y=Sa.vertexOffset,C=Sa.getTriangles();for(let S=0,w=Sa.triangleCount;S<w;S++)c[_*3]=y+C[S*3],c[_*3+1]=y+C[S*3+1],c[_*3+2]=y+C[S*3+2],_++;let E=Sa.show,I=Sa.getPositions();Sa.getMaterial(Zhe);let x=tn.encodeRGB8(Zhe.color);U.fromRgba(Sa._pickId,zD);for(let S=0,w=Sa.vertexCount;S<w;S++)d.fromArray(I,S*3,$he),xn.fromCartesian($he,kE),u[y*3]=kE.high.x,u[y*3+1]=kE.high.y,u[y*3+2]=kE.high.z,f[y*3]=kE.low.x,f[y*3+1]=kE.low.y,f[y*3+2]=kE.low.z,h[y*4]=U.floatToByte(zD.red),h[y*4+1]=U.floatToByte(zD.green),h[y*4+2]=U.floatToByte(zD.blue),h[y*4+3]=U.floatToByte(zD.alpha),p[y*2]=E?1:0,p[y*2+1]=x,y++;Sa._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:o,indexCount:r,vertexOffset:a,vertexCount:s}=ott(e);n.vertexArray.copyIndexFromRange(n.indexArray,o,r);for(let c in iy)if(Object.hasOwn(iy,c)){let u=c;n.vertexArray.copyAttributeFromRange(iy[u],n.attributeArrays[u],a,s)}}}else{let{attributeArrays:o}=n;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromTypedArray(n.indexArray)}),attributes:[{index:iy.positionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionHigh,context:i,usage:Re.STATIC_DRAW})},{index:iy.positionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionLow,context:i,usage:Re.STATIC_DRAW})},{index:iy.pickColor,componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.pickColor,context:i,usage:Re.STATIC_DRAW})},{index:iy.showAndColor,componentDatatype:j.FLOAT,componentsPerAttribute:2,vertexBuffer:tt.createVertexBuffer({typedArray:o.showAndColor,context:i,usage:Re.STATIC_DRAW})}]})}return l(n.renderState)||(n.renderState=Ve.fromCache({blending:sn.DISABLED,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=$t.fromCache({context:i,vertexShaderSource:new We({sources:[Q3]}),fragmentShaderSource:new We({sources:[k3]}),attributeLocations:iy})),(!l(n.command)||itt(e,n.command))&&(n.command=new it({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Pe.TRIANGLES,pass:Be.OPAQUE,pickId:"v_pickColor",owner:e,count:e.triangleCount*3,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolumeWC,debugShowBoundingVolume:e.debugShowBoundingVolume})),t.commandList.push(n.command),e._dirtyCount=0,e._dirtyOffset=0,n}function itt(e,t){let n=P.equals(e.modelMatrix,t._modelMatrix),i=le.equals(e.boundingVolumeWC,t._boundingVolume);return e.triangleCount*3!==t._count||e.debugShowBoundingVolume!==t.debugShowBoundingVolume||!n||!i}function ott(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,Sa);let i=Sa.vertexOffset,o=Sa.triangleOffset*3;e.get(t+n-1,Sa);let r=Sa.vertexOffset+Sa.vertexCount-i,a=(Sa.triangleOffset+Sa.triangleCount)*3-o;return{indexOffset:o,indexCount:a,vertexOffset:i,vertexCount:r}}function rtt(){let e=this;if(l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState),l(e.pickIds))for(let t of e.pickIds)t.destroy()}var z3=ntt;var{ERR_CAPACITY:YHn}=ss.Error,LK=class e extends ss{constructor(t=V.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??ss.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??ss.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return qs}_getMaterialClass(){return ny}_allocateHoleIndexBuffer(){this._holeIndexView=Ue.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Ue.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n){return super.clone(t,n),this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount,n}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax,holeCountMax:t.holeCountMax,triangleCountMax:t.triangleCountMax})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new qs){super.add(t,n);let i=this._positionCount;n._setUint32(qs.Layout.POSITION_OFFSET_U32,i),n._setUint32(qs.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(qs.Layout.HOLE_OFFSET_U32,o),n._setUint32(qs.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(qs.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(qs.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=z3(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},oy=LK;var{ERR_RESIZE:ZHn,ERR_CAPACITY:$Hn}=ss.Error,vx=class vx extends sa{constructor(){super(...arguments);vn(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(vx.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(vx.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:o}=this,r=this._collection._positionView;if(!l(n)){let a=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,s=r.constructor;return new s(r.buffer,a,o*3)}for(let a=0;a<o;a++)n[a*3]=r[(i+a)*3],n[a*3+1]=r[(i+a)*3+1],n[a*3+2]=r[(i+a)*3+2];return n}setPositions(n){let i=this._collection,o=this.vertexOffset,r=this.vertexCount,a=n.length/3,s=i._positionCount+a-r;i._positionCount=s,this._setUint32(vx.Layout.POSITION_COUNT_U32,a);let c=i._positionView;for(let u=0;u<a;u++)c[(o+u)*3]=n[u*3],c[(o+u)*3+1]=n[u*3+1],c[(o+u)*3+2]=n[u*3+2];i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};vn(vx,"Layout",{...sa.Layout,POSITION_OFFSET_U32:sa.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:sa.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:sa.Layout.__BYTE_LENGTH+8});var OK=vx,Au=OK;var G3=`in vec3 positionHigh;
|
|
in vec3 positionLow;
|
|
in vec3 prevPositionHigh;
|
|
in vec3 prevPositionLow;
|
|
in vec3 nextPositionHigh;
|
|
in vec3 nextPositionLow;
|
|
in vec4 pickColor;
|
|
in vec4 showColorWidthAndTexCoord;
|
|
|
|
out vec4 v_pickColor;
|
|
out vec4 v_color;
|
|
out vec2 v_st;
|
|
out float v_width;
|
|
out float v_polylineAngle;
|
|
|
|
void main()
|
|
{
|
|
float show = showColorWidthAndTexCoord.x;
|
|
vec4 color = czm_decodeRGB8(showColorWidthAndTexCoord.y);
|
|
float width = showColorWidthAndTexCoord.z;
|
|
float texCoord = showColorWidthAndTexCoord.w;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
bool usePrevious = texCoord == 1.0;
|
|
float expandDir = gl_VertexID % 2 == 1 ? 1.0 : -1.0;
|
|
float polylineAngle;
|
|
|
|
vec4 positionEC = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 prevPositionEC = czm_translateRelativeToEye(prevPositionHigh, prevPositionLow);
|
|
vec4 nextPositionEC = czm_translateRelativeToEye(nextPositionHigh, nextPositionLow);
|
|
|
|
vec4 positionWC = getPolylineWindowCoordinates(positionEC, prevPositionEC, nextPositionEC, expandDir, width, usePrevious, polylineAngle);
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
gl_Position = czm_viewportOrthographic * positionWC * show;
|
|
|
|
v_pickColor = pickColor / 255.0;
|
|
|
|
v_color = color;
|
|
v_color.a *= show;
|
|
|
|
v_st.s = texCoord;
|
|
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
|
|
|
|
v_width = width;
|
|
v_polylineAngle = polylineAngle;
|
|
}
|
|
`;var V3=`in vec4 v_pickColor;
|
|
in vec4 v_color;
|
|
|
|
void main()
|
|
{
|
|
if (v_color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var GD=class GD extends pu{constructor(t=V.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.WIDTH_U8+i,t.width)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getUint8(this.Layout.WIDTH_U8+n),i}toJSON(){return{...super.toJSON(),width:this.width}}};vn(GD,"Layout",{...pu.Layout,WIDTH_U8:pu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:pu.Layout.__BYTE_LENGTH+4}),vn(GD,"DEFAULT_MATERIAL",Object.freeze(new GD));var FK=GD,ry=FK;var pd={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7},Ks=new Au,QK=new ry,VD=new U,Px=new d,UE=new d,zE=new d,GE=new xn,VE=new xn,HE=new xn;function att(e,t,n){let i=t.context;if(n=n||{destroy:ltt},!l(n.attributeArrays)||!l(n.indexArray)){let o=e.vertexCountMax-e.primitiveCount,r=e.vertexCountMax*2;n.indexArray=Ue.createTypedArray(r,o*6),n.attributeArrays={positionHigh:new Float32Array(r*3),positionLow:new Float32Array(r*3),prevPositionHigh:new Float32Array(r*3),prevPositionLow:new Float32Array(r*3),nextPositionHigh:new Float32Array(r*3),nextPositionLow:new Float32Array(r*3),pickColor:new Uint8Array(r*4),showColorWidthAndTexCoord:new Float32Array(r*4)}}if(l(n.pickIds)||(n.pickIds=[]),e._dirtyCount>0){let{_dirtyOffset:o,_dirtyCount:r}=e,{attributeArrays:a,pickIds:s}=n,c=n.indexArray,u=a.positionHigh,f=a.positionLow,h=a.prevPositionHigh,p=a.prevPositionLow,A=a.nextPositionHigh,m=a.nextPositionLow,_=a.pickColor,y=a.showColorWidthAndTexCoord;for(let C=o,E=o+r;C<E;C++){if(e.get(C,Ks),!Ks._dirty)continue;if(e._allowPicking&&Ks._pickId===0){let R=i.createPickId({collection:e,index:C,get primitive(){return e.get(C,new Au)}});Ks._pickId=R.key,s.push(R)}let I=Ks.getPositions();Ks.getMaterial(QK);let x=tn.encodeRGB8(QK.color);U.fromRgba(Ks._pickId,VD);let S=Ks.show,w=Ks.vertexOffset*2,v=(Ks.vertexOffset-C)*6;for(let R=0,N=Ks.vertexCount;R<N;R++){let L=R===0,g=R===N-1;d.fromArray(I,R*3,Px),L?(d.fromArray(I,(R+1)*3,zE),d.subtract(Px,zE,UE),d.add(Px,UE,UE)):g?(d.fromArray(I,(R-1)*3,UE),d.subtract(Px,UE,zE),d.add(Px,zE,zE)):(d.fromArray(I,(R-1)*3,UE),d.fromArray(I,(R+1)*3,zE)),g||(c[v]=w,c[v+1]=w+1,c[v+2]=w+2,c[v+3]=w+2,c[v+4]=w+1,c[v+5]=w+3,v+=6),xn.fromCartesian(Px,GE),xn.fromCartesian(UE,VE),xn.fromCartesian(zE,HE);for(let b=0;b<2;b++)u[w*3]=GE.high.x,u[w*3+1]=GE.high.y,u[w*3+2]=GE.high.z,f[w*3]=GE.low.x,f[w*3+1]=GE.low.y,f[w*3+2]=GE.low.z,h[w*3]=VE.high.x,h[w*3+1]=VE.high.y,h[w*3+2]=VE.high.z,p[w*3]=VE.low.x,p[w*3+1]=VE.low.y,p[w*3+2]=VE.low.z,A[w*3]=HE.high.x,A[w*3+1]=HE.high.y,A[w*3+2]=HE.high.z,m[w*3]=HE.low.x,m[w*3+1]=HE.low.y,m[w*3+2]=HE.low.z,_[w*4]=U.floatToByte(VD.red),_[w*4+1]=U.floatToByte(VD.green),_[w*4+2]=U.floatToByte(VD.blue),_[w*4+3]=U.floatToByte(VD.alpha),y[w*4]=S?1:0,y[w*4+1]=x,y[w*4+2]=QK.width,y[w*4+3]=R/(N-1),w++}Ks._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:o,indexCount:r,vertexOffset:a,vertexCount:s}=ctt(e);n.vertexArray.copyIndexFromRange(n.indexArray,o,r);for(let c in pd)if(Object.hasOwn(pd,c)){let u=c;n.vertexArray.copyAttributeFromRange(pd[u],n.attributeArrays[u],a,s)}}}else{let o=n.attributeArrays;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromTypedArray(n.indexArray)}),attributes:[{index:pd.positionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionHigh,context:i,usage:Re.STATIC_DRAW})},{index:pd.positionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.positionLow,context:i,usage:Re.STATIC_DRAW})},{index:pd.prevPositionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.prevPositionHigh,context:i,usage:Re.STATIC_DRAW})},{index:pd.prevPositionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.prevPositionLow,context:i,usage:Re.STATIC_DRAW})},{index:pd.nextPositionHigh,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.nextPositionHigh,context:i,usage:Re.STATIC_DRAW})},{index:pd.nextPositionLow,componentDatatype:j.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:o.nextPositionLow,context:i,usage:Re.STATIC_DRAW})},{index:pd.pickColor,componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.pickColor,context:i,usage:Re.STATIC_DRAW})},{index:pd.showColorWidthAndTexCoord,componentDatatype:j.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:o.showColorWidthAndTexCoord,context:i,usage:Re.STATIC_DRAW})}]})}return l(n.renderState)||(n.renderState=Ve.fromCache({blending:sn.DISABLED,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=$t.fromCache({context:i,vertexShaderSource:new We({sources:[$l,G3]}),fragmentShaderSource:new We({sources:[V3]}),attributeLocations:pd})),(!l(n.command)||stt(e,n.command))&&(n.command=new it({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Pe.TRIANGLES,pass:Be.OPAQUE,pickId:"v_pickColor",owner:e,count:eme(e),modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolumeWC,debugShowBoundingVolume:e.debugShowBoundingVolume})),t.commandList.push(n.command),e._dirtyCount=0,e._dirtyOffset=0,n}function stt(e,t){let n=P.equals(e.modelMatrix,t._modelMatrix),i=le.equals(e.boundingVolumeWC,t._boundingVolume);return eme(e)!==t._count||e.debugShowBoundingVolume!==t.debugShowBoundingVolume||!n||!i}function eme(e){return(e.vertexCount-e.primitiveCount)*6}function ctt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,Ks);let i=Ks.vertexOffset*2,r=(Ks.vertexOffset-t)*6;e.get(t+n-1,Ks);let a=(Ks.vertexOffset+Ks.vertexCount)*2-i,c=(a/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:a}}function ltt(){let e=this;if(l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ve.removeFromCache(e.renderState),l(e.pickIds))for(let t of e.pickIds)t.destroy()}var H3=att;var kK=class e extends ss{_getCollectionClass(){return e}_getPrimitiveClass(){return Au}_getMaterialClass(){return ry}static _cloneEmpty(t){return new e({primitiveCountMax:t.primitiveCountMax,vertexCountMax:t.vertexCountMax})}add(t,n=new Au){super.add(t,n);let i=this._positionCount;return n._setUint32(Au.Layout.POSITION_OFFSET_U32,i),n._setUint32(Au.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=H3(this,t,this._renderContext))}},WE=kK;function Rx(e,t){this._conditionsExpression=Ye(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,ftt(this,t)}Object.defineProperties(Rx.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function utt(e,t){this.condition=e,this.expression=t}function ftt(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let a=i[r],s=String(a[0]),c=String(a[1]);n.push(new utt(new uh(s,t),new uh(c,t)))}e._runtimeConditions=n}Rx.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};Rx.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};Rx.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",a=o.length;for(let s=0;s<a;++s){let c=o[s],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);r+=` ${s===0?"if":"else if"} (${u})
|
|
{
|
|
return ${f};
|
|
}
|
|
`}return r=`${i} ${e}
|
|
{
|
|
${r} return ${i}(1.0);
|
|
}
|
|
`,r};Rx.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];oi(e,o.condition.getVariables()),oi(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var W3=Rx;function ay(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._lineWidth=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,dtt(this,e)}function dtt(e,t){t=Ye(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??V.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new uh(o[r],i))}e._meta=n,e._ready=!0}function cr(e,t){let n=(e._style??V.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new uh(String(t));if(typeof t=="string")return new uh(t,n);if(l(t.conditions))return new W3(t,n)}else return;return t}function lr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ye(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(ay.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)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=cr(this,e),this._style.lineWidth=lr(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});ay.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new ay(n)})};ay.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};ay.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};ay.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};ay.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&oi(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&oi(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&oi(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var sy=ay;var tme=new d,nme=new tf,ime=new Au,ome=new qs;function htt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[]};for(let o=0;o<n.length;o++)rme(e,n[o],P.IDENTITY,i);return i}function mtt(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function ptt(e,t){let n=mtt(e),i=0;for(let o=0;o<=e.length;o++)if(o===e.length||e[o]===n){let r=o-i;r>0&&t(i,r),i=o+1}}function Att(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.primitiveType,r=Tt.getAttributeBySemantic(e,at.POSITION).count,a=e.indices?Sl.readIndicesAsTypedArray(e.indices):void 0;if(i===Pe.POINTS)t.pointPrimitiveCount+=n.count,t.pointVertexCount+=n.count;else if(i===Pe.LINE_STRIP)t.polylinePrimitiveCount+=n.count,t.polylineVertexCount+=a.length-(n.count-1);else if(i===Pe.TRIANGLES){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=r,t.polygonTriangleCount+=a.length/3;let s=n.polygonHoleCounts;if(s)for(let c=0;c<s.length;c++)t.polygonHoleCount+=s[c]}else throw new ue(`Unexpected primitive type: ${i}`);return t}function gtt(e,t,n){let i=t.vector,o=Tt.getAttributeBySemantic(t,at.POSITION),r=o.typedArray??Sl.readAttributeAsTypedArray(o),a=r.length/3,s=t.indices?Sl.readIndicesAsTypedArray(t.indices):void 0,c=t.featureIds?.[0],u,f;if(c instanceof bn.FeatureIdAttribute&&(u=Tt.getAttributeBySemantic(t,at.FEATURE_ID,c.setIndex),f=u.typedArray??Sl.readAttributeAsTypedArray(u)),n instanceof ty)for(let h=0,p=s?s.length:a;h<p;h++){let A=s?s[h]:h;d.fromArray(r,A*3,tme),n.add({position:tme},nme);let m=Math.trunc(f[A]);m!==c.nullFeatureId&&(nme.featureId=m)}else if(n instanceof WE)ptt(s,(h,p)=>{let A=s[h],m=r.subarray(A*3,(A+p)*3);n.add({positions:m},ime);let _=Math.trunc(f[A]);_!==c.nullFeatureId&&(ime.featureId=_)});else if(n instanceof oy){let h=i.polygonAttributeOffsets,p=i.polygonIndicesOffsets,A=i.polygonHoleCounts,m=i.polygonHoleOffsets,_=h.length;for(let y=0;y<_;y++){let C=h[y],E=y+1<_?h[y+1]:a,I=r.subarray(C*3,E*3),x;if(l(A)&&A[y]>0){let N=A[y];x=m.slice(y,y+N);for(let L=0;L<N;L++)x[y]-=C}let S=p[y],w=y+1<_?p[y+1]:s.length,v=s.slice(S,w);for(let N=0;N<w;N++)v[N]-=C;n.add({positions:I,triangles:v,holes:x},ome);let R=Math.trunc(f[C]);R!==c.nullFeatureId&&(ome.featureId=R)}}}function rme(e,t,n,i){let o=Tt.getNodeTransform(t),r=P.multiplyTransformation(n,o,new P),a=t.primitives;for(let c=0;c<a.length;c++){let u=a[c],f=u.primitiveType;if(!u.vector)continue;let h,p=Att(u);f===Pe.POINTS?h=new ty({primitiveCountMax:p.pointPrimitiveCount}):f===Pe.LINE_STRIP?h=new WE({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount}):f===Pe.TRIANGLES&&(h=new oy({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount})),i.collections.push(h),i.collectionLocalMatrices.push(P.clone(r)),gtt(e,u,h)}let s=t.children;for(let c=0;c<s.length;c++)rme(e,s[c],r,i)}var j3=htt;var UK=new tf,zK=new Au,GK=new qs,HD=new ey,VK=new ry,ame=new ny,sme=new P,HK=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._decodeModel=void 0,this._collections=[],this._collectionLocalMatrices=[],this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=P.clone(P.IDENTITY)}get featuresLength(){return this._collections.reduce((t,n)=>t+n.primitiveCount,0)}get pointsLength(){return this._collections.filter(t=>t instanceof ty).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.filter(t=>t instanceof oy).reduce((t,n)=>t+n.triangleCount,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t){}hasProperty(t,n){return!1}applyDebugSettings(t,n){n=t?n:U.WHITE,this.applyStyle(new sy({color:n}))}applyStyle(t){let n=t.show?.evaluate(null)??!0,i=t.color?.evaluate(null,new U),o=s=>s instanceof ty,r=s=>s instanceof WE,a=s=>s instanceof oy;U.clone(i,HD.color),HD.size=t.pointSize?.evaluate(null),HD.outlineWidth=t.pointOutlineWidth?.evaluate(null),t.pointOutlineColor?.evaluate(null,HD.outlineColor);for(let s of this._collections.filter(o))for(let c=0,u=s.primitiveCount;c<u;c++)s.get(c,UK),UK.show=n,UK.setMaterial(HD);U.clone(i,VK.color),VK.width=t.lineWidth?.evaluate(null)??1;for(let s of this._collections.filter(r))for(let c=0,u=s.primitiveCount;c<u;c++)s.get(c,zK),zK.show=n,zK.setMaterial(VK);U.clone(i,ame.color);for(let s of this._collections.filter(a))for(let c=0,u=s.primitiveCount;c<u;c++)s.get(c,GK),GK.show=n,GK.setMaterial(ame)}update(t,n){if(l(this._decodeModel)&&!this._ready){let i=this._decodeModel;i.modelMatrix=this._tile.computedTransform,i.update(n),i.ready&&(ytt(this),this._decodeModel&&(this._decodeModel.destroy(),this._decodeModel=void 0),this._ready=!0)}P.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,sme);for(let i=0;i<this._collections.length;i++)P.multiplyTransformation(sme,this._collectionLocalMatrices[i],this._collections[i].modelMatrix),this._collections[i].update(n)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._decodeModel?.destroy(),this._decodeModel=void 0,this._collections.forEach(t=>t.destroy()),this._collections.length=0,fe(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=_tt(t,n,r,o),s=await ad.fromGltfAsync(a);return s.show=!1,r._decodeModel=s,r}};function _tt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Be.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function ytt(e){let t=e._decodeModel.sceneGraph.components,n=Tt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P);P.multiplyTransformation(t.transform,n,e._modelMatrix);let i=j3(this,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices}var WD=HK;function Xs(){}Xs._maxSortingConcurrency=Math.max(hn.hardwareConcurrency-1,1);Xs._sorterTaskProcessor=void 0;Xs._taskProcessorReady=!1;Xs._error=void 0;Xs._getSorterTaskProcessor=function(){if(!l(Xs._sorterTaskProcessor)){let e=new Zn("gaussianSplatSorter",Xs._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?Xs._taskProcessorReady=!0:Xs._error=new ue("Gaussian splat sorter could not be initialized.")}).catch(t=>{Xs._error=t}),Xs._sorterTaskProcessor=e}return Xs._sorterTaskProcessor};Xs.radixSortIndexes=function(e){let t=Xs._getSorterTaskProcessor();if(l(Xs._error))throw Xs._error;if(Xs._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var Mx=Xs;function Js(){}Js._maxSortingConcurrency=Math.max(hn.hardwareConcurrency-1,1);Js._textureTaskProcessor=void 0;Js._taskProcessorReady=!1;Js._error=void 0;Js._getTextureTaskProcessor=function(){if(!l(Js._textureTaskProcessor)){let e=new Zn("gaussianSplatTextureGenerator",Js._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?Js._taskProcessorReady=!0:Js._error=new ue("Gaussian splat sorter could not be initialized.")}).catch(t=>{Js._error=t}),Js._textureTaskProcessor=e}return Js._textureTaskProcessor};Js.generateFromAttributes=function(e){let t=Js._getTextureTaskProcessor();if(l(Js._error))throw Js._error;if(!Js._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var Y3=Js;function Ctt(e){let t=new Xg;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ve.getState(Ve.fromCache({depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL}})),this.alphaOptions=new Ex,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT)}var q3=Ctt;var K3=`//
|
|
// Vertex shader for Gaussian splats.
|
|
|
|
// The splats are rendered as quads in view space. Splat attributes are loaded from a texture with precomputed 3D covariance.
|
|
|
|
// Passes local quad coordinates and color to the fragment shader for Gaussian evaluation.
|
|
//
|
|
// Discards splats outside the view frustum or with negligible screen size.
|
|
//
|
|
#if defined(HAS_SPHERICAL_HARMONICS)
|
|
const uint coefficientCount[3] = uint[3](3u,8u,15u);
|
|
const float SH_C1 = 0.48860251;
|
|
const float SH_C2[5] = float[5](
|
|
1.092548430,
|
|
-1.09254843,
|
|
0.315391565,
|
|
-1.09254843,
|
|
0.546274215
|
|
);
|
|
|
|
const float SH_C3[7] = float[7](
|
|
-0.59004358,
|
|
2.890611442,
|
|
-0.45704579,
|
|
0.373176332,
|
|
-0.45704579,
|
|
1.445305721,
|
|
-0.59004358
|
|
);
|
|
|
|
//Retrieve SH coefficient. Currently RG32UI format
|
|
uvec2 loadSHCoeff(uint splatID, int index) {
|
|
ivec2 shTexSize = textureSize(u_sphericalHarmonicsTexture, 0);
|
|
uint dims = coefficientCount[uint(u_sphericalHarmonicsDegree)-1u];
|
|
uint splatsPerRow = uint(shTexSize.x) / dims;
|
|
uint shIndex = (splatID%splatsPerRow) * dims + uint(index);
|
|
ivec2 shPosCoord = ivec2(shIndex, splatID / splatsPerRow);
|
|
return texelFetch(u_sphericalHarmonicsTexture, shPosCoord, 0).rg;
|
|
}
|
|
|
|
//Unpack RG32UI half float coefficients to vec3
|
|
vec3 halfToVec3(uvec2 packed) {
|
|
return vec3(unpackHalf2x16(packed.x), unpackHalf2x16(packed.y).x);
|
|
}
|
|
|
|
vec3 loadAndExpandSHCoeff(uint splatID, int index) {
|
|
uvec2 coeff = loadSHCoeff(splatID, index);
|
|
return halfToVec3(coeff);
|
|
}
|
|
|
|
vec3 evaluateSH(uint splatID, vec3 viewDir) {
|
|
vec3 result = vec3(0.0);
|
|
int coeffIndex = 0;
|
|
float x = viewDir.x, y = viewDir.y, z = viewDir.z;
|
|
|
|
if (u_sphericalHarmonicsDegree >= 1.) {
|
|
vec3 sh1 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh2 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh3 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
result += -SH_C1 * y * sh1 + SH_C1 * z * sh2 - SH_C1 * x * sh3;
|
|
|
|
if (u_sphericalHarmonicsDegree >= 2.) {
|
|
float xx = x * x;
|
|
float yy = y * y;
|
|
float zz = z * z;
|
|
float xy = x * y;
|
|
float yz = y * z;
|
|
float xz = x * z;
|
|
|
|
vec3 sh4 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh5 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh6 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh7 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh8 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
result += SH_C2[0] * xy * sh4 +
|
|
SH_C2[1] * yz * sh5 +
|
|
SH_C2[2] * (2.0f * zz - xx - yy) * sh6 +
|
|
SH_C2[3] * xz * sh7 +
|
|
SH_C2[4] * (xx - yy) * sh8;
|
|
|
|
if (u_sphericalHarmonicsDegree >= 3.) {
|
|
vec3 sh9 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh10 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh11 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh12 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh13 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh14 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
vec3 sh15 = loadAndExpandSHCoeff(splatID, coeffIndex++);
|
|
result += SH_C3[0] * y * (3.0f * xx - yy) * sh9 +
|
|
SH_C3[1] * xy * z * sh10 +
|
|
SH_C3[2] * y * (4.0f * zz - xx - yy) * sh11 +
|
|
SH_C3[3] * z * (2.0f * zz - 3.0f * xx - 3.0f * yy) * sh12 +
|
|
SH_C3[4] * x * (4.0f * zz - xx - yy) * sh13 +
|
|
SH_C3[5] * z * (xx - yy) * sh14 +
|
|
SH_C3[6] * x * (xx - 3.0f * yy) * sh15;
|
|
}
|
|
}
|
|
}
|
|
return result;
|
|
}
|
|
#endif
|
|
|
|
// Transforms and projects splat covariance into screen space and extracts the major and minor axes of the Gaussian ellipsoid
|
|
// which is used to calculate the vertex position in clip space.
|
|
vec4 calcCovVectors(vec3 viewPos, mat3 Vrk) {
|
|
vec4 t = vec4(viewPos, 1.0);
|
|
vec2 focal = vec2(czm_projection[0][0] * czm_viewport.z, czm_projection[1][1] * czm_viewport.w);
|
|
|
|
vec2 J1 = focal / t.z;
|
|
vec2 J2 = -focal * vec2(t.x, t.y) / (t.z * t.z);
|
|
mat3 J = mat3(
|
|
J1.x, 0.0, J2.x,
|
|
0.0, J1.y, J2.y,
|
|
0.0, 0.0, 0.0
|
|
);
|
|
|
|
mat3 R = mat3(czm_modelView);
|
|
|
|
//transform our covariance into view space
|
|
//ensures orientation is correct
|
|
mat3 Vrk_view = R * Vrk * transpose(R);
|
|
mat3 cov = transpose(J) * Vrk_view * J;
|
|
|
|
float diagonal1 = cov[0][0] + .3;
|
|
float offDiagonal = cov[0][1];
|
|
float diagonal2 = cov[1][1] + .3;
|
|
|
|
float mid = 0.5 * (diagonal1 + diagonal2);
|
|
float radius = length(vec2((diagonal1 - diagonal2) * 0.5, offDiagonal));
|
|
float lambda1 = mid + radius;
|
|
float lambda2 = max(mid - radius, 0.1);
|
|
|
|
vec2 diagonalVector = normalize(vec2(offDiagonal, lambda1 - diagonal1));
|
|
|
|
return vec4(
|
|
min(sqrt(2.0 * lambda1), 1024.0) * diagonalVector,
|
|
min(sqrt(2.0 * lambda2), 1024.0) * vec2(diagonalVector.y, -diagonalVector.x)
|
|
);
|
|
}
|
|
|
|
highp vec4 discardVec = vec4(0.0, 0.0, 2.0, 1.0);
|
|
|
|
void main() {
|
|
uint texIdx = uint(a_splatIndex);
|
|
// u_splatRowMask and u_splatRowShift encode the row width of the splat
|
|
// attribute texture. The texture width is always maximumTextureSize, which
|
|
// varies by GPU, so these are passed as uniforms rather than constants.
|
|
// rowMask = maximumTextureSize/2 - 1
|
|
// rowShift = log2(maximumTextureSize/2)
|
|
uint rowMask = uint(u_splatRowMask);
|
|
uint rowShift = uint(u_splatRowShift);
|
|
ivec2 posCoord = ivec2(int((texIdx & rowMask) << 1), int(texIdx >> rowShift));
|
|
vec4 splatPosition = vec4( uintBitsToFloat(uvec4(texelFetch(u_splatAttributeTexture, posCoord, 0))) );
|
|
|
|
vec4 splatViewPos = czm_modelView * vec4(splatPosition.xyz, 1.0);
|
|
vec4 clipPosition = czm_projection * splatViewPos;
|
|
|
|
float clip = 1.2 * clipPosition.w;
|
|
if (clipPosition.z < -clip || clipPosition.x < -clip || clipPosition.x > clip ||
|
|
clipPosition.y < -clip || clipPosition.y > clip) {
|
|
gl_Position = vec4(0.0, 0.0, 2.0, 1.0);
|
|
return;
|
|
}
|
|
|
|
ivec2 covCoord = ivec2(int(((texIdx & rowMask) << 1) | 1u), int(texIdx >> rowShift));
|
|
uvec4 covariance = uvec4(texelFetch(u_splatAttributeTexture, covCoord, 0));
|
|
|
|
gl_Position = clipPosition;
|
|
|
|
vec2 u1 = unpackHalf2x16(covariance.x) ;
|
|
vec2 u2 = unpackHalf2x16(covariance.y);
|
|
vec2 u3 = unpackHalf2x16(covariance.z);
|
|
mat3 Vrk = mat3(u1.x, u1.y, u2.x, u1.y, u2.y, u3.x, u2.x, u3.x, u3.y);
|
|
|
|
vec4 covVectors = calcCovVectors(splatViewPos.xyz, Vrk);
|
|
|
|
if (dot(covVectors.xy, covVectors.xy) < 4.0 && dot(covVectors.zw, covVectors.zw) < 4.0) {
|
|
gl_Position = discardVec;
|
|
return;
|
|
}
|
|
|
|
vec2 corner = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2) - 1.;
|
|
|
|
gl_Position += vec4((corner.x * covVectors.xy + corner.y * covVectors.zw) / czm_viewport.zw * gl_Position.w, 0, 0);
|
|
gl_Position.z = clamp(gl_Position.z, -abs(gl_Position.w), abs(gl_Position.w));
|
|
|
|
v_vertPos = corner ;
|
|
v_splatColor = vec4(covariance.w & 0xffu, (covariance.w >> 8) & 0xffu, (covariance.w >> 16) & 0xffu, (covariance.w >> 24) & 0xffu) / 255.0;
|
|
#if defined(HAS_SPHERICAL_HARMONICS)
|
|
vec4 splatWC = czm_inverseView * splatViewPos;
|
|
vec3 viewDirModel = normalize(u_inverseModelRotation * (splatWC.xyz - u_cameraPositionWC.xyz));
|
|
|
|
v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb;
|
|
#endif
|
|
v_splitDirection = u_splitDirection;
|
|
}`;var X3=`//
|
|
// Fragment shader for Gaussian splats.
|
|
// Renders a Gaussian splat within a quad, discarding fragments outside the unit circle.
|
|
// Applies an approximate Gaussian falloff based on distance from the center and outputs
|
|
// a color modulated by the alpha and Gaussian weight.
|
|
//
|
|
void main() {
|
|
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
|
|
float A = -dot(v_vertPos, v_vertPos);
|
|
if (A < -4.) {
|
|
discard;
|
|
}
|
|
|
|
float B = exp(A * 4.) * v_splatColor.a ;
|
|
out_FragColor = vec4(v_splatColor.rgb * B , B);
|
|
}
|
|
`;var jE=new P,hme=new P,jD=new P,Ai=new J,YD=new Qe,Ett=new d,Itt=new Qe,btt=new d,xtt=1e-12,J3=1e-5,WK=1e-7,ws={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},wa={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Ttt=2,Stt=30,wtt=3,Btt=.008726646259971648,Dtt=1;function vtt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<wtt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||d.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Dtt?!0:d.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Btt:!1}function cme(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(d.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,d.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function Ptt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function lme(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function jK(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function ume(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Rtt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let o=0;o<n.length;o++){let r=n[o];t-r.frameNumber>0?r.texture.destroy():i.push(r)}e._retiredTextures=i}function Mtt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function Ntt(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=Mtt(e._snapshot,t);for(let s=0;s<o.length;s++){let c=o[s];if(c.length>=i&&c.buffer!==r)return c}let a=j.createTypedArray(n,i);return o.push(a),a}function Ltt(e,t){return e.length===t?e:e.subarray(0,t)}function Ott(e,t,n){if(!l(t.indexes)||t.state!==wa.READY)throw new de("Committing snapshot before it is READY.");let i=n.frameNumber,o=e._snapshot,r=l(o)?o.gaussianSplatTexture:e.gaussianSplatTexture;l(r)&&r!==t.gaussianSplatTexture&&ume(e,r,i);let a=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(a)&&a!==t.sphericalHarmonicsTexture&&ume(e,a,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=ws.IDLE,e._dirty=!1}async function Ftt(e,t,n,i){try{let o=await i,r=Nt.maximumTextureSize,a=r,s=Math.ceil(n.numSplats/(r/2)),c=Math.log2(r/2),u=r/2-1;if(s>r){let A=n.numSplats;s=r;let m=a/2;if(n.numSplats=r*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let _=n.shData.length/A;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*_))}n.splatBudgetSSEScale=A/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${A} splats exceed the maximum texture capacity (${r}\xD7${m} = ${n.numSplats} splats at width=${a}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=a*s*4,h;f<=o.data.length?h=o.data.subarray(0,f):(h=new Uint32Array(f),h.set(o.data));let p={width:a,height:s,data:h};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=wa.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=dme(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let A=n.gaussianSplatTexture;n.gaussianSplatTexture=dme(t.context,p),A.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let A=n.sphericalHarmonicsTexture,m=Nt.maximumTextureSize,_=n.shCoefficientCount/3,y=Math.floor(m/_),C=y*(_*2),E=Math.ceil(n.numSplats/y);if(E>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${E} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(A)&&A.destroy(),n.sphericalHarmonicsTexture=void 0;else{let I=new Uint32Array(m*E*2),x=0;for(let S=0;x<n.shData.length;S+=m*2)I.set(n.shData.subarray(x,x+C),S),x+=C;n.sphericalHarmonicsTexture=ktt(t.context,{data:I,width:m,height:E}),l(A)&&A.destroy()}}n.state=wa.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=wa.BUILDING}}async function Qtt(e,t,n,i){try{let o=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let r=n.expectedCount,a=r,s=o?.length;if(r!==a||s!==r){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===wa.SORTING&&(n.snapshot.state=wa.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=wa.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,Ott(e,c,t),e._pendingSnapshot=void 0,Dl.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===wa.SORTING&&(n.snapshot.state=wa.TEXTURE_READY),e._sorterState=ws.ERROR,e._sorterError=o}}async function fme(e,t,n){try{let i=await n,o=lme(e,t),r=t?.expectedCount,a=r,s=i?.length;if(!o||(r!==a||s!==r)){o&&(e._sorterPromise=void 0,e._sorterState=ws.IDLE);return}e._indexes=i,e._sorterState=ws.SORTED}catch(i){if(!lme(e,t))return;e._sorterState=ws.ERROR,e._sorterError=i}}function ktt(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RG_INTEGER,pixelDatatype:He.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function dme(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RGBA_INTEGER,pixelDatatype:He.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function Dl(e){e=e??V.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new P,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Qr.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new P,this._rootTransform=void 0,this._axisCorrectionMatrix=Tt.getAxisCorrectionMatrix(so.Y,so.X,new P),this._shInverseRotation=new J,this._isDestroyed=!1,this._sorterState=ws.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new d,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new d,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(Dl.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===wa.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});Dl.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};Dl.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,jK(this._pendingSnapshot),jK(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),fe(this)};Dl.prototype.isDestroyed=function(){return this._isDestroyed};Dl.prototype.onTileLoad=function(e){this._dirty=!0};Dl.prototype.onTileVisible=function(e){};Dl.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=P.multiplyTransformation(t,i._axisCorrectionMatrix,jE);P.multiplyTransformation(r,e.content.worldTransform,r);let a=P.inverse(o,hme),s=P.multiplyTransformation(a,r,jE),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&P.equalsEpsilon(s,c,xtt))return;let u=e.content.positions,f=e.content.rotations,h=e.content.scales,p=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]),A=Math.sqrt(s[4]*s[4]+s[5]*s[5]+s[6]*s[6]),m=Math.sqrt(s[8]*s[8]+s[9]*s[9]+s[10]*s[10]);Ai[0]=s[0]/p,Ai[1]=s[1]/p,Ai[2]=s[2]/p,Ai[3]=s[4]/A,Ai[4]=s[5]/A,Ai[5]=s[6]/A,Ai[6]=s[8]/m,Ai[7]=s[9]/m,Ai[8]=s[10]/m;let _=Ai[0]*Ai[3]+Ai[1]*Ai[4]+Ai[2]*Ai[5],y=Ai[0]*Ai[6]+Ai[1]*Ai[7]+Ai[2]*Ai[8],C=Ai[3]*Ai[6]+Ai[4]*Ai[7]+Ai[5]*Ai[8],E=Math.abs(p-1)<=WK&&Math.abs(A-1)<=WK&&Math.abs(m-1)<=WK,I=Math.abs(_)<=J3&&Math.abs(y)<=J3&&Math.abs(C)<=J3,x=Ai[0]*(Ai[4]*Ai[8]-Ai[5]*Ai[7])-Ai[3]*(Ai[1]*Ai[8]-Ai[2]*Ai[7])+Ai[6]*(Ai[1]*Ai[5]-Ai[2]*Ai[4]),S=E&&I&&Math.abs(x-1)<=J3;Qe.fromRotationMatrix(Ai,YD),Qe.normalize(YD,YD);let w=Tt.getAttributeBySemantic(n,at.POSITION).typedArray,v=Tt.getAttributeBySemantic(n,at.ROTATION).typedArray,R=Tt.getAttributeBySemantic(n,at.SCALE).typedArray,N=Ett,L=Itt,g=btt;for(let b=0;b<w.length/3;++b)N.x=w[b*3],N.y=w[b*3+1],N.z=w[b*3+2],L.x=v[b*4],L.y=v[b*4+1],L.z=v[b*4+2],L.w=v[b*4+3],g.x=R[b*3],g.y=R[b*3+1],g.z=R[b*3+2],S?(P.multiplyByPoint(s,N,N),Qe.multiply(YD,L,L),Qe.normalize(L,L)):(P.fromTranslationQuaternionRotationScale(N,L,g,jD),P.multiplyTransformation(s,jD,jD),P.getTranslation(jD,N),P.getScale(jD,g),Qe.multiply(YD,L,L),Qe.normalize(L,L)),u[b*3]=N.x,u[b*3+1]=N.y,u[b*3+2]=N.z,f[b*4]=L.x,f[b*4+1]=L.y,f[b*4+2]=L.z,f[b*4+3]=L.w,h[b*3]=g.x,h[b*3+1]=g.y,h[b*3+2]=g.z;e.content._lastSplatTransform=P.clone(s,e.content._lastSplatTransform),e.content._transformed=!0};Dl.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==wa.BUILDING)return;n.state=wa.TEXTURE_PENDING;let i=Y3.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=wa.BUILDING;return}Ftt(e,t,n,i)};Dl.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new q3(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=sn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Be.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",he.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",he.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",he.VERTEX),o.addUniform("float","u_splatScale",he.VERTEX),o.addUniform("vec3","u_cameraPositionWC",he.VERTEX),o.addUniform("mat3","u_inverseModelRotation",he.VERTEX);let a=i.uniformMap;o.addUniform("int","u_splatRowMask",he.VERTEX),o.addUniform("int","u_splatRowShift",he.VERTEX);let s=e.gaussianSplatTexture;a.u_splatAttributeTexture=function(){return s},a.u_splatRowMask=function(){return e._splatRowMask},a.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",he.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",he.VERTEX),a.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),a.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},a.u_cameraPositionWC=function(){return d.clone(t.camera.positionWC)},a.u_inverseModelRotation=function(){return e._shInverseRotation},a.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Pe.TRIANGLE_STRIP,o.addVertexLines(K3),o.addFragmentLines(X3);let u=o.buildShaderProgram(t.context),f=Ye(Ve.fromCache(i.renderStateOptions),!0);f.cull.face=Tt.getCullFace(n.modelMatrix,Pe.TRIANGLE_STRIP),f=Ve.fromCache(f);let h={screenQuadPosition:0,splatIndex:2},p=new bn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=j.UNSIGNED_INT,p.type=zt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let C=new yt({attributes:{screenQuadPosition:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Pe.TRIANGLE_STRIP});e._vertexArray=Vn.fromGeometry({context:t.context,geometry:C,attributeLocations:h,bufferUsage:Re.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=P.clone(e._rootTransform,e._drawCommandModelMatrix),_=e._vertexArray,y=new it({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:a,renderState:f,vertexArray:_,shaderProgram:u,cull:r.cull.enabled,pass:Be.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Pe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=y};Dl.prototype.update=function(e){let t=this._tileset;if(Rtt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===ws.IDLE){let o=t._selectedTiles.length!==0&&Ptt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):o?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(o||this._dirty)&&(this._needsSnapshotRebuild=!0);let r=this._selectedTilesStableFrames>=Ttt,a=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let s=r||a||this._snapshotRebuildStallFrames>=Stt;if(!(this._dirty||this._needsSnapshotRebuild||o||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&P.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&s){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=ws.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&jK(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let x=u[0],S=P.multiplyTransformation(x.computedTransform,this._axisCorrectionMatrix,hme);P.multiplyTransformation(S,x.content.worldTransform??P.IDENTITY,S),P.getRotation(P.inverse(S,S),this._shInverseRotation)}for(let x of u)Dl.transformTile(x);let f=u.reduce((x,S)=>x+S.content.pointsLength,0),h=(x,S,w,v)=>{let R,N=0,L=0;for(let g of u){let b=w(g.content),T=l(v)?v:zt.getNumberOfComponents(b.type),B=l(b.typedArray)?b.typedArray:b;L+=B.length,l(R)||(R=Ntt(this,x,S,f*T))}if(!l(R))return j.createTypedArray(S,0);for(let g of u){let b=g.content,T=w(b),B=l(T.typedArray)?T.typedArray:T;R.set(B,N),N+=B.length}return Ltt(R,L)},p=()=>{let x=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:x=9;break;case 2:x=24;break;case 3:x=45;break}break}if(x===0)return;let S=f*(x*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<S)&&(this._scratchAggregateShBuffer=new Uint32Array(S));let w=this._scratchAggregateShBuffer,v=0;for(let R of u){let N=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(w.set(N,v),v+=N.length)}return v<w.length?w.subarray(0,v):w},A=h("positions",j.FLOAT,x=>x.positions,3),m=h("scales",j.FLOAT,x=>x.scales,3),_=h("rotations",j.FLOAT,x=>x.rotations,4),y=h("colors",j.UNSIGNED_BYTE,x=>Tt.getAttributeBySemantic(x.gltfPrimitive,at.COLOR)),C=u[0].content.sphericalHarmonicsDegree,E=C>0?u[0].content.sphericalHarmonicsCoefficientCount:0,I=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:A,rotations:_,scales:m,colors:y,shData:I,sphericalHarmonicsDegree:C,shCoefficientCount:E,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:wa.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===wa.BUILDING){Dl.generateSplatTexture(this,e,u);return}if(u.state===wa.TEXTURE_PENDING||u.state===wa.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,jE),u.state===wa.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,h=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:h,expectedCount:u.numSplats,snapshot:u};let p=Mx.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(jE),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=wa.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=wa.SORTING;let A=this._pendingSort;Qtt(this,e,A,p);return}if(!l(this._pendingSortPromise)){u.state===wa.SORTING&&(u.state=wa.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,jE),!l(this._sorterPromise)){if(!vtt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,h=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:h};let p=Mx.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(jE),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){cme(this,e);let A=this._activeSort;this._sorterState=ws.SORTING,fme(this,A,p);return}}if(!l(this._sorterPromise)){this._sorterState=ws.WAITING;return}this._sorterState=ws.SORTING;return}else if(this._sorterState===ws.WAITING){if(!l(this._sorterPromise)){let o=++this._sortRequestId,r=this._splatDataGeneration,a=this._numSplats;this._activeSort={requestId:o,dataGeneration:r,expectedCount:a};let s=Mx.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(jE),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=s,l(s)){cme(this,e);let c=this._activeSort;this._sorterState=ws.SORTING,fme(this,c,s);return}}if(!l(this._sorterPromise)){this._sorterState=ws.WAITING;return}this._sorterState=ws.SORTING;return}else{if(this._sorterState===ws.SORTING)return;if(this._sorterState===ws.SORTED)Dl.buildGSplatDrawCommand(this,e),this._sorterState=ws.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===ws.ERROR)throw this._sorterError}this._dirty=!1}};var Z3=Dl;function nf(e,t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._loader=e,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new Z3({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}nf.tilesetRequiresGaussianSplattingExt=function(e){let t=!1;return e.isGltfExtensionRequired instanceof Function&&(t=e.isGltfExtensionRequired("KHR_gaussian_splatting")&&e.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),e.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Gs("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions
|
|
|
|
Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),t};Object.defineProperties(nf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return this.gltfPrimitive.attributes[0].count}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){let e=this._tileset?.gaussianSplatPrimitive;if(!l(e))return 0;let t=e.gaussianSplatTexture,n=e.selectedTileLength;return!l(t)||n===0?0:t.sizeInBytes/n}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},transformed:{get:function(){return this._transformed}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}},positions:{get:function(){return this._positions}},rotations:{get:function(){return this._rotations}},scales:{get:function(){return this._scales}},sphericalHarmonicsCoefficientCount:{get:function(){return this._sphericalHarmonicsCoefficientCount}},sphericalHarmonicsDegree:{get:function(){return this._sphericalHarmonicsDegree}},packedSphericalHarmonicsData:{get:function(){return this._packedSphericalHarmonicsData}}});function Utt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function ztt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var mme=new ArrayBuffer(4),Gtt=new Float32Array(mme),Vtt=new Uint32Array(mme);function YK(e){Gtt[0]=e;let t=Vtt[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let a=i-127+15;a>=31?r=n<<15|31744:a<=0?r=n<<15:r=n<<15|a<<10|o>>>13}return r}function Htt(e){let t=Utt(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),a=parseInt(e.slice(o+n.length),10);return{l:r,n:a}}function Wtt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),a=0,s=[0,9,24];switch(t){case 1:a=9;break;case 2:a=24;break;case 3:a=45;break}r.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=a*(2/3);for(let u=0;u<r.length;u++){let{l:f,n:h}=Htt(r[u].name);for(let p=0;p<e.pointsLength;p++){let A=s[f-1]*2/3,m=p*c+A+h*2,_=p*3;o[m]=YK(r[u].typedArray[_])|YK(r[u].typedArray[_+1])<<16,o[m+1]=YK(r[u].typedArray[_+2])}}return o}nf.fromGltf=async function(e,t,n,i){let o=n,r=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:so.Y,forwardAxis:so.Z};l(i.asset)?(a.gltfJson=i,a.baseResource=r,a.gltfResource=r):i instanceof Uint8Array?(a.typedArray=i,a.baseResource=r,a.gltfResource=r):a.gltfResource=De.createIfNeeded(i);let s=new td(a);try{await s.load()}catch(c){throw s.destroy(),new ue(`Failed to load glTF: ${c.message}`)}return new nf(s,e,t,n)};nf.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=n.components.scene.nodes[0].primitives[0],this.worldTransform=n.components.scene.nodes[0].matrix,this._ready=!0,this._positions=Tt.getAttributeBySemantic(this.gltfPrimitive,at.POSITION).typedArray.slice(),this._rotations=Tt.getAttributeBySemantic(this.gltfPrimitive,at.ROTATION).typedArray.slice(),this._scales=Tt.getAttributeBySemantic(this.gltfPrimitive,at.SCALE).typedArray.slice();let{l:i,n:o}=ztt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=i,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Wtt(this);return}this._resourcesLoaded=n.process(t)}};nf.prototype.hasProperty=function(e,t){return!1};nf.prototype.getFeature=function(e){};nf.prototype.applyDebugSettings=function(e,t){};nf.prototype.applyStyle=function(e){};nf.prototype.pick=function(e,t,n){};nf.prototype.isDestroyed=function(){return this.isDestroyed};nf.prototype.destroy=function(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),fe(this)};var YE=nf;var pme={b3dm:function(e,t,n,i,o){return sd.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return sd.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return sd.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return _F.fromTileType(e,t,n,i,o,pme)},externalTileset:function(e,t,n,i){return h3.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new TF(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new M3(e,t,n,i,o)},subt:function(e,t,n,i,o){return GB.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return GB.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ue("Invalid glb content");let s=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,s);return YE.tilesetRequiresGaussianSplattingExt(e)?YE.fromGltf(e,t,n,c):e.isGltfExtensionUsed("CESIUM_mesh_vector")?WD.fromGltf(e,t,n,c):sd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return YE.tilesetRequiresGaussianSplattingExt(e)?YE.fromGltf(e,t,n,i):e.isGltfExtensionUsed("CESIUM_mesh_vector")?WD.fromGltf(e,t,n,i):sd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return sd.fromGeoJson(e,t,n,i)}},Nx=pme;var jtt={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},br=Object.freeze(jtt);var Sh={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"};Sh.isBinaryFormat=function(e){switch(e){case Sh.BATCHED_3D_MODEL:case Sh.INSTANCED_3D_MODEL:case Sh.COMPOSITE:case Sh.POINT_CLOUD:case Sh.VECTOR:case Sh.GEOMETRY:case Sh.IMPLICIT_SUBTREE:case Sh.VOXEL_BINARY:case Sh.GLTF_BINARY:return!0;default:return!1}};var Bs=Object.freeze(Sh);var Ytt={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},wh=Object.freeze(Ytt);var Ds={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},UA=new Array(Ds.NUMBER_OF_PASSES);UA[Ds.RENDER]=Object.freeze({pass:Ds.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});UA[Ds.PICK]=Object.freeze({pass:Ds.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});UA[Ds.SHADOW]=Object.freeze({pass:Ds.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});UA[Ds.PRELOAD]=Object.freeze({pass:Ds.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});UA[Ds.PRELOAD_FLIGHT]=Object.freeze({pass:Ds.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});UA[Ds.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ds.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});UA[Ds.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ds.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});UA[Ds.MOST_DETAILED_PICK]=Object.freeze({pass:Ds.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ds.getPassOptions=function(e){return UA[e]};var ur=Object.freeze(Ds);function sp(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(sp.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){}}});sp.prototype.hasProperty=function(e,t){return!1};sp.prototype.getFeature=function(e){};sp.prototype.applyDebugSettings=function(e,t){};sp.prototype.applyStyle=function(e){};sp.prototype.update=function(e,t){};sp.prototype.pick=function(e,t,n){};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return fe(this)};var qD=sp;function zA(e){e=e??V.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(zA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});zA.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,this._class)};zA.prototype.hasPropertyBySemantic=function(e){return Kn.hasPropertyBySemantic(e,this._properties,this._class)};zA.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,this._class,e)};zA.prototype.getProperty=function(e){return Kn.getProperty(e,this._properties,this._class)};zA.prototype.setProperty=function(e,t){return Kn.setProperty(e,t,this._properties,this._class)};zA.prototype.getPropertyBySemantic=function(e){return Kn.getPropertyBySemantic(e,this._properties,this._class)};zA.prototype.setPropertyBySemantic=function(e,t){return Kn.setPropertyBySemantic(e,t,this._properties,this._class)};var $3=zA;function qK(e,t){let n=Si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){qK._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??V.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new $3({content:n,class:o})}}qK._oneTimeWarning=bt;var Lx=qK;function qtt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=Si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(a){return a===o});return r>=0?i[r]:void 0}var Ox=qtt;function GA(e){e=e??V.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(GA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});GA.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,this._class)};GA.prototype.hasPropertyBySemantic=function(e){return Kn.hasPropertyBySemantic(e,this._properties,this._class)};GA.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,this._class,e)};GA.prototype.getProperty=function(e){return Kn.getProperty(e,this._properties,this._class)};GA.prototype.setProperty=function(e,t){return Kn.setProperty(e,t,this._properties,this._class)};GA.prototype.getPropertyBySemantic=function(e){return Kn.getPropertyBySemantic(e,this._properties,this._class)};GA.prototype.setPropertyBySemantic=function(e,t){return Kn.setPropertyBySemantic(e,t,this._properties,this._class)};var eU=GA;function KK(e,t){let n=Si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){KK._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??V.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new eU({tile:n,class:o})}}KK._oneTimeWarning=bt;var tU=KK;function Ktt(e){let t=new Uint8Array(e),n=km(t);if(n==="glTF"&&(n="glb"),Bs.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Xtt(t);if(l(i.root))return{contentType:Bs.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Bs.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Bs.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Bs.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Bs.VOXEL_JSON,jsonPayload:i};throw new ue("Invalid tile content.")}function Xtt(e){let t;try{t=Pr(e)}catch{throw new ue("Invalid tile content.")}return t}var cy=Ktt;function Ad(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=l(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let a=0;a<r;a++){let s=n.getDerivedResource({url:o[a].uri}),c=sl.getServerKey(s.getUrlComponent());this._innerContentResources[a]=s,this._serverKeys[a]=c}}Object.defineProperties(Ad.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){}},batchTable:{get:function(){}},group:{get:function(){},set:function(){}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function XK(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Ame(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)}Ad.prototype.requestInnerContents=function(){if(!Jtt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;XK(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=Ztt(this,n,t,this._tile._contentState);return $tt(this)};function Jtt(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!sl.serverHasOpenSlots(n,t[n]))return!1;return sl.heapHasOpenSlots(e.length)}function Ztt(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,a=function(){return r._priority},s=e._serverKeys[t],c=new Br({throttle:!0,throttleByServer:!0,type:es.TILES3D,priorityFunction:a,serverKey:s});o.request=c,e._requests[t]=c;let u=o.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===yi.CANCELLED){Ame(e,i);return}return XK(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===yi.CANCELLED){Ame(e,i);return}XK(e,-1),gme(e,t,f)}})}async function $tt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,a)=>ent(e,r,a)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function ent(e,t,n){if(l(t))try{let i=cy(t),o=e._tileset,r=e._innerContentResources[n],a=e._tile;i.contentType===Bs.EXTERNAL_TILESET&&(e._externalTilesetCount++,a.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Bs.GEOMETRY||i.contentType===Bs.VECTOR;let s,c=Nx[i.contentType];l(i.binaryPayload)?s=await Promise.resolve(c(o,a,r,i.binaryPayload.buffer,0)):s=await Promise.resolve(c(o,a,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(a.hasImplicitContentMetadata){let h=a.implicitSubtree,p=a.implicitCoordinates;s.metadata=h.getContentMetadataView(p,n)}else a.hasImplicitContent||(s.metadata=Lx(o,u));let f=Ox(o,u);return l(f)&&(s.group=new Tb({metadata:f})),s}catch(i){gme(e,n,i)}}function gme(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}Ad.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];l(t)&&t.cancel()}};Ad.prototype.hasProperty=function(e,t){return!1};Ad.prototype.getFeature=function(e){};Ad.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};Ad.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};Ad.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)};Ad.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,a=r.length;for(let s=0;s<a;++s){let c=r[s].pick(e,t,n);if(!l(c))continue;let u=d.distance(e.origin,c);u<o&&(i=c,o=u)}if(l(i))return n};Ad.prototype.isDestroyed=function(){return!1};Ad.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var nU=Ad;var _me=Math.cos,yme=Math.sin,tnt=Math.sqrt,JK={};JK.computePosition=function(e,t,n,i,o,r,a){let s=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+o*e.granXSin,h=_me(f),p=yme(f),A=s.z*p,m=c.longitude+i*e.granYSin+o*e.granXCos,_=h*_me(m),y=h*yme(m),C=s.x*_,E=s.y*y,I=tnt(C*_+E*y+A*p);if(r.x=C/I,r.y=E/I,r.z=A/I,n){let x=e.stNwCorner;l(x)?(f=x.latitude-e.stGranYCos*i+o*e.stGranXSin,m=x.longitude+i*e.stGranYSin+o*e.stGranXCos,a.x=(m-e.stWest)*e.lonScalar,a.y=(f-e.stSouth)*e.latScalar):(a.x=(m-u.west)*e.lonScalar,a.y=(f-u.south)*e.latScalar)}};var nnt=new Ki,gd=new d,int=new me,iU=new d,KD=new qi;function Cme(e,t,n,i,o,r,a){let s=Math.cos(t),c=i*s,u=n*s,f=Math.sin(t),h=i*f,p=n*f;KD._ellipsoid=te.default,gd=KD.project(e,gd),gd=d.subtract(gd,iU,gd);let A=Ki.fromRotation(t,nnt);gd=Ki.multiplyByVector(A,gd,gd),gd=d.add(gd,iU,gd),e=KD.unproject(gd,e),r-=1,a-=1;let m=e.latitude,_=m+r*p,y=m-c*a,C=m-c*a+r*p,E=Math.max(m,_,y,C),I=Math.min(m,_,y,C),x=e.longitude,S=x+r*u,w=x+a*h,v=x+a*h+r*u,R=Math.max(x,S,w,v),N=Math.min(x,S,w,v);return{north:E,south:I,east:R,west:N,granYCos:c,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}JK.computeOptions=function(e,t,n,i,o,r,a){let s=e.east,c=e.west,u=e.north,f=e.south,h=!1,p=!1;u===D.PI_OVER_TWO&&(h=!0),f===-D.PI_OVER_TWO&&(p=!0);let A,m=u-f;c>s?A=D.TWO_PI-c+s:A=s-c;let _=Math.ceil(A/t)+1,y=Math.ceil(m/t)+1,C=A/(_-1),E=m/(y-1),I=ce.northwest(e,r),x=ce.center(e,int);(n!==0||i!==0)&&(x.longitude<I.longitude&&(x.longitude+=D.TWO_PI),KD._ellipsoid=te.default,iU=KD.project(x,iU));let S=E,w=C,v=0,R=0,N=ce.clone(e,o),L={granYCos:S,granYSin:v,granXCos:w,granXSin:R,nwCorner:I,boundingRectangle:N,width:_,height:y,northCap:h,southCap:p};if(n!==0){let g=Cme(I,n,C,E,x,_,y);u=g.north,f=g.south,s=g.east,c=g.west,L.granYCos=g.granYCos,L.granYSin=g.granYSin,L.granXCos=g.granXCos,L.granXSin=g.granXSin,N.north=u,N.south=f,N.east=s,N.west=c}if(i!==0){n=n-i;let g=ce.northwest(N,a),b=Cme(g,n,C,E,x,_,y);L.stGranYCos=b.granYCos,L.stGranXCos=b.granXCos,L.stGranYSin=b.granYSin,L.stGranXSin=b.granXSin,L.stNwCorner=g,L.stWest=b.west,L.stSouth=b.south}return L};var vs=JK;var ont=new le,rnt=new le,ant=new d,snt=new ce;function Eme(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,a=t.southCap,s=i,c=2,u=0,f=4;r&&(c-=1,s-=1,u+=1,f-=2),a&&(c-=1,s-=1,u+=1,f-=2),u+=c*o+2*s-f;let h=new Float64Array(u*3),p=0,A=0,m,_=ant;if(r)vs.computePosition(t,n,!1,A,0,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;else for(m=0;m<o;m++)vs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;for(m=o-1,A=1;A<i;A++)vs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;if(A=i-1,!a)for(m=o-2;m>=0;m--)vs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;for(m=0,A=i-2;A>0;A--)vs.computePosition(t,n,!1,A,m,_),h[p++]=_.x,h[p++]=_.y,h[p++]=_.z;let y=h.length/3*2,C=Ue.createTypedArray(h.length/3,y),E=0;for(let x=0;x<h.length/3-1;x++)C[E++]=x,C[E++]=x+1;C[E++]=h.length/3-1,C[E++]=0;let I=new yt({attributes:new En,primitiveType:Pe.LINES});return I.attributes.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h}),I.indices=C,I}function cnt(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Eme(e,t),a=t.height,s=t.width,c=wi.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let h=wi.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,A=t.southCap,m=4;p&&(m-=1),A&&(m-=1);let _=(f.length/3+m)*2,y=Ue.createTypedArray(f.length/3,_);u=f.length/6;let C=0;for(let I=0;I<u-1;I++)y[C++]=I,y[C++]=I+1,y[C++]=I+u,y[C++]=I+u+1;y[C++]=u-1,y[C++]=0,y[C++]=u+u-1,y[C++]=u,y[C++]=0,y[C++]=u;let E;if(p)E=a-1;else{let I=s-1;y[C++]=I,y[C++]=I+u,E=s+a-2}if(y[C++]=E,y[C++]=E+u,!A){let I=s+E-1;y[C++]=I,y[C]=I+u}return r.indices=y,r}function Qx(e){e=e??V.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??te.default,o=e.rotation??0,r=e.height??0,a=e.extrudedHeight??r;this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,a),this._rotation=o,this._extrudedHeight=Math.min(r,a),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}Qx.packedLength=ce.packedLength+te.packedLength+5;Qx.pack=function(e,t,n){return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Ime=new ce,bme=te.clone(te.UNIT_SPHERE),Fx={rectangle:Ime,ellipsoid:bme,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};Qx.unpack=function(e,t,n){t=t??0;let i=ce.unpack(e,t,Ime);t+=ce.packedLength;let o=te.unpack(e,t,bme);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._surfaceHeight=a,n._rotation=s,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(Fx.granularity=r,Fx.height=a,Fx.rotation=s,Fx.extrudedHeight=c,Fx.offsetAttribute=u===-1?void 0:u,new Qx(Fx))};var lnt=new me;Qx.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=vs.computeOptions(t,e._granularity,e._rotation,0,snt,lnt),o,r;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let a=e._surfaceHeight,s=e._extrudedHeight,c=!D.equalsEpsilon(a,s,0,D.EPSILON2),u;if(c){if(o=cnt(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,A=new Uint8Array(p);e._offsetAttribute===mn.TOP?A=A.fill(1,0,p/2):(u=e._offsetAttribute===mn.NONE?0:1,A=A.fill(u)),o.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}let f=le.fromRectangle3D(t,n,a,rnt),h=le.fromRectangle3D(t,n,s,ont);r=le.union(f,h)}else{if(o=Eme(e,i),o.attributes.position.values=wi.scaleToGeodeticHeight(o.attributes.position.values,a,n,!1),l(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===mn.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,a)}return new yt({attributes:o.attributes,indices:o.indices,primitiveType:Pe.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var kx=Qx;function zx(e){this.rectangle=ce.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=e.ellipsoid??te.WGS84;mnt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(zx.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});zx.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var xme=new d,oU=new d,Tme=new d,unt=new d,fnt=new d,dnt=new d,hnt=new d,_d=new me,Sme=new cn(d.UNIT_X,0),Ux=new In;function mnt(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),_d.longitude=t.west,_d.latitude=(t.south+t.north)*.5,_d.height=0;let i=n.cartographicToCartesian(_d,dnt),o=d.cross(i,d.UNIT_Z,unt);d.normalize(o,e.westNormal),_d.longitude=t.east;let r=n.cartographicToCartesian(_d,hnt),a=d.cross(d.UNIT_Z,r,xme);d.normalize(a,e.eastNormal);let s=d.subtract(i,r,xme);d.magnitude(s)===0&&(s=d.clone(o,s));let c=d.normalize(s,fnt),u=t.south,f;if(u>0){_d.longitude=(t.west+t.east)*.5,_d.latitude=u;let _=n.cartographicToCartesian(_d,Ux.origin);d.clone(c,Ux.direction);let y=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Sme);di.rayPlane(Ux,y,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(_,oU)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),oU);let h=d.cross(f,s,Tme);d.normalize(h,e.southNormal);let p=t.north,A;if(p<0){_d.longitude=(t.west+t.east)*.5,_d.latitude=p;let _=n.cartographicToCartesian(_d,Ux.origin);d.negate(c,Ux.direction);let y=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Sme);di.rayPlane(Ux,y,e.northeastCornerCartesian),A=n.geodeticSurfaceNormal(_,oU)}else A=n.geodeticSurfaceNormalCartographic(ce.northwest(t),oU);let m=d.cross(s,A,Tme);d.normalize(m,e.northNormal)}var pnt=new d,Ant=new d,gnt=new d(0,-1,0),_nt=new d(0,0,-1),wme=new d;function ynt(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,A=e.eastNormal,m=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),pnt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),Ant),f.z=f.y,f.y=f.x,f.x=0,h=gnt,A=d.UNIT_Y,p=_nt,m=d.UNIT_Z);let _=d.subtract(i,u,wme),y=d.dot(_,h),C=d.dot(_,p),E=d.subtract(i,f,wme),I=d.dot(E,A),x=d.dot(E,m);y>0?r+=y*y:I>0&&(r+=I*I),C>0?r+=C*C:x>0&&(r+=x*x)}let a,s,c;if(t.mode===oe.SCENE3D?(a=o.height,s=e.minimumHeight,c=e.maximumHeight):(a=i.x,s=0,c=0),a>c){let u=a-c;r+=u*u}else if(a<s){let u=s-a;r+=u*u}return Math.sqrt(r)}zx.prototype.distanceToCamera=function(e){let t=ynt(this,e);if(e.mode===oe.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};zx.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};zx.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new kx({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Lt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new Ln({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var yd=zx;var XD={},Cnt=new d,Bme=new d,Dme=new d,vme=new d,Pme=new en;XD.validOutline=function(e){let n=en.fromPoints(e,Pme).halfAxes,i=J.getColumn(n,0,Bme),o=J.getColumn(n,1,Dme),r=J.getColumn(n,2,vme),a=d.magnitude(i),s=d.magnitude(o),c=d.magnitude(r);return!(a===0&&(s===0||c===0)||s===0&&c===0)};XD.computeProjectTo2DArguments=function(e,t,n,i){let o=en.fromPoints(e,Pme),r=o.halfAxes,a=J.getColumn(r,0,Bme),s=J.getColumn(r,1,Dme),c=J.getColumn(r,2,vme),u=d.magnitude(a),f=d.magnitude(s),h=d.magnitude(c),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let A,m;return(p===f||p===h)&&(A=a),p===u?A=s:p===h&&(m=s),(p===u||p===f)&&(m=c),d.normalize(A,n),d.normalize(m,i),d.clone(o.center,t),!0};function Rme(e,t,n,i,o){let r=d.subtract(e,t,Cnt),a=d.dot(n,r),s=d.dot(i,r);return Q.fromElements(a,s,o)}XD.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Rme(i[r],e,t,n);return o}};XD.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Rme(i,e,t,n,o)}};var ly=XD;function Ent(e){let t=e.length,n=new Float64Array(t*3),i=Ue.createTypedArray(t,t*2),o=0,r=0;for(let s=0;s<t;s++){let c=e[s];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=s,i[r++]=(s+1)%t}let a=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:n})});return new yt({attributes:a,indices:i,primitiveType:Pe.LINES})}function qE(e){e=e??V.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,d)+1}qE.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new qE(t)};qE.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var Int={polygonHierarchy:{}};qE.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new qE(Int)),n._polygonHierarchy=i,n.packedLength=o,n};qE.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=jo(n,d.equalsEpsilon,!0),n.length<3||!ly.validOutline(n))return;let o=ni.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let u=new Lt({geometry:Ent(o[c])});r.push(u)}let a=jn.combineInstances(r)[0],s=le.fromPoints(t.positions);return new yt({attributes:a.attributes,indices:a.indices,primitiveType:a.primitiveType,boundingSphere:s})};var Bh=qE;var rU=new me;function JD(e){let t=__.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??te.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=Pnt(t,n,i,o);this._boundingPlanes=r;let a=Lnt(r);this._vertices=a,this._edgeNormals=new Array(6),this._edgeNormals[0]=rX(r[0],a.slice(0,4));let s;for(s=0;s<4;s++)this._edgeNormals[0][s]=d.negate(this._edgeNormals[0][s],this._edgeNormals[0][s]);for(this._edgeNormals[1]=rX(r[1],a.slice(4,8)),s=0;s<4;s++)this._edgeNormals[2+s]=rX(r[2+s],[a[s%4],a[(s+1)%4],a[4+(s+1)%4],a[4+s]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],s=0;s<4;s++)this._planeVertices.push([this._vertices[s%4],this._vertices[(s+1)%4],this._vertices[4+(s+1)%4],this._vertices[4+s]]);let c=t.getCenter();rU=o.cartesianToCartographic(c,rU),rU.height=(i+n)/2,this.center=o.cartographicToCartesian(rU,c),this._boundingSphere=le.fromPoints(a)}var bnt=new d,xnt=new me,Tnt=new d,Snt=new me,wnt=new d,Bnt=new d,Dnt=new d,vnt=new d;function Pnt(e,t,n,i){let o=new Array(6),r=e.getCenter(),a=i.geodeticSurfaceNormal(r,bnt),s=i.cartesianToCartographic(r,xnt);s.height=n;let c=i.cartographicToCartesian(s,Tnt),u=cn.fromPointNormal(c,a);o[0]=u;let f=0,h,p=[],A,m;for(h=0;h<4;h++){A=e.getVertex(h),p[h]=A,m=i.cartesianToCartographic(A,Snt),m.height=t;let y=cn.getPointDistance(u,i.cartographicToCartesian(m,wnt));y<f&&(f=y)}let _=cn.clone(u);for(_.normal=d.negate(_.normal,_.normal),_.distance=_.distance*-1+f,o[1]=_,h=0;h<4;h++){A=p[h];let y=p[(h+1)%4],C=i.geodeticSurfaceNormal(A,Bnt),E=d.subtract(y,A,vnt),I=d.cross(E,C,Dnt);I=d.normalize(I,I),o[2+h]=cn.fromPointNormal(A,I)}return o}var KE=new d,XE=new d,JE=new d,ZK=new d,$K=new d,eX=new d,Rnt=new d,Mnt=new d,Nnt=new d,tX=new d,nX=new d,iX=new d,uy=new d,cp=new J;function Mme(e,t,n){KE=e.normal,XE=t.normal,JE=n.normal,ZK=d.multiplyByScalar(e.normal,-e.distance,ZK),$K=d.multiplyByScalar(t.normal,-t.distance,$K),eX=d.multiplyByScalar(n.normal,-n.distance,eX),tX=d.multiplyByScalar(d.cross(XE,JE,Rnt),d.dot(ZK,KE),tX),nX=d.multiplyByScalar(d.cross(JE,KE,Mnt),d.dot($K,XE),nX),iX=d.multiplyByScalar(d.cross(KE,XE,Nnt),d.dot(eX,JE),iX),cp[0]=KE.x,cp[1]=XE.x,cp[2]=JE.x,cp[3]=KE.y,cp[4]=XE.y,cp[5]=JE.y,cp[6]=KE.z,cp[7]=XE.z,cp[8]=JE.z;let i=J.determinant(cp);return uy=d.add(tX,nX,uy),uy=d.add(uy,iX,uy),new d(uy.x/i,uy.y/i,uy.z/i)}function Lnt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Mme(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Mme(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var oX=new d,Gx=new d;function rX(e,t){let n=[];for(let i=0;i<4;i++)oX=d.subtract(t[(i+1)%4],t[i],oX),Gx=d.cross(e.normal,oX,Gx),Gx=d.normalize(Gx,Gx),n[i]=d.clone(Gx);return n}Object.defineProperties(JD.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var aX=new d;JD.prototype.distanceToCamera=function(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,a;for(r=0;r<4;r++)a=2+r,cn.getPointDistance(this._boundingPlanes[a],t)>0&&(n.push(a),i.push(this._planeVertices[a]),o=this._edgeNormals[a]);if(n.length===0)return 0;let s,c;if(n.length===1)return c=this._boundingPlanes[n[0]],s=sX(cn.projectPointOntoPlane(c,t,aX),i[0],c,o),d.distance(s,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 s=Nme(t,p[0],p[1]),d.distance(s,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],s=sX(cn.projectPointOntoPlane(c,t,aX),i[r],c,this._edgeNormals[n[r]]),h=d.distanceSquared(s,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return s=sX(cn.projectPointOntoPlane(this._boundingPlanes[1],t,aX),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(s,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var Ont=new d,Fnt=new d;function Nme(e,t,n){let i=d.subtract(n,t,Ont),o=d.subtract(e,t,Fnt),r=d.dot(i,o);if(r<=0)return t;let a=d.dot(i,i);return r>=a?n:(r=r/a,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var Qnt=new cn(d.UNIT_X,0);function sX(e,t,n,i){let o=Number.MAX_VALUE,r,a,s;for(let c=0;c<t.length;c++){let u=cn.fromPointNormal(t[c],i[c],Qnt);cn.getPointDistance(u,e)<0||(s=Nme(e,t[c],t[(c+1)%4]),r=d.distance(e,s),r<o&&(o=r,a=s))}return l(a)?a:e}JD.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Xt.INSIDE:n===this._vertices.length?Xt.OUTSIDE:Xt.INTERSECTING};JD.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new Bh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Bh.createGeometry(n),o=new Lt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),r=new Bh({polygonHierarchy:{positions:this._planeVertices[1]}}),a=Bh.createGeometry(r),s=new Lt({geometry:a,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Bh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Bh.createGeometry(f);c[u]=new Lt({geometry:h,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new Ln({geometryInstances:[c[0],c[1],c[2],c[3],s,o],appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var aU=JD;var knt=new d(1,1,1),sU=Math.cos,cU=Math.sin;function Vx(e){e=e??V.EMPTY_OBJECT;let t=e.radii??knt,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,a=e.maximumCone??D.PI,s=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}Vx.packedLength=2*d.packedLength+8;Vx.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var Lme=new d,Ome=new d,VA={radii:Lme,innerRadii:Ome,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};Vx.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Lme);t+=d.packedLength;let o=d.unpack(e,t,Ome);t+=d.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=a,n._minimumCone=s,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):(VA.minimumClock=r,VA.maximumClock=a,VA.minimumCone=s,VA.maximumCone=c,VA.stackPartitions=u,VA.slicePartitions=f,VA.subdivisions=h,VA.offsetAttribute=p===-1?void 0:p,new Vx(VA))};Vx.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,a=e._maximumCone,s=e._subdivisions,c=te.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/D.TWO_PI),f=Math.round(f*Math.abs(a-r)/D.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,A=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,_=!1;A&&(p=2,r>0&&(m=!0,h+=u),a<Math.PI&&(_=!0,h+=u));let y=s*p*(f+u),C=new Float64Array(y*3),E=2*(y+h-(u+f)*p),I=Ue.createTypedArray(y,E),x,S,w,v,R=0,N=new Array(f),L=new Array(f);for(x=0;x<f;x++)v=r+x*(a-r)/(f-1),N[x]=cU(v),L[x]=sU(v);let g=new Array(s),b=new Array(s);for(x=0;x<s;x++)w=i+x*(o-i)/(s-1),g[x]=cU(w),b[x]=sU(w);for(x=0;x<f;x++)for(S=0;S<s;S++)C[R++]=t.x*N[x]*b[S],C[R++]=t.y*N[x]*g[S],C[R++]=t.z*L[x];if(A)for(x=0;x<f;x++)for(S=0;S<s;S++)C[R++]=n.x*N[x]*b[S],C[R++]=n.y*N[x]*g[S],C[R++]=n.z*L[x];for(N.length=s,L.length=s,x=0;x<s;x++)v=r+x*(a-r)/(s-1),N[x]=cU(v),L[x]=sU(v);for(g.length=u,b.length=u,x=0;x<u;x++)w=i+x*(o-i)/(u-1),g[x]=cU(w),b[x]=sU(w);for(x=0;x<s;x++)for(S=0;S<u;S++)C[R++]=t.x*N[x]*b[S],C[R++]=t.y*N[x]*g[S],C[R++]=t.z*L[x];if(A)for(x=0;x<s;x++)for(S=0;S<u;S++)C[R++]=n.x*N[x]*b[S],C[R++]=n.y*N[x]*g[S],C[R++]=n.z*L[x];for(R=0,x=0;x<f*p;x++){let M=x*s;for(S=0;S<s-1;S++)I[R++]=M+S,I[R++]=M+S+1}let T=f*s*p;for(x=0;x<u;x++)for(S=0;S<s-1;S++)I[R++]=T+x+S*u,I[R++]=T+x+(S+1)*u;if(A)for(T=f*s*p+u*s,x=0;x<u;x++)for(S=0;S<s-1;S++)I[R++]=T+x+S*u,I[R++]=T+x+(S+1)*u;if(A){let M=f*s*p,O=M+s*u;if(m)for(x=0;x<u;x++)I[R++]=M+x,I[R++]=O+x;if(_)for(M+=s*u-u,O+=s*u-u,x=0;x<u;x++)I[R++]=M+x,I[R++]=O+x}let B=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:C})});if(l(e._offsetAttribute)){let M=C.length,O=e._offsetAttribute===mn.NONE?0:1,G=new Uint8Array(M/3).fill(O);B.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:G})}return new yt({attributes:B,indices:I,primitiveType:Pe.LINES,boundingSphere:le.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Cd=Vx;function Hx(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Cd(i),this._workerName="createSphereOutlineGeometry"}Hx.packedLength=Cd.packedLength;Hx.pack=function(e,t,n){return Cd.pack(e._ellipsoidGeometry,t,n)};var Unt=new Cd,ZE={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};Hx.unpack=function(e,t,n){let i=Cd.unpack(e,t,Unt);return ZE.stackPartitions=i._stackPartitions,ZE.slicePartitions=i._slicePartitions,ZE.subdivisions=i._subdivisions,l(n)?(d.clone(i._radii,ZE.radii),n._ellipsoidGeometry=new Cd(ZE),n):(ZE.radius=i._radii.x,new Hx(ZE))};Hx.createGeometry=function(e){return Cd.createGeometry(e._ellipsoidGeometry)};var fy=Hx;function Wx(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(Wx.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}}});Wx.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};Wx.prototype.intersectPlane=function(e){return le.intersectPlane(this._boundingSphere,e)};Wx.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};Wx.prototype.createDebugVolume=function(e){let t=new fy({radius:this.radius}),n=P.fromTranslation(this.center,P.clone(P.IDENTITY)),i=new Lt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Ln({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var dy=Wx;var znt=new d,Gnt=new d,Vnt=new d,Hnt=new d;function $E(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,D.EPSILON7/i,n)}function cX(e,t){let n=d.normalize(e,Hnt),i=d.equalsEpsilon(n,d.UNIT_X,D.EPSILON6)?d.UNIT_Y:d.UNIT_X;return $E(e,i,t)}function Fme(e){let t=J.getColumn(e,0,znt),n=J.getColumn(e,1,Gnt),i=J.getColumn(e,2,Vnt),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),a=d.equals(i,d.ZERO);return!o&&!r&&!a?e:o&&r&&a?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(o&&!r&&!a?t=$E(n,i,t):!o&&r&&!a?n=$E(t,i,n):!o&&!r&&a?i=$E(n,t,i):o?r?a||(t=cX(i,t),n=$E(i,t,n)):(t=cX(n,t),i=$E(n,t,i)):(n=cX(t,n),i=$E(n,t,i)),J.setColumn(e,0,t,e),J.setColumn(e,1,n,e),J.setColumn(e,2,i,e),e)}function jx(e,t){t=Fme(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(jx.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});jx.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};jx.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};jx.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=Fme(t),J.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};jx.prototype.createDebugVolume=function(e){let t=new Sm({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=P.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Lt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Ln({geometryInstances:i,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})};var of=jx;function xr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||Si(n,"3DTILES_multiple_contents"),a=o&&!r?n.contents[0]:n.content;this._contentHeader=a,this.transform=l(n.transform)?P.unpack(n.transform):P.clone(P.IDENTITY);let s=l(i)?i.computedTransform:e.modelMatrix,c=P.multiply(s,this.transform,new P),u=l(i)?i._initialTransform:P.IDENTITY;this._initialTransform=P.multiply(u,this.transform,new P),this.computedTransform=c,this.metadata=tU(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(a)&&l(a.boundingVolume)&&(f=this.createBoundingVolume(a.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;l(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,xr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&xr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Cr.REPLACE:Cr.ADD):l(i)?p=i.refine:p=Cr.REPLACE,this.refine=p,this.children=[],this.parent=i;let A,m=!1,_,y,C;if(t=De.createIfNeeded(t),r)_=br.UNLOADED,y=t.clone();else if(l(a)){let S=a.uri;l(a.url)&&(xr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),S=a.url),S===""?(xr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),A=new qD(e,this),m=!0,_=br.READY):(_=br.UNLOADED,y=t.getDerivedResource({url:S}),C=sl.getServerKey(y.getUrlComponent()))}else A=new qD(e,this),m=!0,_=br.READY;this._content=A,this._contentResource=y,this._contentState=_,this._expiredContent=void 0,this._serverKey=C,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let E=n.expire,I,x;l(E)&&(I=E.duration,l(E.date)&&(x=X.fromIso8601(E.date))),this.expireDuration=I,this.expireDate=x,this.lastStyleTime=0,this._optimChildrenWithinParent=wh.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=U.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 X,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}xr._deprecationWarning=Gs;Object.defineProperties(xr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new U),U.clone(this._color)},set:function(e){this._color=U.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===br.READY}},contentUnloaded:{get:function(){return this._contentState===br.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===br.EXPIRED}},contentFailed:{get:function(){return this._contentState===br.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var hy=new d;function Wnt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:a}=t,s=d.multiplyByScalar(a.directionWC,e._centerZDepth,hy),c=d.add(a.positionWC,s,hy),u=d.subtract(c,r,hy);if(d.magnitude(u)>o){let x=d.normalize(u,hy),S=d.multiplyByScalar(x,o,hy),w=d.add(r,S,hy),v=d.subtract(w,a.positionWC,hy),R=d.normalize(v,hy);e._foveatedFactor=1-Math.abs(d.dot(a.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Cr.REPLACE,A=n.isSkippingLevelOfDetail;if(p&&!A||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&A||n._pass===ur.PRELOAD_FLIGHT||n._pass===ur.PRELOAD)return!1;let m=1-Math.cos(a.frustum.fov*.5),_=n.foveatedConeSize*m;if(e._foveatedFactor<=_)return!1;let y=m-_,C=D.clamp((e._foveatedFactor-_)/y,0,1),E=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,C),I=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-E<=I}var Gme=new X;xr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,a=t?r:this.geometricError;if(a===0)return 0;let{camera:s,context:c}=e,u=s.frustum,f=c.drawingBufferWidth,h=c.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof An){let A=u.offCenterFrustum;l(A)&&(u=A);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=a/m}else{let A=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=a*h/(A*m),i.dynamicScreenSpaceError){let _=i._dynamicScreenSpaceErrorComputedDensity,y=i.dynamicScreenSpaceErrorFactor,C=D.fog(A,_)*y;p-=C}}return p/=e.pixelRatio,p};function jnt(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,a=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&a&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Ynt(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}xr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:ns.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!==ns.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Ynt(n,this),this._priorityProgressiveResolution=jnt(n,this),this.priorityDeferred=Wnt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};xr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=X.now(Gme);X.lessThan(this.expireDate,e)&&(this._contentState=br.EXPIRED,this._expiredContent=this._content)}};function qnt(e){if(!l(e.expireDuration))return;let t=X.now(Gme);X.addSeconds(t,e.expireDuration,t),l(e.expireDate)?X.lessThan(e.expireDate,t)&&X.clone(t,e.expireDate):e.expireDate=X.clone(t)}function Knt(e){return function(){return e._priority}}xr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Xnt(this):Znt(this)};function Xnt(e){let t=e._content,n=e._tileset;if(!l(t)){let o=Si(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new nU(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=br.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=br.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=br.FAILED,o})}async function Jnt(e,t,n,i,o){let r=e._contentState;e._contentState=br.LOADING,++t.statistics.numberOfPendingRequests;let a;try{a=await o}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===yi.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=br.FAILED,s}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===yi.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let s=await $nt(e,a);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=s,e._contentState=br.PROCESSING,s)}catch(s){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=br.FAILED,s}}function Znt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Br({throttle:!0,throttleByServer:!0,type:es.TILES3D,priorityFunction:Knt(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return Jnt(e,o,i,n,r)}async function $nt(e,t){let n=cy(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Bs.GEOMETRY||n.contentType===Bs.VECTOR,(n.contentType===Bs.IMPLICIT_SUBTREE||n.contentType===Bs.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Bs.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=Nx[n.contentType];if(e.isDestroyed())return;l(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let c=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=c.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=Lx(i,a));let s=Ox(i,a);return l(s)&&(o.group=new Tb({metadata:s})),o}xr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};xr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=br.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 Vme=new le;function uX(e,t){if(t.mode!==oe.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Vme);e._boundingVolume2D=new dy(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function eit(e,t){if(t.mode!==oe.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Vme);e._contentBoundingVolume2D=new dy(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}xr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=uX(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=s!==Xt.INSIDE,s===Xt.OUTSIDE)return ns.MASK_OUTSIDE}let a=o.clippingPolygons;if(l(a)&&a.enabled){let s=a.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=s!==Xt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};xr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return Xt.INSIDE;if(this._visibilityPlaneMask===ns.MASK_INSIDE)return Xt.INSIDE;let t=e.cullingVolume,n=eit(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=a!==Xt.INSIDE,a===Xt.OUTSIDE)return Xt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=a!==Xt.OUTSIDE,a===Xt.INSIDE)return Xt.OUTSIDE}return t.computeVisibility(n)};xr.prototype.distanceToTile=function(e){return uX(this,e).distanceToCamera(e)};var tit=new d;xr.prototype.distanceToTileCenter=function(e){let n=uX(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,tit);return d.dot(e.camera.directionWC,i)};xr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var Hme=new J,Wme=new d,nit=new J,fX=new d,jme=new ce,Yme=new en,lX=new P;function iit(e,t,n){let i=d.fromElements(e[0],e[1],e[2],fX),o=J.fromArray(e,3,nit);i=P.multiplyByPoint(t,i,i);let r=P.getMatrix3(t,Hme);return o=J.multiply(r,o,o),l(n)?(n.update(i,o),n):new of(i,o)}function Qme(e,t,n,i){let o=ce.unpack(e,0,jme),r=e[4],a=e[5],s=en.fromRectangle(o,r,a,te.WGS84,Yme),c=s.center,u=s.halfAxes;t=P.multiplyTransformation(t,P.inverseTransformation(n,lX),lX),c=P.multiplyByPoint(t,c,c);let f=P.getMatrix3(t,Hme);return u=J.multiply(f,u,u),l(i)&&i instanceof of?(i.update(c,u),i):new of(c,u)}function oit(e,t,n,i){if(!P.equalsEpsilon(t,n,D.EPSILON8))return i instanceof of?Qme(e,t,n,i):Qme(e,t,n,void 0);let o=ce.unpack(e,0,jme);return i instanceof yd?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(te.WGS84),i):new yd({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function rit(e,t,n){let i=d.fromElements(e[0],e[1],e[2],fX),o=e[3];i=P.multiplyByPoint(t,i,i);let r=P.getScale(t,Wme),a=d.maximumComponent(r);return o*=a,l(n)?(n.update(i,o),n):new dy(i,o)}xr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=mE.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ue("boundingVolume must be defined");if(Si(e,"3DTILES_bounding_volume_S2"))return new aU(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:a,sphere:s}=e;if(l(r)){let c=iit(r,t,n);return this._verticalExaggeration!==1&&kme(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(a)){let c=oit(a,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof of?kme(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=To.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=To.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(te.WGS84))),c}if(l(s)){let c=rit(s,t,n);if(this._verticalExaggeration!==1){let u=To.getPosition(c.center,te.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,fX),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new ue("boundingVolume must contain a sphere, region, or box")};var ait=d.unpackArray(new Array(24).fill(0));function kme(e,t,n){let i=e.boundingVolume.computeCorners(ait).map(r=>To.getPosition(r,te.WGS84,t,n,r)),o=en.fromPoints(i,Yme);e.update(o.center,o.halfAxes)}xr.prototype.updateTransform=function(e,t){e=e??P.IDENTITY;let n=P.multiplyTransformation(e,this.transform,lX),i=!P.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&P.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};xr.prototype.updateGeometricErrorScale=function(){let e=P.getScale(this.computedTransform,Wme),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function sit(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=U.WHITE:c=U.DARKGRAY:c=U.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(U.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(U.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let a=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),s=!t.debugColorizeTiles&&e._debugColorizeTiles;a?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):s&&(e._debugColorizeTiles=!1,e.color=U.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),s&&t.makeStyleDirty()}function cit(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=br.FAILED,o}}function lit(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function uit(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}xr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;lit(this,e),uit(this,e),sit(this,e,t,n),cit(this,e,t);let r=i.length;this._commandsLength=r-o;for(let a=o;a<r;++a){let s=i[a],c=s.pass===Be.TRANSLUCENT;s.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var Ume=[];xr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(qnt(this),this._selectedFrame=0,this.lastStyleTime=0,X.now(this._loadTimestamp),this._contentState=br.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=Ume;try{this._content.update(e,t)}catch(i){throw this._contentState=br.FAILED,i}Ume.length=0,t.commandList=n};function zme(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function lU(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}xr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,a=0,s=o,c=a+s,u=o,f=c+u,h=r,p=Math.pow(10,f),A=f+h,m=r,_=Math.pow(10,A),y=A+m,C=Math.pow(10,y),E=lU(this._depth,n.depth,i.depth);E=t?1-E:E;let x=!e.isSkippingLevelOfDetail&&this.refine===Cr.REPLACE?lU(this._priorityHolder._distanceToCamera,n.distance,i.distance):lU(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),S=zme(x,s,a),w=this._priorityProgressiveResolution?0:p,v=lU(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=zme(v,u,c),N=this.priorityDeferred?_:0,L=e._pass===ur.PRELOAD_FLIGHT?0:C;this._priority=E+S+w+R+N+L};xr.prototype.isDestroyed=function(){return!1};xr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),fe(this)};var Dh=xr;function HA(e){e=e??V.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(HA.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}}});HA.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,this._class)};HA.prototype.hasPropertyBySemantic=function(e){return Kn.hasPropertyBySemantic(e,this._properties,this._class)};HA.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,this._class,e)};HA.prototype.getProperty=function(e){return Kn.getProperty(e,this._properties,this._class)};HA.prototype.setProperty=function(e,t){return Kn.setProperty(e,t,this._properties,this._class)};HA.prototype.getPropertyBySemantic=function(e){return Kn.getPropertyBySemantic(e,this._properties,this._class)};HA.prototype.setPropertyBySemantic=function(e,t){return Kn.setPropertyBySemantic(e,t,this._properties,this._class)};var ZD=HA;function WA(e){e=e??V.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(WA.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});WA.prototype.hasProperty=function(e){return Kn.hasProperty(e,this._properties,this._class)};WA.prototype.hasPropertyBySemantic=function(e){return Kn.hasPropertyBySemantic(e,this._properties,this._class)};WA.prototype.getPropertyIds=function(e){return Kn.getPropertyIds(this._properties,this._class,e)};WA.prototype.getProperty=function(e){return Kn.getProperty(e,this._properties,this._class)};WA.prototype.setProperty=function(e,t){return Kn.setProperty(e,t,this._properties,this._class)};WA.prototype.getPropertyBySemantic=function(e){return Kn.getPropertyBySemantic(e,this._properties,this._class)};WA.prototype.setPropertyBySemantic=function(e,t){return Kn.setPropertyBySemantic(e,t,this._properties,this._class)};var uU=WA;function qme(e){e=e??V.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new uU({tileset:i,class:n.classes[i.class]}));let r=[],a=[],s=t.groups;if(Array.isArray(s)){let c=s.length;for(let u=0;u<c;u++){let f=s[u];a.push(new ZD({group:f,class:n.classes[f.class]}))}}else if(l(s)){r=Object.keys(s).sort();let c=r.length;for(let u=0;u<c;u++){let f=r[u];if(s.hasOwnProperty(f)){let h=s[f];a.push(new ZD({id:f,group:s[f],class:n.classes[h.class]}))}}}this._schema=n,this._groups=a,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(qme.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 Yx=qme;var Kme={},fit=new d;Kme.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof of||i instanceof yd){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=wh.USE_OPTIMIZATION;for(let r=0;r<n;++r){let s=t[r].boundingVolume;if(!(s instanceof of||s instanceof yd)){e._optimChildrenWithinParent=wh.SKIP_OPTIMIZATION;break}let c=s._orientedBoundingBox,u=d.subtract(c.center,o.center,fit),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=wh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===wh.USE_OPTIMIZATION};var fU=Kme;function $D(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties($D.prototype,{length:{get:function(){return this._length}}});function dit(e,t,n){this.item=e,this.previous=t,this.next=n}$D.prototype.add=function(e){let t=new dit(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function Xme(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}$D.prototype.remove=function(e){l(e)&&(Xme(this,e),--this._length)};$D.prototype.splice=function(e,t){if(e===t)return;Xme(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 dU=$D;function e0(){this._list=new dU,this._sentinel=this._list.add(),this._trimTiles=!1}e0.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};e0.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};e0.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};e0.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};e0.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let a=r.item;r=r.next,this.unloadTile(e,a,t)}};e0.prototype.trim=function(){this._trimTiles=!0};var hU=e0;function mU(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 hX(e,t){let n;return t==="_loadTimestamp"?n=X.toDate(e).getTime():n=e,n}mU.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=hX(e,n),this._referenceMaximum[n]=hX(t,n)};function hit(e,t){let n=e.tilePropertyName;if(l(n)){let i=hX(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var dX=[new U(.1,.1,.1,1),new U(.153,.278,.878,1),new U(.827,.231,.49,1),new U(.827,.188,.22,1),new U(1,.592,.259,1),new U(1,.843,0,1)];mU.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=hit(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let a=r-o+D.EPSILON7,c=D.clamp(i-o,0,a)/a,u=dX.length-1,f=c*u,h=Math.floor(f),p=Math.ceil(f),A=f-h,m=dX[h],_=dX[p],y=U.clone(U.WHITE);y.red=D.lerp(m.red,_.red,A),y.green=D.lerp(m.green,_.green,A),y.blue=D.lerp(m.blue,_.blue,A),e._debugColor=y};mU.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var pU=mU;function qx(){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}qx.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};qx.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};qx.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof sd))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};qx.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof sd))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};qx.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 lp=qx;function ev(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(ev.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});ev.prototype.makeDirty=function(){this._styleDirty=!0};ev.prototype.resetDirty=function(){this._styleDirty=!1};ev.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let a=0;a<r;++a){let s=o[a];if(s.lastStyleTime!==n){let c=s.content;s.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var AU=ev;function mit(e,t,n){let i=Si(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!Si(o,"3DTILES_bounding_volume_S2")&&!Si(o,"3DTILES_bounding_volume_cylinder"))throw new ue("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=pit(t);for(let a=0;a<r.length;a++){let s=r[a];this.contentHeaders.push(Ye(s,!0));let c=new De({url:s.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Ait(t),this.subdivisionScheme=ka[i.subdivisionScheme],this.branchingFactor=ka.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function pit(e){if(Si(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Ait(e){let t=Ye(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var jA=mit;var tv={};function Jme(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function mX(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Zme(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 pX(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}tv.encode2D=function(e,t){return(Jme(e)|Jme(t)<<1)>>>0};tv.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Zme(e),t[1]=Zme(e>>1),t};tv.encode3D=function(e,t,n){return mX(e)|mX(t)<<1|mX(n)<<2};tv.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=pX(e),t[1]=pX(e>>1),t[2]=pX(e>>2),t};var t0=tv;function fr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===ka.OCTREE&&(this.z=e.z)}Object.defineProperties(fr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===ka.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===ka.OCTREE?t0.encode3D(this.x,this.y,this.z):t0.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===ka.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});fr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===ka.OCTREE){let o=(this.z<<e.level)+e.z;return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};fr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===ka.OCTREE){let r=Math.floor(this.z/t);return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};fr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===ka.OCTREE){let r=e.z%n;return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};fr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===ka.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new fr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};fr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};fr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};fr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===ka.OCTREE){let a=e.z>>t,s=this.z===a;return o&&r&&s}return o&&r};fr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===ka.OCTREE?this.z===e.z:!0)};fr.prototype.isImplicitTilesetRoot=function(){return this.level===0};fr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};fr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};fr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===ka.OCTREE&&(e.z=this.z),e};var $me=[0,0,0];fr.fromMortonIndex=function(e,t,n,i){let o;return e===ka.OCTREE?(o=t0.decode3D(i,$me),new fr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=t0.decode2D(i,$me),new fr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};fr.fromTileIndex=function(e,t,n){let i,o,r;return e===ka.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(D.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),fr.fromMortonIndex(e,t,i,r)};var YA=fr;function qA(){}qA.selectTiles=function(e,t){de.throwInstantiationError()};qA.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};qA.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};qA.selectTile=function(e,t){if(e.contentVisibility(t)===Xt.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)};qA.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};qA.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};qA.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!git(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function git(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,a=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/a<1}qA.updateTile=function(e,t){epe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Cit(e),e._shouldSelect=!1,e._finalResolution=!0};function epe(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];epe(r,t),e._visible=r._visible;return}if(_it(e,t)){e._visible=!1;return}let i=e.refine===Cr.REPLACE,o=e._optimChildrenWithinParent===wh.USE_OPTIMIZATION;if(i&&o&&n&&!yit(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function _it(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Cr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function yit(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 Cit(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=qA;function tpe(){}var nv={stack:new iu,stackMaximumLength:0};tpe.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,a=nv.stack;for(a.push(i);a.length>0;){nv.stackMaximumLength=Math.max(nv.stackMaximumLength,a.length);let s=a.pop(),c=s.refine===Cr.ADD,u=s.refine===Cr.REPLACE,f=Eit(s);f&&Iit(s,a,t),(c||u&&!f)&&(bit(e,s),o(s,t),xit(s,t),s.hasRenderableContent&&!s.contentAvailable&&(n=!1)),r(s,t)}return nv.stack.trim(nv.stackMaximumLength),n};function Eit(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function Iit(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 bit(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function xit(e,t){e.contentAvailable&&e.contentVisibility(t)!==Xt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var gU=tpe;function npe(){}var iv={stack:new iu,stackMaximumLength:0},ov={stack:new iu,stackMaximumLength:0};npe.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;Sit(n,t),iv.stack.trim(iv.stackMaximumLength),ov.stack.trim(ov.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function AX(e,t){e.contentAvailable&&Zs.selectTile(e,t)}function Tit(e,t,n){let i=e.refine===Cr.REPLACE,{tileset:o,children:r}=e,{updateTile:a,loadTile:s,touchTile:c}=Zs;for(let m=0;m<r.length;++m)a(r[m],n);r.sort(Zs.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,A=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let _=r[m];if(_.isVisible?(t.push(_),_._foveatedFactor<A&&(p=m,A=_._foveatedFactor),h=!0):(u||o.loadSiblings)&&(_._foveatedFactor<A&&(p=m,A=_._foveatedFactor),s(_,n),c(_,n)),u){let y;_._inRequestVolume?_.hasRenderableContent?y=_.contentAvailable:y=wit(_,n):y=!1,f=f&&y}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let _=(e._wasMinPriorityChild||e===o.root)&&A<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;_._foveatedFactor=Math.min(m._foveatedFactor,_._foveatedFactor),_._distanceToCamera=Math.min(m._distanceToCamera,_._distanceToCamera);for(let y=0;y<r.length;++y)r[y]._priorityHolder=_}return f}function Sit(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:a}=Zs,s=iv.stack;for(s.push(e);s.length>0;){iv.stackMaximumLength=Math.max(iv.stackMaximumLength,s.length);let c=s.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Tit(c,s,t)&&f:!1;let h=!c._refines&&f;c.hasRenderableContent?c.refine===Cr.ADD?(AX(c,t),o(c,t)):c.refine===Cr.REPLACE&&(o(c,t),h&&AX(c,t)):(n._emptyTiles.push(c),o(c,t),h&&AX(c,t)),r(c,t),a(c,t)}}function wit(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Zs,a=!0,s=ov.stack;for(s.push(e);s.length>0;){ov.stackMaximumLength=Math.max(ov.stackMaximumLength,s.length);let c=s.pop(),u=c.children,f=u.length,h=!c.hasRenderableContent&&n(c);if(!h&&!c.contentAvailable&&(a=!1),i(c,t),c.isVisible||(o(c,t),r(c,t)),h)for(let p=0;p<f;++p){let A=u[p];s.push(A)}}return e.hasEmptyContent||a}var _U=npe;function ipe(){}var rv={stack:new iu,stackMaximumLength:0},av={stack:new iu,stackMaximumLength:0},KA={stack:new iu,stackMaximumLength:0,ancestorStack:new iu,ancestorStackMaximumLength:0},Bit=2;ipe.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;Nit(n,t),Lit(n,t),rv.stack.trim(rv.stackMaximumLength),av.stack.trim(av.stackMaximumLength),KA.stack.trim(KA.stackMaximumLength),KA.ancestorStack.trim(KA.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Dit(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Zs,r=av.stack;for(r.push(e);r.length>0;){av.stackMaximumLength=Math.max(av.stackMaximumLength,r.length);let s=r.pop().children;for(let c=0;c<s.length;++c){let u=s[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<Bit&&r.push(u))}}}function yU(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Dit(e,t)}function vit(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function Pit(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Rit(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:a,touchTile:s}=Zs;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(Zs.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(a(f,n),s(f,n))}return c}function Mit(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function Nit(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:a,touchTile:s}=Zs,c=rv.stack;for(c.push(e);c.length>0;){rv.stackMaximumLength=Math.max(rv.stackMaximumLength,c.length);let u=c.pop();vit(u,t);let f=u.parent,h=!l(f)||f._refines;u._refines=o(u)?Rit(u,c,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===Cr.ADD?(yU(u,t),r(u,t)):u.refine===Cr.REPLACE&&(Mit(u,i)?(r(u,t),p&&yU(u,t)):p?(yU(u,t),r(u,t)):Pit(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&yU(u,t)),a(u,t),s(u,t)}}function Lit(e,t){let{selectTile:n,canTraverse:i}=Zs,{stack:o,ancestorStack:r}=KA,a;for(o.push(e);o.length>0||r.length>0;){if(KA.stackMaximumLength=Math.max(KA.stackMaximumLength,o.length),KA.ancestorStackMaximumLength=Math.max(KA.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==a&&(u._finalResolution=!1),n(u,t);continue}}let s=o.pop();if(!l(s))continue;let c=i(s);if(s._shouldSelect)if(s.refine===Cr.ADD)n(s,t);else{if(s._selectionDepth=r.length,s._selectionDepth>0&&(s.tileset.hasMixedContent=!0),a=s,!c){n(s,t);continue}r.push(s),s._stackLength=o.length}if(c){let u=s.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var CU=ipe;function Ha(){this._layers=[],this.layerAdded=new _e,this.layerRemoved=new _e,this.layerMoved=new _e,this.layerShownOrHidden=new _e}Object.defineProperties(Ha.prototype,{length:{get:function(){return this._layers.length}}});Ha.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ha.prototype.addImageryProvider=function(e,t){let n=new Ta(e);return this.add(n,t),n};Ha.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};Ha.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=[]};Ha.prototype.contains=function(e){return this.indexOf(e)!==-1};Ha.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ha.prototype.get=function(e){return this._layers[e]};function EU(e,t){return e.indexOf(t)}function ope(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ha.prototype.raise=function(e){let t=EU(this._layers,e);ope(this,t,t+1)};Ha.prototype.lower=function(e){let t=EU(this._layers,e);ope(this,t,t-1)};Ha.prototype.raiseToTop=function(e){let t=EU(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))};Ha.prototype.lowerToBottom=function(e){let t=EU(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 Oit=new ce;function gX(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let s=0;!l(r)&&s<o.length;++s){let c=o[s];ce.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let a=r.data.imagery;for(let s=a.length-1;s>=0;--s){let c=a[s],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=Oit,p=1/1024;h.west=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),h.east=D.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),h.south=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),h.north=D.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(u)}}Ha.pickImageryHelper=gX;Ha.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(gX(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ha.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(gX(t,i,!0,function(a){if(!a.imageryLayer.ready)return;let s=a.imageryLayer.imageryProvider;for(let u=0;u<r.length;u++)if(r[u]===a.imageryLayer)return;let c=s.pickFeatures(a.x,a.y,a.level,i.longitude,i.latitude);l(c)&&(o.push(c),r.push(a.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(a){let s=[];for(let c=0;c<a.length;++c){let u=a[c],f=r[c];if(l(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,l(p.position)||(p.position=i),s.push(p)}}return s})};Ha.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ha.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ha.prototype.isDestroyed=function(){return!1};Ha.prototype.destroy=function(){return this.removeAll(!0),fe(this)};Ha.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var Kx=Ha;function ir(e){e=e??V.EMPTY_OBJECT,this._marsOptions=e.marsOptions??{},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 hU,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 iu,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new AU,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?P.clone(e.modelMatrix):P.clone(P.IDENTITY),this._addHeightCallbacks=[],this._statistics=new lp,this._statisticsLast=new lp,this._statisticsPerPass=new Array(ur.NUMBER_OF_PASSES);for(let o=0;o<ur.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new lp;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 pU(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??te.WGS84,this._initialClippingPlanesOriginMatrix=P.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new Kx(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Bn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Yu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new TA(e.pointCloudShading),this._pointCloudEyeDomeLighting=new O_,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e,this.tileLoad=new _e,this.tileUnload=new _e,this.tileFailed=new _e,this.tileVisible=new _e,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Ca.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,l(e.clippingPolygons)&&jm.setOwner(e.clippingPolygons,this,"_clippingPolygons"),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new xb,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new R_(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??U.BLACK,this.splitDirection=e.splitDirection??Qr.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&&bt("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,this._initForMars3D&&this._initForMars3D(e)}Object.defineProperties(ir.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ca.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){jm.setOwner(e,this,"_clippingPolygons")}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Gs("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(P.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):P.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,dpe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});ir.fromIonAssetId=async function(e,t){let n=await _a.fromAssetId(e);return ir.fromUrl(n,t)};ir.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ir.loadJson(n),r=await Fit(n,o),a=new ir(t);a._resource=n,a._url=n.url,a._basePath=i,a._metadataExtension=r,a._geometricError=o.geometricError,a._scaledGeometricError=o.geometricError;let s=o.asset;a._asset=s,a._extras=o.extras,dpe(a);let c=l(o.asset.gltfUpAxis)?so.fromName(o.asset.gltfUpAxis):so.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??so.X;a._properties=o.properties,a._extensionsUsed=o.extensionsUsed,a._extensions=o.extensions,a._modelUpAxis=u,a._modelForwardAxis=f,a._root=a.loadTileset(n,o);let p=a._root.createBoundingVolume(o.root.boundingVolume,P.IDENTITY).boundingSphere.center,A=a._ellipsoid.cartesianToCartographic(p);return l(A)&&A.height>vi._defaultMinTerrainHeight&&(a._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),a._clippingPlanesOriginMatrix=P.clone(a._initialClippingPlanesOriginMatrix),a};ir.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};ir.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ir.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ue("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ue("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ir.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let a=rpe(this,e,t.root,n);l(n)&&(n.children.push(a),a._depth=n._depth+1);let s=[];for(s.push(a);s.length>0;){let c=s.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Cr.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let h=u[f],p=rpe(this,e,h,c);c.children.push(p),p._depth=c._depth+1,s.push(p)}this._cullWithChildrenBounds&&fU.checkChildrenWithinParent(c)}return a};function rpe(e,t,n,i){if(!(l(n.implicitTiling)||Si(n,"3DTILES_implicit_tiling")))return new Dh(e,t,n,i);let r=e.schema,a=new jA(t,n,r),s=new YA({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:0,x:0,y:0,z:0}),c=a.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()}).url,f=Ye(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let h=new Dh(e,t,f,i);return h.implicitTileset=a,h.implicitCoordinates=s,h}async function Fit(e,t){let n=Si(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Pi.getSchemaLoader({resource:e});else if(l(n.schema))i=Pi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new Yx({schema:i.schema,metadataJson:n});return Pi.unload(i),o}var ape=new d,Qit=new me,kit=new P,Uit=new d,zit=new d,Git=new d,Vit=new d;function Hit(e,t){let n,i,o,r,a,s=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof yd)n=d.normalize(s.positionWC,ape),i=s.directionWC,o=s.positionCartographic.height,r=u.minimumHeight,a=u.maximumHeight;else{let _=P.inverseTransformation(c.computedTransform,kit),y=t.mapProjection.ellipsoid,C=u.boundingVolume,E=P.multiplyByPoint(_,C.center,Uit);if(d.magnitude(E)>y.minimumRadius){let I=me.fromCartesian(E,y,Qit);n=d.normalize(s.positionWC,ape),i=s.directionWC,o=s.positionCartographic.height,r=0,a=I.height*2}else{let I=P.multiplyByPoint(_,s.positionWC,zit);if(n=d.UNIT_Z,i=P.multiplyByPointAsVector(_,s.directionWC,Git),i=d.normalize(i,i),o=I.z,u instanceof of){let x=J.getColumn(C.halfAxes,2,Vit),S=d.magnitude(x);r=E.z-S,a=E.z+S}else if(u instanceof dy){let x=C.radius;r=E.z-x,a=E.z+x}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(a-r)*f,p=a,A=D.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-A),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function Wit(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{lpe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?rot(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function cpe(e,t){return e._priority-t._priority}ir.prototype.postPassesUpdate=function(e){l(this._root)&&(jit(this,e),sot(this,e),this._cache.unloadTiles(this,fpe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};ir.prototype.prePassesUpdate=function(e){if(!l(this._root))return;$it(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),l(this._loadTimestamp)||(this._loadTimestamp=X.clone(e.time)),this._timeSinceLoad=Math.max(X.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Hit(this,e),e.newFrame&&this._cache.reset()};function jit(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],a=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==br.LOADING){++i;continue}else if(a){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function Yit(e){let t=e._requestedTiles;t.sort(cpe);for(let n=0;n<t.length;++n)Wit(e,t[n])}function lpe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function qit(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==br.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var Kit=new me,Xit=new me,Jit=new d;function Zit(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 a=r.ellipsoid,s=me.clone(r.positionCartographic,Kit),c=me.fromCartesian(o.center,a,Xit);l(c)&&(s.height=c.height);let u=me.toCartesian(s,a,Jit);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{l(r.callback)&&r.callback(),r.invoked=!1}))}}function $it(e,t){qit(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,a=i+o,s=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>a){s=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,lpe(f,e,u)}}e.totalMemoryUsageInBytes<i?tot(e):s&&n.length>0&&eot(e)}function eot(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(cpe)}function tot(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var IU=new d,not={maximumFractionDigits:3};function spe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,not):Math.round(t).toLocaleString()}function _X(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,IU);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=d.normalize(i,IU);r=d.multiplyByScalar(r,.75*n,IU),o=d.add(r,i,IU)}return o}function yX(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: ${spe(e.content.texturesByteLength)}`,i+=`
|
|
Geometry Memory: ${spe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
|
|
Urls:`;let a=e.content.innerContentUrls;for(let s=0;s<a.length;s++)i+=`
|
|
- ${a[s]}`;o+=a.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 iot(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let a=l(e.debugPickPosition)?e.debugPickPosition:_X(e.debugPickedTile),s=yX(e.debugPickedTile,e,a);s.pixelOffset=new Q(15,-15)}}else{for(let a=0;a<i;++a){let s=n[a];yX(s,e,_X(s))}for(let a=0;a<r;++a){let s=o[a];(s.hasTilesetContent||s.hasImplicitContent)&&yX(s,e,_X(s))}}e._tileDebugLabels.update(t)}function oot(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,a=e._selectedTiles,s=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&a.length>0;e._backfaceCommands.length=0,s&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ui({stencil:0,pass:Be.CESIUM_3D_TILE,renderState:Ve.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<a.length;++m){let _=a[m];f&&u.raiseEvent(_),Zit(e,_,t),_.update(e,t,n),c.incrementSelectionCounts(_.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let A=i.length-h;if(e._backfaceCommands.trim(),s){let m=e._backfaceCommands.values,_=m.length;i.length+=_;for(let y=A-1;y>=0;--y)i[h+_+y]=i[h+y];for(let y=0;y<_;++y)i[h+y]=m[y]}A=i.length-r,c.numberOfCommands=A,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&A>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new NA),iot(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var upe=[];function rot(e,t){let n=t,i=upe;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&&(aot(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function fpe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function aot(e,t){e._cache.unloadTile(e,t,fpe),t.destroy()}ir.prototype.trimLoadedTiles=function(){this._cache.trim()};function sot(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,a=i.numberOfPendingRequests,s=i.numberOfTilesProcessing;lp.clone(n,i);let c=o!==a||r!==s;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function cot(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 lot(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!P.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=P.clone(e.modelMatrix,e._previousModelMatrix)))}function uot(e,t,n,i){if(t.mode===oe.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,cot(e),lot(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Yit(e),oot(e,t,i),lp.clone(o,n),i.isRender){let a=e._credits;if(l(a)&&o.selected!==0)for(let s=0;s<a.length;++s){let c=a[s];t.creditDisplay.addCreditToNextFrame(c)}}return r}function dpe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Et.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Et(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ir.prototype.getTraversal=function(e){let{pass:t}=e;return t===ur.MOST_DETAILED_PRELOAD||t===ur.MOST_DETAILED_PICK?gU:this.isSkippingLevelOfDetail?CU:_U};ir.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ir.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===ur.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===ur.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===ur.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 a=ur.getPassOptions(n),s=a.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,a.isRender){let p=this._environmentMapManager;l(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;l(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||s)&&(this._pass=n,t.ready=uot(this,e,h,a)),s&&(c.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};ir.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ir.prototype.isDestroyed=function(){return!1};ir.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),l(this._root)){let e=upe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,fe(this)};ir.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,CESIUM_mesh_vector:!0,MAXAR_content_geojson:!0};ir.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ir.supportedExtensions[e[t]])throw new ue(`Unsupported 3D Tiles Extension: ${e[t]}`)};var fot=new In,dot=new d,hot=new me;ir.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=te.WGS84);let i=fot,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,dot);if(l(r))return n.cartesianToCartographic(r,hot)?.height};ir.prototype.updateHeight=function(e,t,n){n=n??te.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,a=r.length;for(let s=0;s<a;++s)if(r[s]===i){r.splice(s,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var mot=new ea,pot=new d;ir.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let c=0;c<o;++c){let u=i[c],f=di.raySphere(e,u.contentBoundingVolume.boundingSphere,mot);!l(f)||!l(u.content)||r.push(u)}let a=r.length;r.sort((c,u)=>{let f=le.distanceSquaredTo(c.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let s;for(let c=0;c<a;++c){let f=r[c].content.pick(e,t,pot);if(l(f))return s=d.clone(f,n),s}};ir.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ir.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var cs=ir;var Aot=new P;function my(e,t){t.collectionChanged.addEventListener(my.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ft,this._onCollectionChanged(t,t.values,[],[])}my.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let a=t[o],s=a._tileset,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;f&&(h=a.computeModelMatrix(e,Aot),c=De.createIfNeeded(q.getValueOrUndefined(s._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[a.id],got(c,n,a,i)),l(p)&&(p.show=!0,l(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=q.getValueOrDefault(s.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};my.prototype.isDestroyed=function(){return!1};my.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(my.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)CX(this,e[i],t,n);return fe(this)};my.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Ct.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(le.clone(i.boundingSphere,t),Ct.DONE):Ct.FAILED:Ct.PENDING};my.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._entitiesToVisualize,s=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&a.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?a.set(r.id,r):(CX(this,r,s,c),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],CX(this,r,s,c),a.remove(r.id)};function CX(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function got(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await cs.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var bU=my;var _ot=U.WHITE,yot=U.BLACK,Cot=new Q(2,2);function Xx(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(Xx.prototype,{isConstant:{get:function(){return q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:Ae("evenColor"),oddColor:Ae("oddColor"),repeat:Ae("repeat")});Xx.prototype.getType=function(e){return"Checkerboard"};var Eot=new X;Xx.prototype.getValue=function(e,t){return l(e)||(e=X.now(Eot)),l(t)||(t={}),t.lightColor=q.getValueOrClonedDefault(this._evenColor,e,_ot,t.lightColor),t.darkColor=q.getValueOrClonedDefault(this._oddColor,e,yot,t.darkColor),t.repeat=q.getValueOrDefault(this._repeat,e,Cot),t};Xx.prototype.equals=function(e){return this===e||e instanceof Xx&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._repeat,e._repeat)};var sv=Xx;var hpe={id:void 0};function cv(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),a=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,a)}while(e._refire);e._firing=!1}}}function Wc(e){this._owner=e,this._entities=new Ft,this._addedEntities=new Ft,this._removedEntities=new Ft,this._changedEntities=new Ft,this._suspendCount=0,this._collectionChanged=new _e,this._id=Jn(),this._show=!0,this._firing=!1,this._refire=!1}Wc.prototype.suspendEvents=function(){this._suspendCount++};Wc.prototype.resumeEvents=function(){this._suspendCount--,cv(this)};Object.defineProperties(Wc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],a=i[t];r!==a.isShowing&&a.definitionChanged.raiseEvent(a,"isShowing",a.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});Wc.prototype.computeAvailability=function(){let e=Ze.MAXIMUM_VALUE,t=Ze.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let a=n[i].availability;if(l(a)){let s=a.start,c=a.stop;X.lessThan(s,e)&&!s.equals(Ze.MINIMUM_VALUE)&&(e=s),X.greaterThan(c,t)&&!c.equals(Ze.MAXIMUM_VALUE)&&(t=c)}}return Ze.MAXIMUM_VALUE.equals(e)&&(e=Ze.MINIMUM_VALUE),Ze.MINIMUM_VALUE.equals(t)&&(t=Ze.MAXIMUM_VALUE),new Rn({start:e,stop:t})};Wc.prototype.add=function(e){e instanceof $o||(e=new $o(e));let t=e.id,n=this._entities;if(n.contains(t))throw new de(`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(Wc.prototype._onEntityDefinitionChanged,this),cv(this),e};Wc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};Wc.prototype.contains=function(e){return this._entities.get(e.id)===e};Wc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(Wc.prototype._onEntityDefinitionChanged,this),cv(this),!0):!1};Wc.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 a=n[r],s=a.id,c=i.get(s);l(c)||(a.definitionChanged.removeEventListener(Wc.prototype._onEntityDefinitionChanged,this),o.set(s,a))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),cv(this)};Wc.prototype.getById=function(e){return this._entities.get(e)};Wc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(hpe.id=e,t=new $o(hpe),this.add(t)),t};Wc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),cv(this)};var $s=Wc;var xU={id:void 0},Jx=new Array(2);function EX(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 mpe(e,t,n,i){Jx[0]=n,Jx[1]=i.id,t[JSON.stringify(Jx)]=i.definitionChanged.addEventListener(ca.prototype._onDefinitionChanged,e)}function ppe(e,t,n,i){Jx[0]=n,Jx[1]=i.id;let o=JSON.stringify(Jx);t[o](),t[o]=void 0}function py(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,a,s,c,u,f=e._composite,h=new $s(e),p=e._eventHash,A;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(ca.prototype._onCollectionChanged,e),s=u.values,A=u.id,c=s.length-1;c>-1;c--)a=s[c],ppe(e,p,A,a);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(ca.prototype._onCollectionChanged,e),s=u.values,A=u.id,c=s.length-1;c>-1;c--){a=s[c],mpe(e,p,A,a);let _=h.getById(a.id);l(_)||(_=f.getById(a.id),l(_)?EX(_):(xU.id=a.id,_=new $o(xU)),h.add(_)),_.merge(a)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function ca(e,t){this._owner=t,this._composite=new $s(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Jn(),this._eventHash={},py(this),this._shouldRecomposite=!1}Object.defineProperties(ca.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}}});ca.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),py(this)};ca.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),py(this),!0):!1};ca.prototype.removeAllCollections=function(){this._collections.length=0,py(this)};ca.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ca.prototype.contains=function(e){return this._composite.contains(e)};ca.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ca.prototype.getCollection=function(e){return this._collections[e]};ca.prototype.getCollectionsLength=function(){return this._collections.length};function TU(e,t){return e.indexOf(t)}function Ape(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,py(e)}ca.prototype.raiseCollection=function(e){let t=TU(this._collections,e);Ape(this,t,t+1)};ca.prototype.lowerCollection=function(e){let t=TU(this._collections,e);Ape(this,t,t-1)};ca.prototype.raiseCollectionToTop=function(e){let t=TU(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),py(this))};ca.prototype.lowerCollectionToBottom=function(e){let t=TU(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),py(this))};ca.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ca.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(py(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ca.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ca.prototype.getById=function(e){return this._composite.getById(e)};ca.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let a,s,c,u,f=n.length,h=this._eventHash,p=e.id;for(a=0;a<f;a++){let m=n[a];ppe(this,h,p,m);let _=m.id;for(s=o-1;s>=0;s--)c=i[s].getById(_),l(c)&&(l(u)||(u=r.getById(_),EX(u)),u.merge(c));l(u)||r.removeById(_),u=void 0}let A=t.length;for(a=0;a<A;a++){let m=t[a];mpe(this,h,p,m);let _=m.id;for(s=o-1;s>=0;s--)c=i[s].getById(_),l(c)&&(l(u)||(u=r.getById(_),l(u)?EX(u):(xU.id=_,u=new $o(xU),r.add(u))),u.merge(c));u=void 0}r.resumeEvents()};ca.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,a=o.length,s=e.id,c=r.getById(s),u=c[t],f=!l(u),h=!0;for(let p=a-1;p>=0;p--){let A=o[p].getById(e.id);if(l(A)){let m=A[t];if(l(m)){if(h)if(h=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var gpe=ca;function IX(){this._removalFunctions=[]}IX.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};IX.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Hr=IX;function TX(e,t){return X.compare(e.start,t.start)}function la(e){if(this._intervals=[],this._changedEvent=new _e,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(la.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}}});la.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof la))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(!Rn.equals(n[r],i[r],t))return!1;return!0};la.prototype.get=function(e){return this._intervals[e]};la.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};la.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};la.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};la.prototype.contains=function(e){return this.indexOf(e)>=0};var bX=new Rn;la.prototype.indexOf=function(e){let t=this._intervals;bX.start=e,bX.stop=e;let n=Io(t,bX,TX);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&&Rn.contains(t[n-1],e)?n-1:~n)};la.prototype.findInterval=function(e){e=e??V.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let a=0,s=r.length;a<s;a++){let c=r[a];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[a]}};la.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||X.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Io(n,e,TX);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=X.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(X.greaterThan(e.stop,n[i-1].stop)?e=new Rn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Rn({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=X.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Rn({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 Rn({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=X.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Rn({start:e.start,stop:X.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:X.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Rn({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)};la.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Io(t,e,TX);n<0&&(n=~n);let i=!1;for(n>0&&(X.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(X.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 Rn({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 Rn({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 Rn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&X.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 Rn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Rn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(X.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Rn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};la.prototype.intersect=function(e,t,n){let i=new la,o=0,r=0,a=this._intervals,s=e._intervals;for(;o<a.length&&r<s.length;){let c=a[o],u=s[r];if(X.lessThan(c.stop,u.start))++o;else if(X.lessThan(u.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Rn.intersect(c,u,new Rn,n);f.isEmpty||i.addInterval(f,t)}X.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};la.fromJulianDateArray=function(e,t){l(t)||(t=new la);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,a=e.isStopIncluded??!0,s=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;s&&(++f,u=new Rn({start:Ze.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],A=n[h+1];u=new Rn({start:p,stop:A,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?a:!1}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u),p=A}return c&&(u=new Rn({start:n[i-1],stop:Ze.MAXIMUM_VALUE,isStartIncluded:!a,isStopIncluded:!0}),u.data=l(o)?o(u,t.length):t.length,t.addInterval(u)),t};var jc=new Qg,lv=[0,31,28,31,30,31,30,31,31,30,31,30,31];function xX(e,t,n){l(n)||(n=new X),X.toGregorianDate(e,jc);let i=jc.millisecond+t.millisecond,o=jc.second+t.second,r=jc.minute+t.minute,a=jc.hour+t.hour,s=jc.day+t.day,c=jc.month+t.month,u=jc.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&&(a+=Math.floor(r/60),r=r%60),a>=24&&(s+=Math.floor(a/24),a=a%24),lv[2]=hm(u)?29:28;s>lv[c]||c>=13;)s>lv[c]&&(s-=lv[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),lv[2]=hm(u)?29:28;return jc.millisecond=i,jc.second=o,jc.minute=r,jc.hour=a,jc.day=s,jc.month=c,jc.year=u,X.fromGregorianDate(jc,n)}var Iot=new X,bot=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function _pe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(bot);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),X.toGregorianDate(X.fromIso8601(e,Iot),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var uv=new Qg;la.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=X.fromIso8601(n[0]),o=X.fromIso8601(n[1]),r=[];if(!_pe(n[2],uv))r.push(i,o);else{let a=X.clone(i);for(r.push(a);X.compare(a,o)<0;)a=xX(a,uv),X.compare(o,a)<=0&&X.clone(o,a),r.push(a)}return la.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};la.fromIso8601DateArray=function(e,t){return la.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return X.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};la.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],a,s,c=i.length;for(let u=0;u<c;++u)(_pe(i[u],uv)||u===0)&&(o&&l(s)?a=xX(s,uv):a=xX(n,uv),r.push(a),s=a);return la.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ba=la;function xot(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let a=i.length;for(let s=0;s<a;s++){let c=i.get(s);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function n0(){this._eventHelper=new Hr,this._definitionChanged=new _e,this._intervals=new Ba,this._intervals.changedEvent.addEventListener(n0.prototype._intervalsChanged,this)}Object.defineProperties(n0.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Tot=new X;n0.prototype.getValue=function(e,t){l(e)||(e=X.now(Tot));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};n0.prototype.equals=function(e){return this===e||e instanceof n0&&this._intervals.equals(e._intervals,q.equals)};n0.prototype._intervalsChanged=function(){xot(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var vl=n0;function Ay(){this._definitionChanged=new _e,this._composite=new vl,this._composite.definitionChanged.addEventListener(Ay.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Ay.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Ay.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Sot=new X;Ay.prototype.getValue=function(e,t){l(e)||(e=X.now(Sot));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ay.prototype.equals=function(e){return this===e||e instanceof Ay&&this._composite.equals(e._composite,q.equals)};Ay.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var fv=Ay;function gy(e){this._referenceFrame=e??Oi.FIXED,this._definitionChanged=new _e,this._composite=new vl,this._composite.definitionChanged.addEventListener(gy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(gy.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 wot=new X;gy.prototype.getValue=function(e,t){return l(e)||(e=X.now(wot)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};gy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};gy.prototype.equals=function(e){return this===e||e instanceof gy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,q.equals)};gy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var _c=gy;var Bot={ROUNDED:0,MITERED:1,BEVELED:2},no=Object.freeze(Bot);var ec=[new d,new d],Dot=new d,vot=new d,Pot=new d,Rot=new d,Mot=new d,Not=new d,Lot=new d,Oot=new d,Fot=new d,Zx=new d,SU=new d,dv={},SX=new me;function Qot(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];SX=t.cartesianToCartographic(o,SX),n[i]=SX.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function wX(e,t,n,i){let o=e[0],r=e[1],a=d.angleBetween(o,r),s=Math.ceil(a/i),c=new Array(s),u;if(t===n){for(u=0;u<s;u++)c[u]=t;return c.push(n),c}let h=(n-t)/s;for(u=1;u<s;u++){let p=t+u*h;c[u]=p}return c[0]=t,c.push(n),c}var wU=new d,BU=new d;function kot(e,t,n,i){let o=new Fa(n,i),r=o.projectPointOntoPlane(d.add(n,e,wU),wU),a=o.projectPointOntoPlane(d.add(n,t,BU),BU),s=Q.angleBetween(r,a);return a.x*r.y-a.y*r.x>=0?-s:s}var Uot=new d(-1,0,0),i0=new P,zot=new P,BX=new J,Got=J.IDENTITY.clone(),Vot=new d,Hot=new ie,ype=new d;function XA(e,t,n,i,o,r,a,s){let c=Vot,u=Hot;i0=At.eastNorthUpToFixedFrame(e,o,i0),c=P.multiplyByPointAsVector(i0,Uot,c),c=d.normalize(c,c);let f=kot(c,t,e,o);BX=J.fromRotationZ(f,BX),ype.z=r,i0=P.multiplyTransformation(i0,P.fromRotationTranslation(BX,ype,zot),i0);let h=Got;h[0]=a;for(let p=0;p<s;p++)for(let A=0;A<n.length;A+=3)u=d.fromArray(n,A,u),u=J.multiplyByVector(h,u,u),u=P.multiplyByPoint(i0,u,u),i.push(u.x,u.y,u.z);return i}var Wot=new d;function DX(e,t,n,i,o,r,a){for(let s=0;s<e.length;s+=3){let c=d.fromArray(e,s,Wot);i=XA(c,t,n,i,o,r[s/3],a,1)}return i}function jot(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,a=t.y+t.height/2,s=e[0];i[o++]=s.x-r,i[o++]=0,i[o++]=s.y-a;for(let c=1;c<n;c++){s=e[c];let u=s.x-r,f=s.y-a;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return s=e[0],i[o++]=s.x-r,i[o++]=0,i[o++]=s.y-a,i}function Cpe(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,a=t.y+t.height/2;for(let s=0;s<n;s++)i[o++]=e[s].x-r,i[o++]=0,i[o++]=e[s].y-a;return i}var Epe=new Qe,Ipe=new d,bpe=new J;function xpe(e,t,n,i,o,r,a,s,c,u){let f=d.angleBetween(d.subtract(t,e,Zx),d.subtract(n,e,SU)),h=i===no.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;o?p=J.fromQuaternion(Qe.fromAxisAngle(d.negate(e,Zx),f/(h+1),Epe),bpe):p=J.fromQuaternion(Qe.fromAxisAngle(e,f/(h+1),Epe),bpe);let A,m;if(t=d.clone(t,Ipe),h>0){let _=u?2:1;for(let y=0;y<h;y++)t=J.multiplyByVector(p,t,t),A=d.subtract(t,e,Zx),A=d.normalize(A,A),o||(A=d.negate(A,A)),m=r.scaleToGeodeticSurface(t,SU),a=XA(m,A,s,a,r,c,1,_)}else A=d.subtract(t,e,Zx),A=d.normalize(A,A),o||(A=d.negate(A,A)),m=r.scaleToGeodeticSurface(t,SU),a=XA(m,A,s,a,r,c,1,1),n=d.clone(n,Ipe),A=d.subtract(n,e,Zx),A=d.normalize(A,A),o||(A=d.negate(A,A)),m=r.scaleToGeodeticSurface(n,SU),a=XA(m,A,s,a,r,c,1,1);return a}dv.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],a=e[o];Q.equals(r,a)||n.push(a)}return n};dv.angleIsGreaterThanPi=function(e,t,n,i){let o=new Fa(n,i),r=o.projectPointOntoPlane(d.add(n,e,wU),wU),a=o.projectPointOntoPlane(d.add(n,t,BU),BU);return a.x*r.y-a.y*r.x>=0};var Yot=new d,qot=new d;dv.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,a=Qot(e,r),s=i._granularity,c=i._cornerType,u=o?jot(t,n):Cpe(t,n),f=o?Cpe(t,n):void 0,h=n.height/2,p=n.width/2,A=e.length,m=[],_=o?[]:void 0,y=Dot,C=vot,E=Pot,I=Rot,x=Mot,S=Not,w=Lot,v=Oot,R=Fot,N=e[0],L=e[1];I=r.geodeticSurfaceNormal(N,I),y=d.subtract(L,N,y),y=d.normalize(y,y),v=d.cross(I,y,v),v=d.normalize(v,v);let g=a[0],b=a[1];o&&(_=XA(N,v,f,_,r,g+h,1,1)),R=d.clone(N,R),N=L,C=d.negate(y,C);let T,B;for(let G=1;G<A-1;G++){let k=o?2:1;if(L=e[G+1],N.equals(L)){bt("Positions are too close and are considered equivalent with rounding error.");continue}y=d.subtract(L,N,y),y=d.normalize(y,y),I=r.geodeticSurfaceNormal(N,I);let z=d.multiplyByScalar(I,d.dot(y,I),Yot);d.subtract(y,z,z),d.normalize(z,z);let F=d.multiplyByScalar(I,d.dot(C,I),qot);if(d.subtract(C,F,F),d.normalize(F,F),!D.equalsEpsilon(Math.abs(d.dot(z,F)),1,D.EPSILON7)){E=d.add(y,C,E),E=d.normalize(E,E),E=d.cross(E,I,E),E=d.cross(I,E,E),E=d.normalize(E,E);let Y=1/Math.max(.25,d.magnitude(d.cross(E,C,Zx))),$=dv.angleIsGreaterThanPi(y,C,N,r);$?(x=d.add(N,d.multiplyByScalar(E,Y*p,E),x),S=d.add(x,d.multiplyByScalar(v,p,S),S),ec[0]=d.clone(R,ec[0]),ec[1]=d.clone(S,ec[1]),T=wX(ec,g+h,b+h,s),B=to.generateArc({positions:ec,granularity:s,ellipsoid:r}),m=DX(B,v,u,m,r,T,1),v=d.cross(I,y,v),v=d.normalize(v,v),w=d.add(x,d.multiplyByScalar(v,p,w),w),c===no.ROUNDED||c===no.BEVELED?xpe(x,S,w,c,$,r,m,u,b+h,o):(E=d.negate(E,E),m=XA(N,E,u,m,r,b+h,Y,k)),R=d.clone(w,R)):(x=d.add(N,d.multiplyByScalar(E,Y*p,E),x),S=d.add(x,d.multiplyByScalar(v,-p,S),S),ec[0]=d.clone(R,ec[0]),ec[1]=d.clone(S,ec[1]),T=wX(ec,g+h,b+h,s),B=to.generateArc({positions:ec,granularity:s,ellipsoid:r}),m=DX(B,v,u,m,r,T,1),v=d.cross(I,y,v),v=d.normalize(v,v),w=d.add(x,d.multiplyByScalar(v,-p,w),w),c===no.ROUNDED||c===no.BEVELED?xpe(x,S,w,c,$,r,m,u,b+h,o):m=XA(N,E,u,m,r,b+h,Y,k),R=d.clone(w,R)),C=d.negate(y,C)}else m=XA(R,v,u,m,r,g+h,1,1),R=N;g=b,b=a[G+1],N=L}ec[0]=d.clone(R,ec[0]),ec[1]=d.clone(N,ec[1]),T=wX(ec,g+h,b+h,s),B=to.generateArc({positions:ec,granularity:s,ellipsoid:r}),m=DX(B,v,u,m,r,T,1),o&&(_=XA(N,v,f,_,r,b+h,1,1)),A=m.length;let M=o?A+_.length:A,O=new Float64Array(M);return O.set(m),o&&O.set(_,A),O};var up=dv;var PX={},$x=new d,Dpe=new d,Kot=new d,Tpe=new d,Pl=[new d,new d],vpe=new d,Ppe=new d,Rpe=new d,Xot=new d,Jot=new d,Zot=new d,$ot=new d,ert=new d,trt=new d,nrt=new d,Spe=new Qe,wpe=new J;function DU(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,$x),d.subtract(n,e,Dpe)),a=i===no.BEVELED?1:Math.ceil(r/D.toRadians(5))+1,s=a*3,c=new Array(s);c[s-3]=n.x,c[s-2]=n.y,c[s-1]=n.z;let u;o?u=J.fromQuaternion(Qe.fromAxisAngle(d.negate(e,$x),r/a,Spe),wpe):u=J.fromQuaternion(Qe.fromAxisAngle(e,r/a,Spe),wpe);let f=0;t=d.clone(t,$x);for(let h=0;h<a;h++)t=J.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function irt(e){let t=vpe,n=Ppe,i=Rpe,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=DU(t,n,i,no.ROUNDED,!1),a=e.length-1,s=e[a-1];o=e[a],n=d.fromArray(s,s.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let c=DU(t,n,i,no.ROUNDED,!1);return[r,c]}function Bpe(e,t,n,i){let o=$x;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function vX(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),a=d.multiplyByScalar(t,n,$x),s=d.negate(a,Dpe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,Kot),p=d.add(h,s,Tpe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let A=d.add(h,a,Tpe);r[u--]=A.z,r[u--]=A.y,r[u--]=A.x}return i.push(o,r),i}PX.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,a=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=a),l(i)&&(e[i]=a,e[i-1]=r,e[i-2]=o)};var ort=new d,rrt=new d;PX.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,a=e.saveAttributes,s=vpe,c=Ppe,u=Rpe,f=Xot,h=Jot,p=Zot,A=$ot,m=ert,_=trt,y=nrt,C=[],E=a?[]:void 0,I=a?[]:void 0,x=n[0],S=n[1];c=d.normalize(d.subtract(S,x,c),c),s=i.geodeticSurfaceNormal(x,s),f=d.normalize(d.cross(s,c,f),f),a&&(E.push(f.x,f.y,f.z),I.push(s.x,s.y,s.z)),A=d.clone(x,A),x=S,u=d.negate(c,u);let w,v=[],R,N=n.length;for(R=1;R<N-1;R++){s=i.geodeticSurfaceNormal(x,s),S=n[R+1],c=d.normalize(d.subtract(S,x,c),c);let g=d.multiplyByScalar(s,d.dot(c,s),ort);d.subtract(c,g,g),d.normalize(g,g);let b=d.multiplyByScalar(s,d.dot(u,s),rrt);if(d.subtract(u,b,b),d.normalize(b,b),!D.equalsEpsilon(Math.abs(d.dot(g,b)),1,D.EPSILON7)){h=d.normalize(d.add(c,u,h),h),h=d.cross(h,s,h),h=d.cross(s,h,h),h=d.normalize(h,h);let B=o/Math.max(.25,d.magnitude(d.cross(h,u,$x))),M=up.angleIsGreaterThanPi(c,u,x,i);h=d.multiplyByScalar(h,B,h),M?(m=d.add(x,h,m),y=d.add(m,d.multiplyByScalar(f,o,y),y),_=d.add(m,d.multiplyByScalar(f,o*2,_),_),Pl[0]=d.clone(A,Pl[0]),Pl[1]=d.clone(y,Pl[1]),w=to.generateArc({positions:Pl,granularity:t,ellipsoid:i}),C=vX(w,f,o,C),a&&(E.push(f.x,f.y,f.z),I.push(s.x,s.y,s.z)),p=d.clone(_,p),f=d.normalize(d.cross(s,c,f),f),_=d.add(m,d.multiplyByScalar(f,o*2,_),_),A=d.add(m,d.multiplyByScalar(f,o,A),A),r===no.ROUNDED||r===no.BEVELED?v.push({leftPositions:DU(m,p,_,r,M)}):v.push({leftPositions:Bpe(x,d.negate(h,h),_,M)})):(_=d.add(x,h,_),y=d.add(_,d.negate(d.multiplyByScalar(f,o,y),y),y),m=d.add(_,d.negate(d.multiplyByScalar(f,o*2,m),m),m),Pl[0]=d.clone(A,Pl[0]),Pl[1]=d.clone(y,Pl[1]),w=to.generateArc({positions:Pl,granularity:t,ellipsoid:i}),C=vX(w,f,o,C),a&&(E.push(f.x,f.y,f.z),I.push(s.x,s.y,s.z)),p=d.clone(m,p),f=d.normalize(d.cross(s,c,f),f),m=d.add(_,d.negate(d.multiplyByScalar(f,o*2,m),m),m),A=d.add(_,d.negate(d.multiplyByScalar(f,o,A),A),A),r===no.ROUNDED||r===no.BEVELED?v.push({rightPositions:DU(_,p,m,r,M)}):v.push({rightPositions:Bpe(x,h,m,M)})),u=d.negate(c,u)}x=S}s=i.geodeticSurfaceNormal(x,s),Pl[0]=d.clone(A,Pl[0]),Pl[1]=d.clone(x,Pl[1]),w=to.generateArc({positions:Pl,granularity:t,ellipsoid:i}),C=vX(w,f,o,C),a&&(E.push(f.x,f.y,f.z),I.push(s.x,s.y,s.z));let L;return r===no.ROUNDED&&(L=irt(C)),{positions:C,corners:v,lefts:E,normals:I,endPositions:L}};var lo=PX;var Lpe=new d,Ope=new d,vU=new d,PU=new d,art=new d,Fpe=new d,_y=new d,eT=new d;function Qpe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function vh(e,t,n,i,o,r){let a=e.normals,s=e.tangents,c=e.bitangents,u=d.normalize(d.cross(n,t,_y),_y);r.normal&&lo.addAttribute(a,t,i,o),r.tangent&&lo.addAttribute(s,u,i,o),r.bitangent&&lo.addAttribute(c,n,i,o)}function kpe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,a=e.lefts,s=e.normals,c=new En,u,f=0,h=0,p,A=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,A+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let Z=o[p].leftPositions;l(Z)?(m=Z.length,f+=m,A+=m):(m=o[p].rightPositions.length,h+=m,A+=m)}let _=l(r),y;_&&(y=r[0].length-3,f+=y,h+=y,y/=3,A+=y*6);let C=f+h,E=new Float64Array(C),I=t.normal?new Float32Array(C):void 0,x=t.tangent?new Float32Array(C):void 0,S=t.bitangent?new Float32Array(C):void 0,w={normals:I,tangents:x,bitangents:S},v=0,R=C-1,N,L,g,b,T=Lpe,B=Ope,M,O,G=y/2,k=Ue.createTypedArray(C/3,A),z=0;if(_){O=vU,M=PU;let Z=r[0];for(T=d.fromArray(s,0,T),B=d.fromArray(a,0,B),p=0;p<G;p++)O=d.fromArray(Z,(G-1-p)*3,O),M=d.fromArray(Z,(G+p)*3,M),lo.addAttribute(E,M,v),lo.addAttribute(E,O,void 0,R),vh(w,T,B,v,R,t),L=v/3,b=L+1,N=(R-2)/3,g=N-1,k[z++]=N,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=b,v+=3,R-=3}let F=0,H=0,Y=i[F++],$=i[F++];E.set(Y,v),E.set($,R-$.length+1),B=d.fromArray(a,H,B);let W,K;for(m=$.length-3,p=0;p<m;p+=3)W=n.geodeticSurfaceNormal(d.fromArray(Y,p,_y),_y),K=n.geodeticSurfaceNormal(d.fromArray($,m-p,eT),eT),T=d.normalize(d.add(W,K,T),T),vh(w,T,B,v,R,t),L=v/3,b=L+1,N=(R-2)/3,g=N-1,k[z++]=N,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=b,v+=3,R-=3;for(W=n.geodeticSurfaceNormal(d.fromArray(Y,m,_y),_y),K=n.geodeticSurfaceNormal(d.fromArray($,m,eT),eT),T=d.normalize(d.add(W,K,T),T),H+=3,p=0;p<o.length;p++){let Z;u=o[p];let pe=u.leftPositions,ge=u.rightPositions,re,ye,Ce=Fpe,ve=vU,Ne=PU;if(T=d.fromArray(s,H,T),l(pe)){for(vh(w,T,B,void 0,R,t),R-=3,re=b,ye=g,Z=0;Z<pe.length/3;Z++)Ce=d.fromArray(pe,Z*3,Ce),k[z++]=re,k[z++]=ye-Z-1,k[z++]=ye-Z,lo.addAttribute(E,Ce,void 0,R),ve=d.fromArray(E,(ye-Z-1)*3,ve),Ne=d.fromArray(E,re*3,Ne),B=d.normalize(d.subtract(ve,Ne,B),B),vh(w,T,B,void 0,R,t),R-=3;Ce=d.fromArray(E,re*3,Ce),ve=d.subtract(d.fromArray(E,ye*3,ve),Ce,ve),Ne=d.subtract(d.fromArray(E,(ye-Z)*3,Ne),Ce,Ne),B=d.normalize(d.add(ve,Ne,B),B),vh(w,T,B,v,void 0,t),v+=3}else{for(vh(w,T,B,v,void 0,t),v+=3,re=g,ye=b,Z=0;Z<ge.length/3;Z++)Ce=d.fromArray(ge,Z*3,Ce),k[z++]=re,k[z++]=ye+Z,k[z++]=ye+Z+1,lo.addAttribute(E,Ce,v),ve=d.fromArray(E,re*3,ve),Ne=d.fromArray(E,(ye+Z)*3,Ne),B=d.normalize(d.subtract(ve,Ne,B),B),vh(w,T,B,v,void 0,t),v+=3;Ce=d.fromArray(E,re*3,Ce),ve=d.subtract(d.fromArray(E,(ye+Z)*3,ve),Ce,ve),Ne=d.subtract(d.fromArray(E,ye*3,Ne),Ce,Ne),B=d.normalize(d.negate(d.add(Ne,ve,B),B),B),vh(w,T,B,void 0,R,t),R-=3}for(Y=i[F++],$=i[F++],Y.splice(0,3),$.splice($.length-3,3),E.set(Y,v),E.set($,R-$.length+1),m=$.length-3,H+=3,B=d.fromArray(a,H,B),Z=0;Z<$.length;Z+=3)W=n.geodeticSurfaceNormal(d.fromArray(Y,Z,_y),_y),K=n.geodeticSurfaceNormal(d.fromArray($,m-Z,eT),eT),T=d.normalize(d.add(W,K,T),T),vh(w,T,B,v,R,t),b=v/3,L=b-1,g=(R-2)/3,N=g+1,k[z++]=N,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=b,v+=3,R-=3;v-=3,R+=3}if(T=d.fromArray(s,s.length-3,T),vh(w,T,B,v,R,t),_){v+=3,R-=3,O=vU,M=PU;let Z=r[1];for(p=0;p<G;p++)O=d.fromArray(Z,(y-p-1)*3,O),M=d.fromArray(Z,p*3,M),lo.addAttribute(E,O,void 0,R),lo.addAttribute(E,M,v),vh(w,T,B,v,R,t),b=v/3,L=b-1,g=(R-2)/3,N=g+1,k[z++]=N,k[z++]=L,k[z++]=g,k[z++]=g,k[z++]=L,k[z++]=b,v+=3,R-=3}if(c.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:E}),t.st){let Z=new Float32Array(C/3*2),pe,ge,re=0;if(_){f/=3,h/=3;let ye=Math.PI/(y+1);ge=1/(f-y+1),pe=1/(h-y+1);let Ce,ve=y/2;for(p=ve+1;p<y+1;p++)Ce=D.PI_OVER_TWO+ye*p,Z[re++]=pe*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce));for(p=1;p<h-y+1;p++)Z[re++]=p*pe,Z[re++]=0;for(p=y;p>ve;p--)Ce=D.PI_OVER_TWO-p*ye,Z[re++]=1-pe*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce));for(p=ve;p>0;p--)Ce=D.PI_OVER_TWO-ye*p,Z[re++]=1-ge*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce));for(p=f-y;p>0;p--)Z[re++]=p*ge,Z[re++]=1;for(p=1;p<ve+1;p++)Ce=D.PI_OVER_TWO+ye*p,Z[re++]=ge*(1+Math.cos(Ce)),Z[re++]=.5*(1+Math.sin(Ce))}else{for(f/=3,h/=3,ge=1/(f-1),pe=1/(h-1),p=0;p<h;p++)Z[re++]=p*pe,Z[re++]=0;for(p=f;p>0;p--)Z[re++]=(p-1)*ge,Z[re++]=1}c.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:Z})}return t.normal&&(c.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:w.normals})),t.tangent&&(c.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:w.tangents})),t.bitangent&&(c.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:w.bitangents})),{attributes:c,indices:k}}function srt(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,a=r*3,s=r*2,c=a*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(a*6):void 0,h=t.tangent?new Float32Array(a*6):void 0,p=t.bitangent?new Float32Array(a*6):void 0,A=Lpe,m=Ope,_=vU,y=PU,C=art,E=Fpe,I=c;for(u=0;u<a;u+=3){let x=I+c;A=d.fromArray(n,u,A),m=d.fromArray(n,u+a,m),_=d.fromArray(n,(u+3)%a,_),m=d.subtract(m,A,m),_=d.subtract(_,A,_),y=d.normalize(d.cross(m,_,y),y),t.normal&&(lo.addAttribute(f,y,x),lo.addAttribute(f,y,x+3),lo.addAttribute(f,y,I),lo.addAttribute(f,y,I+3)),(t.tangent||t.bitangent)&&(E=d.fromArray(i,u,E),t.bitangent&&(lo.addAttribute(p,E,x),lo.addAttribute(p,E,x+3),lo.addAttribute(p,E,I),lo.addAttribute(p,E,I+3)),t.tangent&&(C=d.normalize(d.cross(E,y,C),C),lo.addAttribute(h,C,x),lo.addAttribute(h,C,x+3),lo.addAttribute(h,C,I),lo.addAttribute(h,C,I+3))),I+=6}if(t.normal){for(f.set(i),u=0;u<a;u+=3)f[u+a]=-i[u],f[u+a+1]=-i[u+1],f[u+a+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,a),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let x=e.tangent.values;h.set(x),h.set(x,a),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(s*6);h.set(f),h.set(f,s);let p=s*2;for(let A=0;A<2;A++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<s;u+=2){let m=f[u],_=f[u+1];h[p++]=m,h[p++]=_,h[p++]=m,h[p++]=_}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function RX(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],a=e[i+2];n[t++]=o,n[t++]=r,n[t++]=a,n[t++]=o,n[t++]=r,n[t++]=a}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function crt(e,t){let n=new ke({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=lo.computePositions(e),r=kpe(o,n,i),a=e.height,s=e.extrudedHeight,c=r.attributes,u=r.indices,f=c.position.values,h=f.length,p=new Float64Array(h*6),A=new Float64Array(h);A.set(f);let m=new Float64Array(h*4);f=wi.scaleToGeodeticHeight(f,a,i),m=RX(f,0,m),A=wi.scaleToGeodeticHeight(A,s,i),m=RX(A,h*2,m),p.set(f),p.set(A,h),p.set(m,h*2),c.position.values=p,c=srt(c,t);let _,y=h/3;if(e.shadowVolume){let N=c.normal.values;h=N.length;let L=new Float32Array(h*6);for(_=0;_<h;_++)N[_]=-N[_];L.set(N,h),L=RX(N,h*4,L),c.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let N=new Uint8Array(y*6);if(e.offsetAttribute===mn.TOP)N=N.fill(1,0,y).fill(1,y*2,y*4);else{let L=e.offsetAttribute===mn.NONE?0:1;N=N.fill(L)}c.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}let C=u.length,E=y+y,I=Ue.createTypedArray(p.length/3,C*2+E*3);I.set(u);let x=C;for(_=0;_<C;_+=3){let N=u[_],L=u[_+1],g=u[_+2];I[x++]=g+y,I[x++]=L+y,I[x++]=N+y}let S,w,v,R;for(_=0;_<E;_+=2)S=_+E,w=S+E,v=S+1,R=w+1,I[x++]=S,I[x++]=w,I[x++]=v,I[x++]=v,I[x++]=w,I[x++]=R;return{attributes:c,indices:I}}var Mpe=new d,hv=new d,Id=new me;function Npe(e,t,n,i,o,r){let a=d.subtract(t,e,Mpe);d.normalize(a,a);let s=n.geodeticSurfaceNormal(e,hv),c=d.cross(a,s,Mpe);d.multiplyByScalar(c,i,c);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,c,hv),n.cartesianToCartographic(hv,Id);let A=Id.latitude,m=Id.longitude;u=Math.min(u,A),f=Math.min(f,m),h=Math.max(h,A),p=Math.max(p,m),d.subtract(e,c,hv),n.cartesianToCartographic(hv,Id),A=Id.latitude,m=Id.longitude,u=Math.min(u,A),f=Math.min(f,m),h=Math.max(h,A),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var Ed=new d,mv=new d,gu=new me,_u=new me;function Upe(e,t,n,i,o){e=Qpe(e,t);let r=jo(e,d.equalsEpsilon),a=r.length;if(a<2||n<=0)return new ce;let s=n*.5;gu.latitude=Number.POSITIVE_INFINITY,gu.longitude=Number.POSITIVE_INFINITY,_u.latitude=Number.NEGATIVE_INFINITY,_u.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===no.ROUNDED){let p=r[0];d.subtract(p,r[1],Ed),d.normalize(Ed,Ed),d.multiplyByScalar(Ed,s,Ed),d.add(p,Ed,mv),t.cartesianToCartographic(mv,Id),c=Id.latitude,u=Id.longitude,gu.latitude=Math.min(gu.latitude,c),gu.longitude=Math.min(gu.longitude,u),_u.latitude=Math.max(_u.latitude,c),_u.longitude=Math.max(_u.longitude,u)}for(let p=0;p<a-1;++p)Npe(r[p],r[p+1],t,s,gu,_u);let f=r[a-1];d.subtract(f,r[a-2],Ed),d.normalize(Ed,Ed),d.multiplyByScalar(Ed,s,Ed),d.add(f,Ed,mv),Npe(f,mv,t,s,gu,_u),i===no.ROUNDED&&(t.cartesianToCartographic(mv,Id),c=Id.latitude,u=Id.longitude,gu.latitude=Math.min(gu.latitude,c),gu.longitude=Math.min(gu.longitude,u),_u.latitude=Math.max(_u.latitude,c),_u.longitude=Math.max(_u.longitude,u));let h=l(o)?o:new ce;return h.north=_u.latitude,h.south=gu.latitude,h.east=_u.longitude,h.west=gu.longitude,h}function ZA(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??no.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+te.packedLength+ke.packedLength+7}ZA.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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 zpe=te.clone(te.UNIT_SPHERE),Gpe=new ke,JA={positions:void 0,ellipsoid:zpe,vertexFormat:Gpe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};ZA.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=te.unpack(e,t,zpe);t+=te.packedLength;let a=ke.unpack(e,t,Gpe);t+=ke.packedLength;let s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,A=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._vertexFormat=ke.clone(a,n._vertexFormat),n._width=s,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=A===-1?void 0:A,n):(JA.positions=o,JA.width=s,JA.height=c,JA.extrudedHeight=u,JA.cornerType=f,JA.granularity=h,JA.shadowVolume=p,JA.offsetAttribute=A===-1?void 0:A,new ZA(JA))};ZA.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??te.default,r=e.cornerType??no.ROUNDED;return Upe(n,o,i,r,t)};ZA.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Qpe(t,i);let o=jo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(r,a,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(s)u.height=r,u.extrudedHeight=a,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=crt(u,c);else{let A=lo.computePositions(u);if(f=kpe(A,c,i),f.attributes.position.values=wi.scaleToGeodeticHeight(f.attributes.position.values,r,i),l(e._offsetAttribute)){let m=e._offsetAttribute===mn.NONE?0:1,_=f.attributes.position.values.length,y=new Uint8Array(_/3).fill(m);f.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let h=f.attributes,p=le.fromVertices(h.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new yt({attributes:h,indices:f.indices,primitiveType:Pe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};ZA.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new ZA({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(ZA.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Upe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var tT=ZA;var Vpe=new d,Hpe=new d,lrt=new d;function urt(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Wpe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,a=new En,s,c=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,h+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<o.length;f++){s=o[f];let M=o[f].leftPositions;l(M)?(p=M.length,c+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let A=l(r),m;A&&(m=r[0].length-3,c+=m,u+=m,m/=3,h+=m*4);let _=c+u,y=new Float64Array(_),C=0,E=_-1,I,x,S,w,v,R,N=m/2,L=Ue.createTypedArray(_/3,h+4),g=0;if(L[g++]=C/3,L[g++]=(E-2)/3,A){n.push(C/3),R=Vpe,v=Hpe;let M=r[0];for(f=0;f<N;f++)R=d.fromArray(M,(N-1-f)*3,R),v=d.fromArray(M,(N+f)*3,v),lo.addAttribute(y,v,C),lo.addAttribute(y,R,void 0,E),x=C/3,w=x+1,I=(E-2)/3,S=I-1,L[g++]=I,L[g++]=S,L[g++]=x,L[g++]=w,C+=3,E-=3}let b=0,T=i[b++],B=i[b++];for(y.set(T,C),y.set(B,E-B.length+1),p=B.length-3,n.push(C/3,(E-2)/3),f=0;f<p;f+=3)x=C/3,w=x+1,I=(E-2)/3,S=I-1,L[g++]=I,L[g++]=S,L[g++]=x,L[g++]=w,C+=3,E-=3;for(f=0;f<o.length;f++){let M;s=o[f];let O=s.leftPositions,G=s.rightPositions,k,z=lrt;if(l(O)){for(E-=3,k=S,n.push(w),M=0;M<O.length/3;M++)z=d.fromArray(O,M*3,z),L[g++]=k-M-1,L[g++]=k-M,lo.addAttribute(y,z,void 0,E),E-=3;n.push(k-Math.floor(O.length/6)),t===no.BEVELED&&n.push((E-2)/3+1),C+=3}else{for(C+=3,k=w,n.push(S),M=0;M<G.length/3;M++)z=d.fromArray(G,M*3,z),L[g++]=k+M,L[g++]=k+M+1,lo.addAttribute(y,z,C),C+=3;n.push(k+Math.floor(G.length/6)),t===no.BEVELED&&n.push(C/3-1),E-=3}for(T=i[b++],B=i[b++],T.splice(0,3),B.splice(B.length-3,3),y.set(T,C),y.set(B,E-B.length+1),p=B.length-3,M=0;M<B.length;M+=3)w=C/3,x=w-1,S=(E-2)/3,I=S+1,L[g++]=I,L[g++]=S,L[g++]=x,L[g++]=w,C+=3,E-=3;C-=3,E+=3,n.push(C/3,(E-2)/3)}if(A){C+=3,E-=3,R=Vpe,v=Hpe;let M=r[1];for(f=0;f<N;f++)R=d.fromArray(M,(m-f-1)*3,R),v=d.fromArray(M,f*3,v),lo.addAttribute(y,R,void 0,E),lo.addAttribute(y,v,C),w=C/3,x=w-1,S=(E-2)/3,I=S+1,L[g++]=I,L[g++]=S,L[g++]=x,L[g++]=w,C+=3,E-=3;n.push(C/3)}else n.push(C/3,(E-2)/3);return L[g++]=C/3,L[g++]=(E-2)/3,a.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:y}),{attributes:a,indices:L,wallIndices:n}}function frt(e){let t=e.ellipsoid,n=lo.computePositions(e),i=Wpe(n,e.cornerType),o=i.wallIndices,r=e.height,a=e.extrudedHeight,s=i.attributes,c=i.indices,u=s.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=wi.scaleToGeodeticHeight(u,r,t),h=wi.scaleToGeodeticHeight(h,a,t),p.set(u),p.set(h,f),s.position.values=p,f/=3,l(e.offsetAttribute)){let I=new Uint8Array(f*2);if(e.offsetAttribute===mn.TOP)I=I.fill(1,0,f);else{let x=e.offsetAttribute===mn.NONE?0:1;I=I.fill(x)}s.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}let A,m=c.length,_=Ue.createTypedArray(p.length/3,(m+o.length)*2);_.set(c);let y=m;for(A=0;A<m;A+=2){let I=c[A],x=c[A+1];_[y++]=I+f,_[y++]=x+f}let C,E;for(A=0;A<o.length;A++)C=o[A],E=C+f,_[y++]=C,_[y++]=E;return{attributes:s,indices:_}}function pv(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??no.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+te.packedLength+6}pv.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var jpe=te.clone(te.UNIT_SPHERE),yy={positions:void 0,ellipsoid:jpe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};pv.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=te.unpack(e,t,jpe);t+=te.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t];return l(n)?(n._positions=o,n._ellipsoid=te.clone(r,n._ellipsoid),n._width=a,n._height=s,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(yy.positions=o,yy.width=a,yy.height=s,yy.extrudedHeight=c,yy.cornerType=u,yy.granularity=f,yy.offsetAttribute=h===-1?void 0:h,new pv(yy))};pv.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=urt(t,i);let o=jo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,a=e._extrudedHeight,s=!D.equalsEpsilon(r,a,0,D.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(s)c.height=r,c.extrudedHeight=a,c.offsetAttribute=e._offsetAttribute,u=frt(c);else{let p=lo.computePositions(c);if(u=Wpe(p,c.cornerType),u.attributes.position.values=wi.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let A=u.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,_=new Uint8Array(A/3).fill(m);u.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let f=u.attributes,h=le.fromVertices(f.position.values,void 0,3);return new yt({attributes:f,indices:u.indices,primitiveType:Pe.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var RU=pv;var drt=new hi(0);function Rl(e){Ti.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Rl.prototype=Object.create(Ti.prototype),Rl.prototype.constructor=Rl);Object.defineProperties(Rl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Rl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Zl.isSupported(this._scene)};Rl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Rl.prototype._computeCenter=de.throwInstantiationError;Rl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Ti.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&bt(bt.geometryZIndex),this._zIndex=o.zIndex??drt,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,a=o.extrudedHeightReference;if(l(r)||l(a)){let s=new Mm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Ib(this._scene,s,r,a)}};Rl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Ti.prototype.destroy.call(this)};Rl.getGeometryHeight=function(e,t){if(!l(e)){t!==ot.NONE&&bt(bt.geometryHeightReference);return}return Hf(t)?0:e};Rl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==ot.NONE&&bt(bt.geometryExtrudedHeightReference);return}return Hf(t)?Rl.CLAMP_TO_GROUND:e};Rl.CLAMP_TO_GROUND="clamp";Rl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=ot.NONE),(!l(n)||!l(i))&&(i=ot.NONE);let o=0;if(t!==ot.NONE&&o++,i===ot.RELATIVE_TO_GROUND&&o++,o===2)return mn.ALL;if(o===1)return mn.TOP};var ri=Rl;var Ype=new U,qpe=d.ZERO,Kpe=new d,Xpe=new ce;function hrt(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 Ph(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new hrt(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Ph.prototype=Object.create(ri.prototype),Ph.prototype.constructor=Ph);Ph.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Ype)),l(o)||(o=U.WHITE),i.color=Jt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,qpe,Kpe))),new Lt({id:t,geometry:new tT(this._options),attributes:i})};Ph.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Ype),o={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,qpe,Kpe))),new Lt({id:t,geometry:new RU(this._options),attributes:o})};Ph.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};Ph.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Ti.prototype._isHidden.call(this,e,t)};Ph.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.width)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Ph.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Ze.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Ze.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,Ze.MINIMUM_VALUE,ot.NONE);l(o)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof Kt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Ze.MINIMUM_VALUE,a.positions),a.width=t.width.getValue(Ze.MINIMUM_VALUE),a.granularity=q.getValueOrUndefined(t.granularity,Ze.MINIMUM_VALUE),a.cornerType=q.getValueOrUndefined(t.cornerType,Ze.MINIMUM_VALUE),a.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),a.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=vi.getMinimumMaximumHeights(tT.computeRectangle(a,Xpe)).minimumTerrainHeight),a.extrudedHeight=o};Ph.DynamicGeometryUpdater=nT;function nT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(nT.prototype=Object.create(xi.prototype),nT.prototype.constructor=nT);nT.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||xi.prototype._isHidden.call(this,e,t,n)};nT.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,ot.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),s=q.getValueOrDefault(t.extrudedHeightReference,n,ot.NONE);l(a)&&!l(o)&&(o=0),i.positions=q.getValueOrUndefined(t.positions,n),i.width=q.getValueOrUndefined(t.width,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,a,s),i.height=ri.getGeometryHeight(o,r),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND&&(a=vi.getMinimumMaximumHeights(tT.computeRectangle(i,Xpe)).minimumTerrainHeight),i.extrudedHeight=a};var MU=Ph;function NU(){de.throwInstantiationError()}Object.defineProperties(NU.prototype,{name:{get:de.throwInstantiationError},clock:{get:de.throwInstantiationError},entities:{get:de.throwInstantiationError},isLoading:{get:de.throwInstantiationError},changedEvent:{get:de.throwInstantiationError},errorEvent:{get:de.throwInstantiationError},loadingEvent:{get:de.throwInstantiationError},show:{get:de.throwInstantiationError},clustering:{get:de.throwInstantiationError}});NU.prototype.update=function(e){de.throwInstantiationError()};NU.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Da=NU;function fp(e,t){this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(fp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var Jpe=new d;fp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,Jpe);return NX(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};fp.prototype.isScaledSpacePointVisible=function(e){return NX(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var mrt=new d;fp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=mrt,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),NX(e,o,i)};fp.prototype.computeHorizonCullingPoint=function(e,t,n){return eAe(this._ellipsoid,e,t,n)};var Zpe=te.clone(te.UNIT_SPHERE);fp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=$pe(this._ellipsoid,n,Zpe);return eAe(o,e,t,i)};fp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return tAe(this._ellipsoid,e,t,n,i,o)};fp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let a=$pe(this._ellipsoid,o,Zpe);return tAe(a,e,t,n,i,r)};var prt=[];fp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ce.subsample(e,t,0,prt),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var Art=new d;function $pe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,Art);e=te.fromCartesian3(i,n)}return e}function eAe(e,t,n,i){l(i)||(i=new d);let o=oAe(e,t),r=0;for(let a=0,s=n.length;a<s;++a){let c=n[a],u=nAe(e,c,o);if(u<0)return;r=Math.max(r,u)}return iAe(o,r,i)}var LU=new d;function tAe(e,t,n,i,o,r){l(r)||(r=new d),i=i??3,o=o??d.ZERO;let a=oAe(e,t),s=0;for(let c=0,u=n.length;c<u;c+=i){LU.x=n[c]+o.x,LU.y=n[c+1]+o.y,LU.z=n[c+2]+o.z;let f=nAe(e,LU,a);if(f<0)return;s=Math.max(s,f)}return iAe(a,s,r)}function NX(e,t,n){let i=t,o=n,r=d.subtract(e,i,Jpe),a=-d.dot(r,i);return!(o<0?a>0:a>o&&a*a/d.magnitudeSquared(r)>o)}var grt=new d,_rt=new d;function nAe(e,t,n){let i=e.transformPositionToScaledSpace(t,grt),o=d.magnitudeSquared(i),r=Math.sqrt(o),a=d.divideByScalar(i,r,_rt);o=Math.max(1,o),r=Math.max(1,r);let s=d.dot(a,n),c=d.magnitude(d.cross(a,n,a)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(s*u-c*f)}function iAe(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var MX=new d;function oAe(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,MX),d.normalize(MX,MX))}var dp=fp;function Wr(e,t){e=e??V.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Ht.clone(n)),l(i)&&(i=Ht.clone(i)),l(o)&&(o=Gt.clone(o)),this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=U.clone(e.color??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.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??Qr.NONE}var rAe=Wr.SHOW_INDEX=0,cAe=Wr.POSITION_INDEX=1,yrt=Wr.COLOR_INDEX=2,Crt=Wr.OUTLINE_COLOR_INDEX=3,Ert=Wr.OUTLINE_WIDTH_INDEX=4,Irt=Wr.PIXEL_SIZE_INDEX=5,brt=Wr.SCALE_BY_DISTANCE_INDEX=6,xrt=Wr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,Trt=Wr.DISTANCE_DISPLAY_CONDITION_INDEX=8,Srt=Wr.DISABLE_DEPTH_DISTANCE_INDEX=9,wrt=Wr.SPLIT_DIRECTION_INDEX=10;Wr.NUMBER_OF_PROPERTIES=11;function rf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Wr.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,rf(this,rAe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),rf(this,cAe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Ht.equals(t,e)||(this._scaleByDistance=Ht.clone(e,t),rf(this,brt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Ht.equals(t,e)||(this._translucencyByDistance=Ht.clone(e,t),rf(this,xrt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,rf(this,Irt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),rf(this,yrt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),rf(this,Crt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,rf(this,Ert))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),rf(this,Trt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,rf(this,Srt))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,rf(this,rAe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,rf(this,wrt))}}});Wr.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Wr.prototype._getActualPosition=function(){return this._actualPosition};Wr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),rf(this,cAe)};var aAe=new ie;Wr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(P.multiplyByPoint(n,e,aAe),co.computeActualEllipsoidPosition(t,aAe))};var sAe=new ie;Wr._computeScreenSpacePosition=function(e,t,n,i){let o=P.multiplyByVector(e,ie.fromElements(t.x,t.y,t.z,1,sAe),sAe);return co.worldToWindowCoordinates(n,o,i)};Wr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new Q);let i=n.modelMatrix,o=Wr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};Wr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,a=t.y-o,s=i,c=i;return l(n)||(n=new et),n.x=r,n.y=a,n.width=s,n.height=c,n};Wr.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&d.equals(this._position,e._position)&&U.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&U.equals(this._outlineColor,e._outlineColor)&&Ht.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._translucencyByDistance,e._translucencyByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Wr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ps=Wr;var o0=`in vec4 v_color;
|
|
in vec4 v_outlineColor;
|
|
in float v_innerPercent;
|
|
in float v_pixelDistance;
|
|
in vec4 v_pickColor;
|
|
in float v_splitDirection;
|
|
|
|
void main()
|
|
{
|
|
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
|
|
// The distance in UV space from this fragment to the center of the point, at most 0.5.
|
|
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
|
|
// The max distance stops one pixel shy of the edge to leave space for anti-aliasing.
|
|
float maxDistance = max(0.0, 0.5 - v_pixelDistance);
|
|
float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
|
|
float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);
|
|
|
|
vec4 color = mix(v_outlineColor, v_color, innerAlpha);
|
|
color.a *= wholeAlpha;
|
|
|
|
// Fully transparent parts of the billboard are not pickable.
|
|
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
|
|
if (color.a < 0.005) // matches 0/255 and 1/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
// The billboard is rendered twice. The opaque pass discards translucent fragments
|
|
// and the translucent pass discards opaque fragments.
|
|
#ifdef OPAQUE
|
|
if (color.a < 0.995) // matches < 254/255
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
if (color.a >= 0.995) // matches 254/255 and 255/255
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var OU=`uniform float u_maxTotalPointSize;
|
|
|
|
in vec4 positionHighAndSize;
|
|
in vec4 positionLowAndOutline;
|
|
in vec4 compressedAttribute0; // color, outlineColor, pick color
|
|
in vec4 compressedAttribute1; // show, translucency by distance, some free space
|
|
in vec4 scaleByDistance; // near, nearScale, far, farScale
|
|
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection; // near, far, disableDepthTestDistance, splitDirection
|
|
|
|
out vec4 v_color;
|
|
out vec4 v_outlineColor;
|
|
out float v_innerPercent;
|
|
out float v_pixelDistance;
|
|
out vec4 v_pickColor;
|
|
out float v_splitDirection;
|
|
|
|
const float SHIFT_LEFT8 = 256.0;
|
|
const float SHIFT_RIGHT8 = 1.0 / 256.0;
|
|
|
|
void main()
|
|
{
|
|
// Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition
|
|
|
|
// unpack attributes
|
|
vec3 positionHigh = positionHighAndSize.xyz;
|
|
vec3 positionLow = positionLowAndOutline.xyz;
|
|
float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
|
|
float totalSize = positionHighAndSize.w + outlineWidthBothSides;
|
|
float outlinePercent = outlineWidthBothSides / totalSize;
|
|
// Scale in response to browser-zoom.
|
|
totalSize *= czm_pixelRatio;
|
|
|
|
float temp = compressedAttribute1.x * SHIFT_RIGHT8;
|
|
float show = floor(temp);
|
|
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
vec4 translucencyByDistance;
|
|
translucencyByDistance.x = compressedAttribute1.z;
|
|
translucencyByDistance.z = compressedAttribute1.w;
|
|
|
|
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
|
|
|
|
temp = compressedAttribute1.y * SHIFT_RIGHT8;
|
|
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
|
|
#endif
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
vec4 color = czm_decodeRGB8(compressedAttribute0.x);
|
|
vec4 outlineColor = czm_decodeRGB8(compressedAttribute0.y);
|
|
vec4 pickColor = czm_decodeRGB8(compressedAttribute0.z);
|
|
vec4 alphaPacked = czm_decodeRGB8(compressedAttribute0.w);
|
|
|
|
color.a = alphaPacked.x;
|
|
outlineColor.a = alphaPacked.y;
|
|
pickColor.a = alphaPacked.z;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
|
|
///////////////////////////////////////////////////////////////////////////
|
|
|
|
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
|
|
float lengthSq;
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
{
|
|
// 2D camera distance is a special case
|
|
// treat all billboards as flattened to the z=0.0 plane
|
|
lengthSq = czm_eyeHeight2D.y;
|
|
}
|
|
else
|
|
{
|
|
lengthSq = dot(positionEC.xyz, positionEC.xyz);
|
|
}
|
|
#endif
|
|
|
|
#ifdef EYE_DISTANCE_SCALING
|
|
totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
|
|
#endif
|
|
if (totalSize > 0.0) {
|
|
// Add padding for anti-aliasing on both sides.
|
|
totalSize += 3.0;
|
|
}
|
|
|
|
// Clamp to max point size.
|
|
totalSize = min(totalSize, u_maxTotalPointSize);
|
|
// If size is too small, push vertex behind near plane for clipping.
|
|
// Note that context.minimumAliasedPointSize "will be at most 1.0".
|
|
if (totalSize < 1.0)
|
|
{
|
|
positionEC.xyz = vec3(0.0);
|
|
totalSize = 1.0;
|
|
}
|
|
|
|
float translucency = 1.0;
|
|
#ifdef EYE_DISTANCE_TRANSLUCENCY
|
|
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
|
|
// push vertex behind near plane for clipping
|
|
if (translucency < 0.004)
|
|
{
|
|
positionEC.xyz = vec3(0.0);
|
|
}
|
|
#endif
|
|
|
|
#ifdef DISTANCE_DISPLAY_CONDITION
|
|
float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
|
|
float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
|
|
if (lengthSq < nearSq || lengthSq > farSq) {
|
|
// push vertex behind camera to force it to be clipped
|
|
positionEC.xyz = vec3(0.0, 0.0, 1.0);
|
|
}
|
|
#endif
|
|
|
|
gl_Position = czm_projection * positionEC;
|
|
czm_vertexLogDepth();
|
|
|
|
#ifdef DISABLE_DEPTH_DISTANCE
|
|
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
|
|
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
|
|
{
|
|
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
|
|
}
|
|
|
|
if (disableDepthTestDistance != 0.0)
|
|
{
|
|
// Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w.
|
|
float zclip = gl_Position.z / gl_Position.w;
|
|
bool clipped = (zclip < -1.0 || zclip > 1.0);
|
|
if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
|
|
{
|
|
// Position z on the near plane.
|
|
gl_Position.z = -gl_Position.w;
|
|
#ifdef LOG_DEPTH
|
|
czm_vertexLogDepth(vec4(czm_currentFrustum.x));
|
|
#endif
|
|
}
|
|
}
|
|
#endif
|
|
|
|
v_color = color;
|
|
v_color.a *= translucency * show;
|
|
v_outlineColor = outlineColor;
|
|
v_outlineColor.a *= translucency * show;
|
|
|
|
v_innerPercent = 1.0 - outlinePercent;
|
|
v_pixelDistance = 2.0 / totalSize;
|
|
gl_PointSize = totalSize * show;
|
|
gl_Position *= show;
|
|
|
|
v_pickColor = pickColor;
|
|
v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
|
|
}
|
|
`;var Brt=Ps.SHOW_INDEX,FX=Ps.POSITION_INDEX,lAe=Ps.COLOR_INDEX,Drt=Ps.OUTLINE_COLOR_INDEX,vrt=Ps.OUTLINE_WIDTH_INDEX,Prt=Ps.PIXEL_SIZE_INDEX,uAe=Ps.SCALE_BY_DISTANCE_INDEX,fAe=Ps.TRANSLUCENCY_BY_DISTANCE_INDEX,dAe=Ps.DISTANCE_DISPLAY_CONDITION_INDEX,Rrt=Ps.DISABLE_DEPTH_DISTANCE_INDEX,Mrt=Ps.SPLIT_DIRECTION_INDEX,QX=Ps.NUMBER_OF_PROPERTIES,Yc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function bd(e){e=e??V.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(QX),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??nr.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW,Re.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(bd.prototype,{length:{get:function(){return kX(this),this._pointPrimitives.length}}});function hAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}bd.prototype.add=function(e){let t=new Ps(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};bd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};bd.prototype.removeAll=function(){hAe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function kX(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 a=n[o];a&&(a._index=r++,t.push(a))}e._pointPrimitives=t}}bd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};bd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};bd.prototype.get=function(e){return kX(this),this._pointPrimitives[e]};bd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<QX;++i){let o=n[i]===0?Re.STATIC_DRAW:Re.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Nrt(e,t,n){return new Zg(e,[{index:Yc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[FX]},{index:Yc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[FX]},{index:Yc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[lAe]},{index:Yc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[fAe]},{index:Yc.scaleByDistance,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[uAe]},{index:Yc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:n[dAe]}],t)}var LX=new xn,FU=new U;function mAe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),xn.fromCartesian(r,LX);let a=i.pixelSize,s=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,a+s);let c=n[Yc.positionHighAndSize],u=LX.high;c(o,u.x,u.y,u.z,a);let f=n[Yc.positionLowAndOutline],h=LX.low;f(o,h.x,h.y,h.z,s)}var Lrt=256;function pAe(e,t,n,i){let o=i._index,r=i.color,a=i.outlineColor,s=i.getPickId(t).color;FU.red=r.alpha,FU.green=a.alpha,FU.blue=s.alpha;let c=n[Yc.compressedAttribute0];c(o,tn.encodeRGB8(r),tn.encodeRGB8(a),tn.encodeRGB8(s),tn.encodeRGB8(FU))}function AAe(e,t,n,i){let o=i._index,r=0,a=1,s=1,c=1,u=i.translucencyByDistance;l(u)&&(r=u.near,a=u.nearValue,s=u.far,c=u.farValue,(a!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),a=D.clamp(a,0,1),a=a===1?255:a*255|0;let h=(f?1:0)*Lrt+a;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,A=n[Yc.compressedAttribute1];A(o,h,p,r,s)}function gAe(e,t,n,i){let o=i._index,r=n[Yc.scaleByDistance],a=0,s=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(a=f.near,s=f.nearValue,c=f.far,u=f.farValue,(s!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,a,s,c,u)}function _Ae(e,t,n,i){let o=i._index,r=n[Yc.distanceDisplayConditionAndDisableDepthAndSplitDirection],a=0,s=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(a=c.near,s=c.far,a*=a,s*=s,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;l(h)&&(f=h),r(o,a,s,u,f)}function Ort(e,t,n,i){mAe(e,t,n,i),pAe(e,t,n,i),AAe(e,t,n,i),gAe(e,t,n,i),_Ae(e,t,n,i)}function OX(e,t,n,i,o,r){let a;i.mode===oe.SCENE3D?(a=e._baseVolume,e._boundingVolumeDirty=!0):a=e._baseVolume2D;let s=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,h=Ps._computeActualPosition(f,i,o);l(h)&&(u._setActualPosition(h),r?s.push(h):le.expand(a,h,a))}r&&le.fromPoints(s,a)}function Frt(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!P.equals(r,e.modelMatrix)?(e._mode=n,P.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&OX(e,i,i.length,t,r,!0)):n===oe.MORPHING?OX(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&OX(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function Qrt(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var krt=[];bd.prototype.update=function(e){if(kX(this),!this.show)return;this._maxTotalPointSize=Nt.maximumAliasedPointSize,Frt(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,a=this._createVertexArray,s,c=e.context,u=e.passes,f=u.pick;if(a||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let S=0;S<QX;++S)r[S]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=Nrt(c,n,this._buffersUsage),s=this._vaf.writers;for(let S=0;S<n;++S){let w=this._pointPrimitives[S];w._dirty=!1,Ort(this,c,s,w)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let S=krt;S.length=0,(r[FX]||r[vrt]||r[Prt])&&S.push(mAe),(r[lAe]||r[Drt])&&S.push(pAe),(r[Brt]||r[fAe])&&S.push(AAe),r[uAe]&&S.push(gAe),(r[dAe]||r[Rrt]||r[Mrt])&&S.push(_Ae);let w=S.length;if(s=this._vaf.writers,o/n>.1){for(let v=0;v<o;++v){let R=i[v];R._dirty=!1;for(let N=0;N<w;++N)S[N](this,c,s,R)}this._vaf.commit()}else{for(let v=0;v<o;++v){let R=i[v];R._dirty=!1;for(let N=0;N<w;++N)S[N](this,c,s,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=P.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),Qrt(this,e,h);let A=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,A&&(this._blendOption===nr.OPAQUE||this._blendOption===nr.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ve.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===nr.TRANSLUCENT||this._blendOption===nr.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ve.fromCache({depthTest:{enabled:!0,func:ee.LEQUAL},depthMask:!1,blending:sn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,_;(A||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new We({sources:[OU]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===nr.OPAQUE_AND_TRANSLUCENT&&(_=new We({defines:["OPAQUE"],sources:[o0]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:Yc}),_=new We({defines:["TRANSLUCENT"],sources:[o0]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:Yc})),this._blendOption===nr.OPAQUE&&(_=new We({sources:[o0]}),this._sp=$t.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:Yc})),this._blendOption===nr.TRANSLUCENT&&(_=new We({sources:[o0]}),this._spTranslucent=$t.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:_,attributeLocations:Yc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let y,C,E,I,x=e.commandList;if(u.render||f){let S=this._colorCommands,w=this._blendOption===nr.OPAQUE,v=this._blendOption===nr.OPAQUE_AND_TRANSLUCENT;y=this._vaf.va,C=y.length,S.length=C;let R=v?C*2:C;for(I=0;I<R;++I){let N=w||v&&I%2===0;E=S[I],l(E)||(E=S[I]=new it),E.primitiveType=Pe.POINTS,E.pass=N||!v?Be.OPAQUE:Be.TRANSLUCENT,E.owner=this;let L=v?Math.floor(I/2):I;E.boundingVolume=h,E.modelMatrix=p,E.shaderProgram=N?this._sp:this._spTranslucent,E.uniformMap=this._uniforms,E.vertexArray=y[L].va,E.renderState=N?this._rsOpaque:this._rsTranslucent,E.debugShowBoundingVolume=this.debugShowBoundingVolume,E.pickId="v_pickColor",x.push(E)}}};bd.prototype.isDestroyed=function(){return!1};bd.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(),hAe(this._pointPrimitives),fe(this)};var Av=bd;function Rh(e){e=e??V.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new _e,this.show=e.show??!0}function yAe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var Urt=new et;function CAe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=FE.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=Ro.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ps.getScreenSpaceBoundingBox(e,t,o)),yAe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&IAe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,a=i._labelCollection.get(r),s=FE.getScreenSpaceBoundingBox(a,t,Urt);yAe(s,n),o=et.union(o,s,o)}return o}function zrt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&IAe(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function EAe(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 IAe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function UX(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let a=0;a<r;++a){let s=e.get(a);if(s.clusterShow=!1,!s.show||o._scene.mode===oe.SCENE3D&&!i.isPointVisible(s.position))continue;let c=o._clusterLabels&&l(s._labelCollection),u=o._clusterBillboards&&l(s.id._billboard),f=o._clusterPoints&&l(s.id._point);if(c&&(f||u))continue;let h=s.computeScreenSpacePosition(n);l(h)&&t.push({index:a,collection:e,clustered:!1,coord:h})}}var Grt=new et,Vrt=new et,Hrt=new et;function Wrt(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let a=e._clusterLabelCollection,s=e._clusterBillboardCollection,c=e._clusterPointCollection;l(a)?a.removeAll():a=e._clusterLabelCollection=new NA({scene:n}),l(s)?s.removeAll():s=e._clusterBillboardCollection=new fd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new Av;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],A=e._previousHeight,m=n.camera.positionCartographic.height,_=n.ellipsoid,y=n.camera.positionWC,C=new dp(_,y),E=[];e._clusterLabels&&UX(i,E,n,C,e),e._clusterBillboards&&UX(o,E,n,C,e),e._clusterPoints&&UX(r,E,n,C,e);let I,x,S,w,v,R,N,L,g,b,T,B;if(E.length>0){let M=new wC(E.length,64,Float64Array);for(let O=0;O<E.length;++O)M.add(E[O].coord.x,E[O].coord.y);if(M.finish(),m<A)for(S=h.length,I=0;I<S;++I){let O=h[I];if(!C.isPointVisible(O.position))continue;let G=Ro._computeScreenSpacePosition(P.IDENTITY,O.position,d.ZERO,Q.ZERO,n);if(!l(G))continue;let k=1-m/A,z=O.width=O.width*k,F=O.height=O.height*k;z=Math.max(z,O.minimumWidth),F=Math.max(F,O.minimumHeight);let H=G.x-z*.5,Y=G.y-F*.5,$=G.x+z,W=G.y+F;for(v=M.range(H,Y,$,W),R=v.length,b=0,g=[],x=0;x<R;++x)N=v[x],L=E[N],L.clustered||(++b,T=L.collection,B=L.index,g.push(T.get(B).id));if(b>=f)for(EAe(O.position,b,g,e),p.push(O),x=0;x<R;++x)E[v[x]].clustered=!0}for(S=E.length,I=0;I<S;++I){let O=E[I];if(O.clustered)continue;O.clustered=!0,T=O.collection,B=O.index;let G=T.get(B);w=CAe(G,O.coord,u,e,Grt);let k=et.clone(w,Vrt);v=M.range(w.x,w.y,w.x+w.width,w.y+w.height),R=v.length;let z=d.clone(G.position);for(b=1,g=[G.id],x=0;x<R;++x)if(N=v[x],L=E[N],!L.clustered){let F=L.collection.get(L.index),H=CAe(F,L.coord,u,e,Hrt);d.add(F.position,z,z),et.union(k,H,k),++b,g.push(F.id)}if(b>=f){let F=d.multiplyByScalar(z,1/b,z);for(EAe(F,b,g,e),p.push({position:F,width:k.width,height:k.height,minimumWidth:w.width,minimumHeight:w.height}),x=0;x<R;++x)E[v[x]].clustered=!0}else zrt(G,e)}}a.length===0&&(a.destroy(),e._clusterLabelCollection=void 0),s.length===0&&(s.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Rh.prototype._initialize=function(e){this._scene=e;let t=Wrt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Rh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function GX(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let a=this._collectionIndicesByEntity[o.id];if(l(a)||(a=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(a[i]))return r.get(a[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let s,c,u=this[n];u.length>0?(s=u.shift(),c=r.get(s)):(c=r.add(),s=r.length-1),a[i]=s;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function VX(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Rh.prototype.getLabel=GX("_labelCollection",NA,"_unusedLabelIndices","labelIndex");Rh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,VX(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};Rh.prototype.getBillboard=GX("_billboardCollection",fd,"_unusedBillboardIndices","billboardIndex");Rh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,VX(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};Rh.prototype.getPoint=GX("_pointCollection",Av,"_unusedPointIndices","pointIndex");Rh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,VX(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function zX(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function jrt(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,zX(e._labelCollection),zX(e._billboardCollection),zX(e._pointCollection))}Rh.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,jrt(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Rh.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var xd=Rh;function HX(e){this._name=e,this._clock=void 0,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new $s(this),this._entityCluster=new xd}Object.defineProperties(HX.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){Da.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});HX.prototype.update=function(e){return!0};var QU=HX;var bAe={};bAe.computePositions=function(e,t,n,i,o){let r=e*.5,a=-r,s=i+i,c=o?2*s:s,u=new Float64Array(c*3),f,h=0,p=0,A=o?s*3:0,m=o?(s+i)*3:i*3;for(f=0;f<i;f++){let _=f/i*D.TWO_PI,y=Math.cos(_),C=Math.sin(_),E=y*n,I=C*n,x=y*t,S=C*t;u[p+A]=E,u[p+A+1]=I,u[p+A+2]=a,u[p+m]=x,u[p+m+1]=S,u[p+m+2]=r,p+=3,o&&(u[h++]=E,u[h++]=I,u[h++]=a,u[h++]=x,u[h++]=S,u[h++]=r)}return u};var iT=bAe;var WX=new Q,Yrt=new d,qrt=new d,Krt=new d,Xrt=new d;function $A(e){e=e??V.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??ke.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=ke.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}$A.packedLength=ke.packedLength+5;$A.pack=function(e,t,n){return n=n??0,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var xAe=new ke,oT={vertexFormat:xAe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};$A.unpack=function(e,t,n){t=t??0;let i=ke.unpack(e,t,xAe);t+=ke.packedLength;let o=e[t++],r=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._vertexFormat=ke.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=a,n._slices=s,n._offsetAttribute=c===-1?void 0:c,n):(oT.length=o,oT.topRadius=r,oT.bottomRadius=a,oT.slices=s,oT.offsetAttribute=c===-1?void 0:c,new $A(oT))};$A.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 a=r+r,s=r+a,c=a+a,u=iT.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(c*2):void 0,h=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,A=o.bitangent?new Float32Array(c*3):void 0,m,_=o.normal||o.tangent||o.bitangent;if(_){let v=o.tangent||o.bitangent,R=0,N=0,L=0,g=Math.atan2(i-n,t),b=Yrt;b.z=Math.sin(g);let T=Math.cos(g),B=Krt,M=qrt;for(m=0;m<r;m++){let O=m/r*D.TWO_PI,G=T*Math.cos(O),k=T*Math.sin(O);_&&(b.x=G,b.y=k,v&&(B=d.normalize(d.cross(d.UNIT_Z,b,B),B)),o.normal&&(h[R++]=b.x,h[R++]=b.y,h[R++]=b.z,h[R++]=b.x,h[R++]=b.y,h[R++]=b.z),o.tangent&&(p[N++]=B.x,p[N++]=B.y,p[N++]=B.z,p[N++]=B.x,p[N++]=B.y,p[N++]=B.z),o.bitangent&&(M=d.normalize(d.cross(b,B,M),M),A[L++]=M.x,A[L++]=M.y,A[L++]=M.z,A[L++]=M.x,A[L++]=M.y,A[L++]=M.z))}for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=-1),o.tangent&&(p[N++]=1,p[N++]=0,p[N++]=0),o.bitangent&&(A[L++]=0,A[L++]=-1,A[L++]=0);for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=1),o.tangent&&(p[N++]=1,p[N++]=0,p[N++]=0),o.bitangent&&(A[L++]=0,A[L++]=1,A[L++]=0)}let y=12*r-12,C=Ue.createTypedArray(c,y),E=0,I=0;for(m=0;m<r-1;m++)C[E++]=I,C[E++]=I+2,C[E++]=I+3,C[E++]=I,C[E++]=I+3,C[E++]=I+1,I+=2;for(C[E++]=a-2,C[E++]=0,C[E++]=1,C[E++]=a-2,C[E++]=1,C[E++]=a-1,m=1;m<r-1;m++)C[E++]=a+m+1,C[E++]=a+m,C[E++]=a;for(m=1;m<r-1;m++)C[E++]=s,C[E++]=s+m,C[E++]=s+m+1;let x=0;if(o.st){let v=Math.max(n,i);for(m=0;m<c;m++){let R=d.fromArray(u,m*3,Xrt);f[x++]=(R.x+v)/(2*v),f[x++]=(R.y+v)/(2*v)}}let S=new En;o.position&&(S.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(S.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(S.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(S.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),o.st&&(S.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:f})),WX.x=t*.5,WX.y=Math.max(i,n);let w=new le(d.ZERO,Q.magnitude(WX));if(l(e._offsetAttribute)){t=u.length;let v=e._offsetAttribute===mn.NONE?0:1,R=new Uint8Array(t/3).fill(v);S.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new yt({attributes:S,indices:C,primitiveType:Pe.TRIANGLES,boundingSphere:w,offsetAttribute:e._offsetAttribute})};var jX;$A.getUnitCylinder=function(){return l(jX)||(jX=$A.createGeometry(new $A({topRadius:1,bottomRadius:1,length:1,vertexFormat:ke.POSITION_ONLY}))),jX};var kU=$A;var YX=new Q;function rT(e){e=e??V.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}rT.packedLength=6;rT.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var r0={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};rT.unpack=function(e,t,n){t=t??0;let i=e[t++],o=e[t++],r=e[t++],a=e[t++],s=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=a,n._numberOfVerticalLines=s,n._offsetAttribute=c===-1?void 0:c,n):(r0.length=i,r0.topRadius=o,r0.bottomRadius=r,r0.slices=a,r0.numberOfVerticalLines=s,r0.offsetAttribute=c===-1?void 0:c,new rT(r0))};rT.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 a=o*2,s=iT.computePositions(t,n,i,o,!1),c=o*2,u;if(r>0){let _=Math.min(r,o);u=Math.round(o/_),c+=_}let f=Ue.createTypedArray(a,c*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let A=new En;A.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:s}),YX.x=t*.5,YX.y=Math.max(i,n);let m=new le(d.ZERO,Q.magnitude(YX));if(l(e._offsetAttribute)){t=s.length;let _=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(t/3).fill(_);A.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}return new yt({attributes:A,indices:f,primitiveType:Pe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var UU=rT;var TAe=d.ZERO,SAe=new d,Jrt=new d,wAe=new U;function Zrt(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 af(e,t){Ti.call(this,{entity:e,scene:t,geometryOptions:new Zrt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(af.prototype=Object.create(Ti.prototype),af.prototype.constructor=af);Object.defineProperties(af.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});af.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=$n.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,wAe)),l(s)||(s=U.WHITE),a.color=Jt.fromColor(s)}return l(this._options.offsetAttribute)&&(a.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,TAe,SAe))),new Lt({id:t,geometry:new kU(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:a})};af.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,wAe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,TAe,SAe))),new Lt({id:t,geometry:new UU(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};af.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};af.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Ti.prototype._isHidden.call(this,e,t)};af.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!q.isConstant(t.slices)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)};af.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ze.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ze.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ze.MINIMUM_VALUE),i.slices=q.getValueOrUndefined(t.slices,Ze.MINIMUM_VALUE),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Ze.MINIMUM_VALUE),i.offsetAttribute=n!==ot.NONE?mn.ALL:void 0};af.prototype._onEntityPropertyChanged=l_;af.DynamicGeometryUpdater=aT;function aT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(aT.prototype=Object.create(xi.prototype),aT.prototype.constructor=aT);aT.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,Jrt);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||xi.prototype._isHidden.call(this,e,t,n)};aT.prototype._setOptions=function(e,t,n){let i=q.getValueOrDefault(t.heightReference,n,ot.NONE),o=this._options;o.length=q.getValueOrUndefined(t.length,n),o.topRadius=q.getValueOrUndefined(t.topRadius,n),o.bottomRadius=q.getValueOrUndefined(t.bottomRadius,n),o.slices=q.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==ot.NONE?mn.ALL:void 0};var zU=af;var $rt={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},va=Object.freeze($rt);var eat={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},Qo=Object.freeze(eat);var tat={NONE:0,HOLD:1,EXTRAPOLATE:2},Td=Object.freeze(tat);var BAe=Na(Fu(),1);function nat(e){let t=new BAe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Cy=nat;var iat=D.factorial;function qX(e,t,n,i,o,r){let a=0,s,c,u;if(i>0){for(c=0;c<o;c++){for(s=!1,u=0;u<r.length&&!s;u++)c===r[u]&&(s=!0);s||(r.push(c),a+=qX(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return a}for(a=1,c=0;c<o;c++){for(s=!1,u=0;u<r.length&&!s;u++)c===r[u]&&(s=!0);s||(a*=e-n[t[c]])}return a}var GU={type:"Hermite"};GU.getRequiredDataPoints=function(e,t){return t=t??0,Math.max(Math.floor((e+1)/(t+1)),2)};GU.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s,c,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let y=new Array(h);for(p[r]=y,a=0;a<h;a++)y[a]=[]}let A=h,m=new Array(A);for(r=0;r<A;r++)m[r]=r;let _=h-1;for(c=0;c<i;c++){for(a=0;a<A;a++)f=m[a]*i+c,p[c][0].push(n[f]);for(r=1;r<A;r++){let y=!1;for(a=0;a<A-r;a++){let C=t[m[a]],E=t[m[a+r]],I;E-C<=0?(f=m[a]*i+i*r+c,I=n[f],p[c][r].push(I/iat(r))):(I=p[c][r-1][a+1]-p[c][r-1][a],p[c][r].push(I/(E-C))),y=y||I!==0}y||(_=r-1)}}for(s=0,u=0;s<=u;s++)for(r=s;r<=_;r++){let y=qX(e,m,t,s,r,[]);for(c=0;c<i;c++){let C=p[c][r][0];o[c+s*i]+=C*y}}return o};var oat=[];GU.interpolate=function(e,t,n,i,o,r,a){let s=i*(r+1);l(a)||(a=new Array(s));for(let C=0;C<s;C++)a[C]=0;let c=t.length,u=new Array(c*(o+1)),f;for(f=0;f<c;f++)for(let C=0;C<o+1;C++)u[f*(o+1)+C]=f;let h=u.length,p=oat,A=rat(p,u,t,n,i,o),m=[],_=h*(h+1)/2,y=Math.min(A,r);for(let C=0;C<=y;C++)for(f=C;f<=A;f++){m.length=0;let E=qX(e,u,t,C,f,m),I=Math.floor(f*(1-f)/2)+h*f;for(let x=0;x<i;x++){let S=Math.floor(x*_),w=p[S+I];a[x+C*i]+=w*E}}return a};function rat(e,t,n,i,o,r){let a,s,c=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(a=0;a<u;a++)s=t[a]*o*(r+1)+h,e[p+a]=i[s];for(let A=1;A<u;A++){let m=0,_=Math.floor(A*(1-A)/2)+u*A,y=!1;for(a=0;a<u-A;a++){let C=n[t[a]],E=n[t[a+A]],I,x;if(E-C<=0)s=t[a]*o*(r+1)+o*A+h,I=i[s],x=I/D.factorial(A),e[p+_+m]=x,m++;else{let S=Math.floor((A-1)*(2-A)/2)+u*(A-1);I=e[p+S+a+1]-e[p+S+a],x=I/(E-C),e[p+_+m]=x,m++}y=y||I!==0}y&&(c=Math.max(c,A))}}return c}var VU=GU;var KX={type:"Lagrange"};KX.getRequiredDataPoints=function(e){return Math.max(e+1,2)};KX.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<s;r++){let c=1;for(a=0;a<s;a++)if(a!==r){let u=t[r]-t[a];c*=(e-t[a])/u}for(a=0;a<i;a++)o[a]+=c*n[r*i+a]}return o};var HU=KX;var XX={type:"Linear"};XX.getRequiredDataPoints=function(e){return 2};XX.interpolateOrderZero=function(e,t,n,i,o){l(o)||(o=new Array(i));let r,a,s,c=t[0],u=t[1];for(r=0;r<i;r++)a=n[r],s=n[r+i],o[r]=((s-a)*e+u*a-c*s)/(u-c);return o};var sT=XX;function qc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}qc.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new qc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};qc.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new qc(e.clock,e.cone,e.magnitude)};qc.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new qc(e.clock,e.cone,1)};qc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};qc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};qc.prototype.equals=function(e){return qc.equals(this,e)};qc.prototype.clone=function(e){return qc.clone(this,e)};qc.prototype.equalsEpsilon=function(e,t){return qc.equalsEpsilon(this,e,t)};qc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var WU=qc;var wv=Na(Fu(),1);var JX;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?JX=function(){return performance.now()}:JX=function(){return Date.now()};var ki=JX;function ZX(e){e=e??V.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=X.clone(t):l(n)?t=X.clone(n):l(i)?t=X.addDays(i,-1,new X):t=X.now(),l(n)?n=X.clone(n):n=X.clone(t),l(i)?i=X.clone(i):i=X.addDays(n,1,new X),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??va.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new _e,this.onStop=new _e,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=ki(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Qo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(ZX.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){X.equals(this._currentTime,e)||(this._clockStep===Qo.SYSTEM_CLOCK&&(this._clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Qo.SYSTEM_CLOCK&&(this._clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Qo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=X.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Qo.SYSTEM_CLOCK&&(this._clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});ZX.prototype.tick=function(){let e=ki(),t=X.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Qo.SYSTEM_CLOCK)t=X.now(t);else{let i=this._multiplier;if(n===Qo.TICK_DEPENDENT)t=X.addSeconds(t,i,t);else{let s=e-this._lastSystemTime;t=X.addSeconds(t,i*(s/1e3),t)}let o=this.clockRange,r=this.startTime,a=this.stopTime;if(o===va.CLAMPED)X.lessThan(t,r)?t=X.clone(r,t):X.greaterThan(t,a)&&(t=X.clone(a,t),this.onStop.raiseEvent(this));else if(o===va.LOOP_STOP)for(X.lessThan(t,r)&&(t=X.clone(r,t));X.greaterThan(t,a);)t=X.addSeconds(r,X.secondsDifference(t,a),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var hp=ZX;function a0(){this._definitionChanged=new _e,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(a0.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:tu("startTime"),stopTime:tu("stopTime"),currentTime:tu("currentTime"),clockRange:tu("clockRange"),clockStep:tu("clockStep"),multiplier:tu("multiplier")});a0.prototype.clone=function(e){return l(e)||(e=new a0),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};a0.prototype.equals=function(e){return this===e||l(e)&&X.equals(this.startTime,e.startTime)&&X.equals(this.stopTime,e.stopTime)&&X.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};a0.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};a0.prototype.getValue=function(e){return l(e)||(e=new hp),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 mp=a0;var aat=U.WHITE,sat=.1,cat=new Q(8,8),lat=new Q(0,0),uat=new Q(1,1);function cT(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(cT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._cellAlpha)&&q.isConstant(this._lineCount)&&q.isConstant(this._lineThickness)&&q.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),cellAlpha:Ae("cellAlpha"),lineCount:Ae("lineCount"),lineThickness:Ae("lineThickness"),lineOffset:Ae("lineOffset")});cT.prototype.getType=function(e){return"Grid"};var fat=new X;cT.prototype.getValue=function(e,t){return l(e)||(e=X.now(fat)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,aat,t.color),t.cellAlpha=q.getValueOrDefault(this._cellAlpha,e,sat),t.lineCount=q.getValueOrClonedDefault(this._lineCount,e,cat,t.lineCount),t.lineThickness=q.getValueOrClonedDefault(this._lineThickness,e,uat,t.lineThickness),t.lineOffset=q.getValueOrClonedDefault(this._lineOffset,e,lat,t.lineOffset),t};cT.prototype.equals=function(e){return this===e||e instanceof cT&&q.equals(this._color,e._color)&&q.equals(this._cellAlpha,e._cellAlpha)&&q.equals(this._lineCount,e._lineCount)&&q.equals(this._lineThickness,e._lineThickness)&&q.equals(this._lineOffset,e._lineOffset)};var gv=cT;function lT(e){this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(lT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color")});lT.prototype.getType=function(e){return"PolylineArrow"};var dat=new X;lT.prototype.getValue=function(e,t){return l(e)||(e=X.now(dat)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};lT.prototype.equals=function(e){return this===e||e instanceof lT&&q.equals(this._color,e._color)};var _v=lT;var hat=U.WHITE,mat=U.TRANSPARENT,pat=16,Aat=255;function uT(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(uT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._gapColor)&&q.isConstant(this._dashLength)&&q.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),gapColor:Ae("gapColor"),dashLength:Ae("dashLength"),dashPattern:Ae("dashPattern")});uT.prototype.getType=function(e){return"PolylineDash"};var gat=new X;uT.prototype.getValue=function(e,t){return l(e)||(e=X.now(gat)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,hat,t.color),t.gapColor=q.getValueOrClonedDefault(this._gapColor,e,mat,t.gapColor),t.dashLength=q.getValueOrDefault(this._dashLength,e,pat,t.dashLength),t.dashPattern=q.getValueOrDefault(this._dashPattern,e,Aat,t.dashPattern),t};uT.prototype.equals=function(e){return this===e||e instanceof uT&&q.equals(this._color,e._color)&&q.equals(this._gapColor,e._gapColor)&&q.equals(this._dashLength,e._dashLength)&&q.equals(this._dashPattern,e._dashPattern)};var yv=uT;var _at=U.WHITE,yat=.25,Cat=1;function fT(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(fT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),glowPower:Ae("glowPower"),taperPower:Ae("taperPower")});fT.prototype.getType=function(e){return"PolylineGlow"};var Eat=new X;fT.prototype.getValue=function(e,t){return l(e)||(e=X.now(Eat)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,_at,t.color),t.glowPower=q.getValueOrDefault(this._glowPower,e,yat,t.glowPower),t.taperPower=q.getValueOrDefault(this._taperPower,e,Cat,t.taperPower),t};fT.prototype.equals=function(e){return this===e||e instanceof fT&&q.equals(this._color,e._color)&&q.equals(this._glowPower,e._glowPower)&&q.equals(this._taperPower,e._taperPower)};var Cv=fT;var Iat=U.WHITE,bat=U.BLACK,xat=1;function dT(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(dT.prototype,{isConstant:{get:function(){return q.isConstant(this._color)&&q.isConstant(this._outlineColor)&&q.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Ae("color"),outlineColor:Ae("outlineColor"),outlineWidth:Ae("outlineWidth")});dT.prototype.getType=function(e){return"PolylineOutline"};var Tat=new X;dT.prototype.getValue=function(e,t){return l(e)||(e=X.now(Tat)),l(t)||(t={}),t.color=q.getValueOrClonedDefault(this._color,e,Iat,t.color),t.outlineColor=q.getValueOrClonedDefault(this._outlineColor,e,bat,t.outlineColor),t.outlineWidth=q.getValueOrDefault(this._outlineWidth,e,xat),t};dT.prototype.equals=function(e){return this===e||e instanceof dT&&q.equals(this._color,e._color)&&q.equals(this._outlineColor,e._outlineColor)&&q.equals(this._outlineWidth,e._outlineWidth)};var s0=dT;function eg(e,t){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Hr,this._referenceFrame=t??Oi.FIXED,this.setValue(e)}Object.defineProperties(eg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Sat=new X;eg.prototype.getValue=function(e,t){return l(e)||(e=X.now(Sat)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};eg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,a=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[a]=c,a++),r++}return n.length=a,n};eg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,eg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};eg.prototype.equals=function(e){return this===e||e instanceof eg&&this._referenceFrame===e._referenceFrame&&q.arrayEquals(this._value,e._value)};eg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ey=eg;function Iy(e){this._value=void 0,this._definitionChanged=new _e,this._eventHelper=new Hr,this.setValue(e)}Object.defineProperties(Iy.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!q.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var wat=new X;Iy.prototype.getValue=function(e,t){l(e)||(e=X.now(wat));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let s=this._value[o].getValue(e,t[o]);l(s)&&(t[r]=s,r++),o++}return t.length=r,t};Iy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Iy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Iy.prototype.equals=function(e){return this===e||e instanceof Iy&&q.arrayEquals(this._value,e._value)};Iy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ev=Iy;function c0(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(sf.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function sf(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new _e,e.collectionChanged.addEventListener(sf.prototype._onCollectionChanged,this)}Object.defineProperties(sf.prototype,{isConstant:{get:function(){return q.isConstant(c0(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=c0(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return c0(this)}}});sf.fromString=function(e,t){let n,i=[],o=!0,r=!1,a="";for(let s=0;s<t.length;++s){let c=t.charAt(s);r?(a+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=a,o=!1,a=""):!o&&c==="."?(i.push(a),a=""):a+=c}return i.push(a),new sf(e,n,i)};var Bat=new X;sf.prototype.getValue=function(e,t){let n=c0(this);return l(e)||(e=X.now(Bat)),l(n)?n.getValue(e,t):void 0};sf.prototype.getValueInReferenceFrame=function(e,t,n){let i=c0(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};sf.prototype.getType=function(e){let t=c0(this);return l(t)?t.getType(e):void 0};sf.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};sf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};sf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(sf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=c0(this),l(i)&&this._definitionChanged.raiseEvent(this))};var by=sf;var Dat={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,a=n-t+1;r<a;r++){let s=e[t+r];r===0||Math.abs(o-s)<Math.PI?i[r]=s:i[r]=s-D.TWO_PI,o=s}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+D.TWO_PI:o}},Mh=Dat;var DAe={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 vAe(e,t,n){let i,o=e.length,r=n.length,a=o+r;if(e.length=a,o!==t){let s=o-1;for(i=a-1;i>=t;i--)e[i]=e[s--]}for(i=0;i<r;i++)e[t++]=n[i]}function PAe(e,t){return e instanceof X?e:typeof e=="string"?X.fromIso8601(e):X.addSeconds(t,e,new X)}var $X=[],eJ=[];function jU(e,t,n,i,o){let r=0,a,s,c,u,f,h;for(;r<i.length;){f=PAe(i[r],e),c=Io(t,f,X.compare);let p=0,A=0;if(c<0){for(c=~c,u=c*o,s=void 0,h=t[c];r<i.length&&(f=PAe(i[r],e),!(l(s)&&X.compare(s,f)>=0||l(h)&&X.compare(f,h)>=0));){for($X[p++]=f,r=r+1,a=0;a<o;a++)eJ[A++]=i[r],r=r+1;s=f}p>0&&(eJ.length=A,vAe(n,u,eJ),$X.length=p,vAe(t,c,$X))}else{for(a=0;a<o;a++)r++,n[c*o+a]=i[r];r++}}}function Sd(e,t){let n=e;n===Number&&(n=DAe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,a;if(l(t)){let s=t.length;a=new Array(s);for(let c=0;c<s;c++){let u=t[c];u===Number&&(u=DAe);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,a[c]=u}r=s}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=sT,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new _e,this._derivativeTypes=t,this._innerDerivativeTypes=a,this._inputOrder=r,this._forwardExtrapolationType=Td.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Td.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Sd.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 vat=new X;Sd.prototype.getValue=function(e,t){l(e)||(e=X.now(vat));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,a=this._values,s=Io(n,e,X.compare);if(s<0){if(s=~s,s===0){let x=n[s];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Td.NONE||o!==0&&X.secondsDifference(x,e)>o)return;if(this._backwardExtrapolationType===Td.HOLD)return r.unpack(a,0,t)}if(s>=i){s=i-1;let x=n[s];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Td.NONE||o!==0&&X.secondsDifference(e,x)>o)return;if(this._forwardExtrapolationType===Td.HOLD)return s=i-1,r.unpack(a,s*r.packedLength,t)}let c=this._xTable,u=this._yTable,f=this._interpolationAlgorithm,h=this._packedInterpolationLength,p=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let x=Math.min(f.getRequiredDataPoints(this._interpolationDegree,p),i);x!==this._numberOfPoints&&(this._numberOfPoints=x,c.length=x,u.length=x*h)}let A=this._numberOfPoints-1;if(A<1)return;let m=0,_=i-1;if(_-m+1>=A+1){let x=s-(A/2|0)-1;x<m&&(x=m);let S=x+A;S>_&&(S=_,x=S-A,x<m&&(x=m)),m=x,_=S}let C=_-m+1;for(let x=0;x<C;++x)c[x]=X.secondsDifference(n[m+x],n[_]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(a,m,_,u);else{let x=0,S=this._packedLength,w=m*S,v=(_+1)*S;for(;w<v;)u[x]=a[w],w++,x++}let E=X.secondsDifference(e,n[_]),I;if(p===0||!l(f.interpolate))I=f.interpolateOrderZero(E,c,u,h,this._interpolationResult);else{let x=Math.floor(h/(p+1));I=f.interpolate(E,c,u,x,p,p,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(I,a,m,_,t):r.unpack(I,0,t)}return r.unpack(a,s*this._packedLength,t)};Sd.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Sd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,a=[];if(a.push(e),r.pack(t,a,a.length),o){let s=i.length;for(let c=0;c<s;c++)i[c].pack(n[c],a,a.length)}jU(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Sd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,a=e.length,s=[];for(let c=0;c<a;c++)if(s.push(e[c]),r.pack(t[c],s,s.length),o){let u=n[c],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],s,s.length)}jU(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Sd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Sd.prototype.addSamplesPackedArray=function(e,t){jU(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Sd.prototype.removeSample=function(e){let t=Io(this._times,e,X.compare);return t<0?!1:(RAe(this,t,1),!0)};function RAe(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)}Sd.prototype.removeSamples=function(e){let t=this._times,n=Io(t,e.start,X.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Io(t,e.stop,X.compare);i<0?i=~i:e.isStopIncluded&&++i,RAe(this,n,i-n)};Sd.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,a;if(n){if(a=t.length,a!==i.length)return!1;for(r=0;r<a;r++)if(t[r]!==i[r])return!1}let s=this._times,c=e._times;if(a=s.length,a!==c.length)return!1;for(r=0;r<a;r++)if(!X.equals(s[r],c[r]))return!1;let u=this._values,f=e._values;for(a=u.length,r=0;r<a;r++)if(u[r]!==f[r])return!1;return!0};Sd._mergeNewSamples=jU;var wd=Sd;function Bd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new wd(d,n),this._definitionChanged=new _e,this._referenceFrame=e??Oi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Bd.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 Pat=new X;Bd.prototype.getValue=function(e,t){return l(e)||(e=X.now(Pat)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Bd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Dm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Bd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Bd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Bd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Bd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Bd.prototype.removeSample=function(e){return this._property.removeSample(e)};Bd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Bd.prototype.equals=function(e){return this===e||e instanceof Bd&&q.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var yc=Bd;var Rat={HORIZONTAL:0,VERTICAL:1},pp=Object.freeze(Rat);var Mat=pp.HORIZONTAL,Nat=U.WHITE,Lat=U.BLACK,Oat=0,Fat=1;function hT(e){e=e??V.EMPTY_OBJECT,this._definitionChanged=new _e,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(hT.prototype,{isConstant:{get:function(){return q.isConstant(this._orientation)&&q.isConstant(this._evenColor)&&q.isConstant(this._oddColor)&&q.isConstant(this._offset)&&q.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:Ae("orientation"),evenColor:Ae("evenColor"),oddColor:Ae("oddColor"),offset:Ae("offset"),repeat:Ae("repeat")});hT.prototype.getType=function(e){return"Stripe"};var Qat=new X;hT.prototype.getValue=function(e,t){return l(e)||(e=X.now(Qat)),l(t)||(t={}),t.horizontal=q.getValueOrDefault(this._orientation,e,Mat)===pp.HORIZONTAL,t.evenColor=q.getValueOrClonedDefault(this._evenColor,e,Nat,t.evenColor),t.oddColor=q.getValueOrClonedDefault(this._oddColor,e,Lat,t.oddColor),t.offset=q.getValueOrDefault(this._offset,e,Oat),t.repeat=q.getValueOrDefault(this._repeat,e,Fat),t};hT.prototype.equals=function(e){return this===e||e instanceof hT&&q.equals(this._orientation,e._orientation)&&q.equals(this._evenColor,e._evenColor)&&q.equals(this._oddColor,e._oddColor)&&q.equals(this._offset,e._offset)&&q.equals(this._repeat,e._repeat)};var Iv=hT;function xy(e){this._definitionChanged=new _e,this._intervals=new Ba,this._intervals.changedEvent.addEventListener(xy.prototype._intervalsChanged,this),this._referenceFrame=e??Oi.FIXED}Object.defineProperties(xy.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 kat=new X;xy.prototype.getValue=function(e,t){return l(e)||(e=X.now(kat)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};xy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Dm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};xy.prototype.equals=function(e){return this===e||e instanceof xy&&this._intervals.equals(e._intervals,q.equals)&&this._referenceFrame===e._referenceFrame};xy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ty=xy;function l0(){this._definitionChanged=new _e,this._intervals=new Ba,this._intervals.changedEvent.addEventListener(l0.prototype._intervalsChanged,this)}Object.defineProperties(l0.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Uat=new X;l0.prototype.getValue=function(e,t){l(e)||(e=X.now(Uat));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};l0.prototype.equals=function(e){return this===e||e instanceof l0&&this._intervals.equals(e._intervals,q.equals)};l0.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Sy=l0;function mT(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new _e,this._normalize=t??!0,this.position=e}Object.defineProperties(mT.prototype,{isConstant:{get:function(){return q.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var zat=new d,MAe=new d,NAe=new X,Gat=new X,tJ=1/60;mT.prototype.getValue=function(e,t){return this._getValue(e,t)};mT.prototype._getValue=function(e,t,n){l(e)||(e=X.now(Gat)),l(t)||(t=new d);let i=this._position;if(q.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,zat),r=i.getValue(X.addSeconds(e,tJ,NAe),MAe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(X.addSeconds(e,-tJ,NAe),MAe),!l(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);l(n)&&o.clone(n);let a=d.subtract(r,o,t);return this._normalize?d.normalize(a,t):d.divideByScalar(a,tJ,t)};mT.prototype.equals=function(e){return this===e||e instanceof mT&&q.equals(this._position,e._position)};var wy=mT;function bv(e,t){this._velocityVectorProperty=new wy(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new _e,this.ellipsoid=t??te.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(bv.prototype,{isConstant:{get:function(){return q.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 LAe=new d,Vat=new d,OAe=new J,Hat=new X;bv.prototype.getValue=function(e,t){l(e)||(e=X.now(Hat));let n=this._velocityVectorProperty._getValue(e,Vat,LAe);if(l(n))return At.rotationMatrixFromPositionVelocity(LAe,n,this._ellipsoid,OAe),Qe.fromRotationMatrix(OAe,t)};bv.prototype.equals=function(e){return this===e||e instanceof bv&&q.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var YU=bv;var tg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};tg.validate=function(e){return e===tg.COMPLETE||e===tg.BELOW_ELLIPSOID_HORIZON||e===tg.ABOVE_ELLIPSOID_HORIZON};tg.toString=function(e){switch(e){case tg.COMPLETE:return"COMPLETE";case tg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case tg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new de("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var xv=tg;function By(){}By.packedLength=d.packedLength;By.unpack=d.unpack;By.pack=d.pack;var nJ;function Tv(e,t){return t[0]==="#"&&(t=nJ+t),by.fromString(e,t)}function FAe(e,t,n){if(l(n.reference))return Tv(t,n.reference);if(l(n.velocityReference)){let i=Tv(t,n.velocityReference);switch(e){case d:case By:return new wy(i,e===By);case Qe:return new YU(i)}}throw new ue(`${JSON.stringify(n)} is not valid CZML.`)}function Wat(e,t){return new Mm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var io=new d,Ml=new WU,Kc=new me,u0=new Rn,qU=new Qe;function jat(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===U.packedLength)return[U.byteToFloat(n[0]),U.byteToFloat(n[1]),U.byteToFloat(n[2]),U.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=U.byteToFloat(n[o+1]),t[o+2]=U.byteToFloat(n[o+2]),t[o+3]=U.byteToFloat(n[o+3]),t[o+4]=U.byteToFloat(n[o+4]);return t}function QAe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function Yat(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ce.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=D.toRadians(n[o+1]),t[o+2]=D.toRadians(n[o+2]),t[o+3]=D.toRadians(n[o+3]),t[o+4]=D.toRadians(n[o+4]);return t}function qat(e){let t=e.length;if(Ml.magnitude=1,t===2)return Ml.clock=e[0],Ml.cone=e[1],d.fromSpherical(Ml,io),[io.x,io.y,io.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],Ml.clock=e[i+1],Ml.cone=e[i+2],d.fromSpherical(Ml,io),n[o+1]=io.x,n[o+2]=io.y,n[o+3]=io.z;return n}function Kat(e){let t=e.length;if(t===3)return Ml.clock=e[0],Ml.cone=e[1],Ml.magnitude=e[2],d.fromSpherical(Ml,io),[io.x,io.y,io.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Ml.clock=e[i+1],Ml.cone=e[i+2],Ml.magnitude=e[i+3],d.fromSpherical(Ml,io),n[i+1]=io.x,n[i+2]=io.y,n[i+3]=io.z;return n}function Xat(e){let t=e.length;if(t===3)return Kc.longitude=e[0],Kc.latitude=e[1],Kc.height=e[2],te.default.cartographicToCartesian(Kc,io),[io.x,io.y,io.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Kc.longitude=e[i+1],Kc.latitude=e[i+2],Kc.height=e[i+3],te.default.cartographicToCartesian(Kc,io),n[i+1]=io.x,n[i+2]=io.y,n[i+3]=io.z;return n}function Jat(e){let t=e.length;if(t===3)return Kc.longitude=D.toRadians(e[0]),Kc.latitude=D.toRadians(e[1]),Kc.height=e[2],te.default.cartographicToCartesian(Kc,io),[io.x,io.y,io.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Kc.longitude=D.toRadians(e[i+1]),Kc.latitude=D.toRadians(e[i+2]),Kc.height=e[i+3],te.default.cartographicToCartesian(Kc,io),n[i+1]=io.x,n[i+2]=io.y,n[i+3]=io.z;return n}function iJ(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return qat(o);let r=e.spherical;if(l(r))return Kat(r);let a=e.cartographicRadians;if(l(a))return Xat(a);let s=e.cartographicDegrees;if(l(s))return Jat(s);throw new ue(`${JSON.stringify(e)} is not a valid CZML interval.`)}function kAe(e,t){d.unpack(e,t,io),d.normalize(io,io),d.pack(io,e,t)}function Zat(e){let t=iJ(e);if(t.length===3)return kAe(t,0),t;for(let n=1;n<t.length;n+=4)kAe(t,n);return t}function UAe(e,t){Qe.unpack(e,t,qU),Qe.normalize(qU,qU),Qe.pack(qU,e,t)}function $at(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return UAe(t,0),t;for(let n=1;n<t.length;n+=5)UAe(t,n)}return t}function zAe(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")?et:e.hasOwnProperty("cartesian2")?Q:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?By:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?un:e.hasOwnProperty("classificationType")?ei:e.hasOwnProperty("colorBlendMode")?bl:e.hasOwnProperty("cornerType")?no:e.hasOwnProperty("heightReference")?ot:e.hasOwnProperty("horizontalOrigin")?Ni:e.hasOwnProperty("date")?X:e.hasOwnProperty("labelStyle")?Ir:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Ht:e.hasOwnProperty("distanceDisplayCondition")?Gt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Qe:e.hasOwnProperty("shadowMode")?Bn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?pp:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?wv.default:e.hasOwnProperty("verticalOrigin")?Yn:Object}function est(e,t,n){switch(e){case un:return un[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case Q:return t.cartesian2;case d:return iJ(t);case By:return Zat(t);case U:return jat(t);case ei:return ei[t.classificationType??t];case bl:return bl[t.colorBlendMode??t];case no:return no[t.cornerType??t];case ot:return ot[t.heightReference??t];case Ni:return Ni[t.horizontalOrigin??t];case Image:return QAe(t,n);case X:return X.fromIso8601(t.date??t);case Ir:return Ir[t.labelStyle??t];case Number:return t.number??t;case Ht:return t.nearFarScalar;case Gt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Qe:return $at(t);case Mh:return t.number??t;case xv:return xv[t.portionToDisplay??t];case Bn:return Bn[t.shadowMode??t.shadows??t];case String:return t.string??t;case pp:return pp[t.stripeOrientation??t];case ce:return Yat(t);case wv.default:return QAe(t,n);case Yn:return Yn[t.verticalOrigin??t];default:throw new ue(`Unknown CzmlDataSource interval type: ${e}`)}}var tst={HERMITE:VU,LAGRANGE:HU,LINEAR:sT};function KU(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:tst[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=Td[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let a=e.backwardExtrapolationType;l(a)&&(t.backwardExtrapolationType=Td[a]);let s=e.backwardExtrapolationDuration;l(s)&&(t.backwardExtrapolationDuration=s)}var GAe={iso8601:void 0};function Mr(e){if(l(e))return GAe.iso8601=e,Rn.fromIso8601(GAe)}function oJ(e){let t=Ze.MAXIMUM_INTERVAL.clone();return t.data=e,t}function VAe(e){let t=new vl;return t.intervals.addInterval(oJ(e)),t}function HAe(e){let t=new _c(e.referenceFrame);return t.intervals.addInterval(oJ(e)),t}function XU(e,t,n,i,o,r,a){let s=Mr(i.interval);l(o)&&(l(s)?s=Rn.intersect(s,o,u0):s=o);let c,u,f,h=!l(i.reference)&&!l(i.velocityReference),p=l(s)&&!s.equals(Ze.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return tge(t[n],s)}let A=!1;if(h){if(u=est(e,i,r),!l(u))return;c=e.packedLength??1,f=u.length??1,A=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Mh;if(!A&&!p){h?t[n]=new hi(m?e.unpack(u,0):u):t[n]=FAe(e,a,i);return}let _=t[n],y,C=i.epoch;if(l(C)&&(y=X.fromIso8601(C)),A&&!p){_ instanceof wd||(t[n]=_=new wd(e)),_.addSamplesPackedArray(u,y),KU(i,_);return}let E;if(!A&&p){s=s.clone(),h?s.data=m?e.unpack(u,0):u:s.data=FAe(e,a,i),l(_)||(t[n]=_=h?new Sy:new vl),h&&_ instanceof Sy?_.intervals.addInterval(s):_ instanceof vl?(h&&(s.data=new hi(s.data)),_.intervals.addInterval(s)):(t[n]=_=VAe(_),h&&(s.data=new hi(s.data)),_.intervals.addInterval(s));return}l(_)||(t[n]=_=new vl),_ instanceof vl||(t[n]=_=VAe(_));let I=_.intervals;E=I.findInterval(s),(!l(E)||!(E.data instanceof wd))&&(E=s.clone(),E.data=new wd(e),I.addInterval(E)),E.data.addSamplesPackedArray(u,y),KU(i,E.data)}function tge(e,t){if(e instanceof wd){e.removeSamples(t);return}else if(e instanceof Sy){e.intervals.removeInterval(t);return}else if(e instanceof vl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Rn.intersect(n.get(i),t,u0);o.isEmpty||tge(o.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,o,r,a){if(l(i))if(Array.isArray(i))for(let s=0,c=i.length;s<c;++s)XU(e,t,n,i[s],o,r,a);else XU(e,t,n,i,o,r,a)}function WAe(e,t,n,i,o,r){let a=Mr(n.interval);l(i)&&(l(a)?a=Rn.intersect(a,i,u0):a=i);let s=l(n.cartesianVelocity)?1:0,c=d.packedLength*(s+1),u,f,h=!l(n.reference),p=l(a)&&!a.equals(Ze.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return nge(e[t],a)}let A,m=!1;if(h&&(l(n.referenceFrame)&&(A=Oi[n.referenceFrame]),A=A??Oi.FIXED,u=iJ(n),f=u.length??1,m=f>c),!m&&!p){h?e[t]=new eu(d.unpack(u),A):e[t]=Tv(r,n.reference);return}let _=e[t],y,C=n.epoch;if(l(C)&&(y=X.fromIso8601(C)),m&&!p){(!(_ instanceof yc)||l(A)&&_.referenceFrame!==A)&&(e[t]=_=new yc(A,s)),_.addSamplesPackedArray(u,y),KU(n,_);return}let E;if(!m&&p){a=a.clone(),h?a.data=d.unpack(u):a.data=Tv(r,n.reference),l(_)||(h?_=new Ty(A):_=new _c(A),e[t]=_),h&&_ instanceof Ty&&l(A)&&_.referenceFrame===A?_.intervals.addInterval(a):_ instanceof _c?(h&&(a.data=new eu(a.data,A)),_.intervals.addInterval(a)):(e[t]=_=HAe(_),h&&(a.data=new eu(a.data,A)),_.intervals.addInterval(a));return}l(_)?_ instanceof _c||(e[t]=_=HAe(_)):e[t]=_=new _c(A);let I=_.intervals;E=I.findInterval(a),(!l(E)||!(E.data instanceof yc)||l(A)&&E.data.referenceFrame!==A)&&(E=a.clone(),E.data=new yc(A,s),I.addInterval(E)),E.data.addSamplesPackedArray(u,y),KU(n,E.data)}function nge(e,t){if(e instanceof yc){e.removeSamples(t);return}else if(e instanceof Ty){e.intervals.removeInterval(t);return}else if(e instanceof _c){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Rn.intersect(n.get(i),t,u0);o.isEmpty||nge(o.data,t)}n.removeInterval(t);return}}function ige(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)WAe(e,t,n[a],i,o,r);else WAe(e,t,n,i,o,r)}function jAe(e,t,n,i){l(n.references)?JU(e,t,n.references,n.interval,i,Ev,vl):(l(n.cartesian2)?n.array=Q.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=Q.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function YAe(e,t,n,i,o,r){let a=Mr(n.interval);l(i)&&(l(a)?a=Rn.intersect(a,i,u0):a=i);let s=e[t],c,u;if(l(a)){s instanceof fv||(s=new fv,e[t]=s);let h=s.intervals;u=h.findInterval({start:a.start,stop:a.stop}),l(u)?c=u.data:(u=a.clone(),h.addInterval(u))}else c=s;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(U,c,"color",f.color,void 0,void 0,r)):l(n.grid)?(c instanceof gv||(c=new gv),f=n.grid,Ee(U,c,"color",f.color,void 0,o,r),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,o,r),Ee(Q,c,"lineCount",f.lineCount,void 0,o,r),Ee(Q,c,"lineThickness",f.lineThickness,void 0,o,r),Ee(Q,c,"lineOffset",f.lineOffset,void 0,o,r)):l(n.image)?(c instanceof $C||(c=new $C),f=n.image,Ee(Image,c,"image",f.image,void 0,o,r),Ee(Q,c,"repeat",f.repeat,void 0,o,r),Ee(U,c,"color",f.color,void 0,o,r),Ee(Boolean,c,"transparent",f.transparent,void 0,o,r)):l(n.stripe)?(c instanceof Iv||(c=new Iv),f=n.stripe,Ee(pp,c,"orientation",f.orientation,void 0,o,r),Ee(U,c,"evenColor",f.evenColor,void 0,o,r),Ee(U,c,"oddColor",f.oddColor,void 0,o,r),Ee(Number,c,"offset",f.offset,void 0,o,r),Ee(Number,c,"repeat",f.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof s0||(c=new s0),f=n.polylineOutline,Ee(U,c,"color",f.color,void 0,o,r),Ee(U,c,"outlineColor",f.outlineColor,void 0,o,r),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof Cv||(c=new Cv),f=n.polylineGlow,Ee(U,c,"color",f.color,void 0,o,r),Ee(Number,c,"glowPower",f.glowPower,void 0,o,r),Ee(Number,c,"taperPower",f.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof _v||(c=new _v),f=n.polylineArrow,Ee(U,c,"color",f.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof yv||(c=new yv),f=n.polylineDash,Ee(U,c,"color",f.color,void 0,void 0,r),Ee(U,c,"gapColor",f.gapColor,void 0,void 0,r),Ee(Number,c,"dashLength",f.dashLength,void 0,o,r),Ee(Number,c,"dashPattern",f.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof sv||(c=new sv),f=n.checkerboard,Ee(U,c,"evenColor",f.evenColor,void 0,o,r),Ee(U,c,"oddColor",f.oddColor,void 0,o,r),Ee(Q,c,"repeat",f.repeat,void 0,o,r)),l(u)?u.data=c:e[t]=c}function cf(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let a=0,s=n.length;a<s;++a)YAe(e,t,n[a],i,o,r);else YAe(e,t,n,i,o,r)}function nst(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function ist(e,t,n,i){let o=t.description;l(o)&&Ee(String,e,"description",o,void 0,i,n)}function ost(e,t,n,i){let o=t.position;l(o)&&ige(e,"position",o,void 0,i,n)}function rst(e,t,n,i){let o=t.viewFrom;l(o)&&Ee(d,e,"viewFrom",o,void 0,i,n)}function ast(e,t,n,i){let o=t.orientation;l(o)&&Ee(Qe,e,"orientation",o,void 0,i,n)}function sst(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new nu);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let a=o[r];if(Array.isArray(a))for(let s=0,c=a.length;s<c;++s)XU(zAe(a[s]),e.properties,r,a[s],void 0,i,n);else XU(zAe(a),e.properties,r,a,void 0,i,n)}}}function JU(e,t,n,i,o,r,a){let s=n.map(function(c){return Tv(o,c)});if(l(i)){i=Mr(i);let c=e[t];if(!(c instanceof a)){let u=new a;u.intervals.addInterval(oJ(c)),e[t]=c=u}i.data=new r(s),c.intervals.addInterval(i)}else e[t]=new r(s)}function qAe(e,t,n,i){let o=n.references;l(o)?JU(e,t,o,n.interval,i,Ev,vl):Ee(Array,e,t,n,void 0,void 0,i)}function KAe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)qAe(e,t,n[o],i);else qAe(e,t,n,i)}function XAe(e,t,n,i){let o=n.references;l(o)?JU(e,t,o,n.interval,i,Ey,_c):(l(n.cartesian)?n.array=d.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,te.default):l(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,te.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function Bv(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)XAe(e,t,n[o],i);else XAe(e,t,n,i)}function cst(e){return d.unpackArray(e)}function lst(e){return d.fromRadiansArrayHeights(e,te.default)}function ust(e){return d.fromDegreesArrayHeights(e,te.default)}function JAe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(a){let s={};return JU(s,"positions",a,n.interval,i,Ey,_c),s.positions});e[t]=new Ey(r)}else l(n.cartesian)?n.array=n.cartesian.map(cst):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(lst):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(ust)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function fst(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)JAe(e,t,n[o],i);else JAe(e,t,n,i)}function dst(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)jAe(e,t,n[o],i);else jAe(e,t,n,i)}function hst(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let a=0,s=o.length;a<s;++a)l(r)||(r=new Ba),r.addInterval(Mr(o[a]));else r=new Ba,r.addInterval(Mr(o));e.availability=r}function mst(e,t,n,i,o){l(t)&&Ee(By,e,"alignedAxis",t,n,i,o)}function pst(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Mr(o.interval),a=e.billboard;l(a)||(e.billboard=a=new dl),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Image,a,"image",o.image,r,i,n),Ee(Number,a,"scale",o.scale,r,i,n),Ee(Q,a,"pixelOffset",o.pixelOffset,r,i,n),Ee(d,a,"eyeOffset",o.eyeOffset,r,i,n),Ee(Ni,a,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ee(Yn,a,"verticalOrigin",o.verticalOrigin,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(U,a,"color",o.color,r,i,n),Ee(Mh,a,"rotation",o.rotation,r,i,n),mst(a,o.alignedAxis,r,i,n),Ee(Boolean,a,"sizeInMeters",o.sizeInMeters,r,i,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(Ht,a,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Ht,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Ht,a,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ee(et,a,"imageSubRegion",o.imageSubRegion,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Ast(e,t,n,i){let o=t.box;if(!l(o))return;let r=Mr(o.interval),a=e.box;l(a)||(e.box=a=new ub),Ee(Boolean,a,"show",o.show,r,i,n),Ee(d,a,"dimensions",o.dimensions,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function gst(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Mr(o.interval),a=e.corridor;l(a)||(e.corridor=a=new db),Ee(Boolean,a,"show",o.show,r,i,n),Bv(a,"positions",o.positions,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(ot,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(no,a,"cornerType",o.cornerType,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function _st(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Mr(o.interval),a=e.cylinder;l(a)||(e.cylinder=a=new hb),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"length",o.length,r,i,n),Ee(Number,a,"topRadius",o.topRadius,r,i,n),Ee(Number,a,"bottomRadius",o.bottomRadius,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ee(Number,a,"slices",o.slices,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function yst(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new ue("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ue("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function Cst(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Mr(o.interval),a=e.ellipse;l(a)||(e.ellipse=a=new mb),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"semiMajorAxis",o.semiMajorAxis,r,i,n),Ee(Number,a,"semiMinorAxis",o.semiMinorAxis,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(ot,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Mh,a,"rotation",o.rotation,r,i,n),Ee(Mh,a,"stRotation",o.stRotation,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function Est(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Mr(o.interval),a=e.ellipsoid;l(a)||(e.ellipsoid=a=new pb),Ee(Boolean,a,"show",o.show,r,i,n),Ee(d,a,"radii",o.radii,r,i,n),Ee(d,a,"innerRadii",o.innerRadii,r,i,n),Ee(Number,a,"minimumClock",o.minimumClock,r,i,n),Ee(Number,a,"maximumClock",o.maximumClock,r,i,n),Ee(Number,a,"minimumCone",o.minimumCone,r,i,n),Ee(Number,a,"maximumCone",o.maximumCone,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"stackPartitions",o.stackPartitions,r,i,n),Ee(Number,a,"slicePartitions",o.slicePartitions,r,i,n),Ee(Number,a,"subdivisions",o.subdivisions,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function Ist(e,t,n,i){let o=t.label;if(!l(o))return;let r=Mr(o.interval),a=e.label;l(a)||(e.label=a=new vm),Ee(Boolean,a,"show",o.show,r,i,n),Ee(String,a,"text",o.text,r,i,n),Ee(String,a,"font",o.font,r,i,n),Ee(Ir,a,"style",o.style,r,i,n),Ee(Number,a,"scale",o.scale,r,i,n),Ee(Boolean,a,"showBackground",o.showBackground,r,i,n),Ee(U,a,"backgroundColor",o.backgroundColor,r,i,n),Ee(Q,a,"backgroundPadding",o.backgroundPadding,r,i,n),Ee(Q,a,"pixelOffset",o.pixelOffset,r,i,n),Ee(d,a,"eyeOffset",o.eyeOffset,r,i,n),Ee(Ni,a,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ee(Yn,a,"verticalOrigin",o.verticalOrigin,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(U,a,"fillColor",o.fillColor,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Ht,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Ht,a,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ee(Ht,a,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function bst(e,t,n,i){let o=t.model;if(!l(o))return;let r=Mr(o.interval),a=e.model;l(a)||(e.model=a=new a_),Ee(Boolean,a,"show",o.show,r,i,n),Ee(wv.default,a,"uri",o.gltf,r,i,n),Ee(Number,a,"scale",o.scale,r,i,n),Ee(Number,a,"minimumPixelSize",o.minimumPixelSize,r,i,n),Ee(Number,a,"maximumScale",o.maximumScale,r,i,n),Ee(Boolean,a,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Ee(Boolean,a,"runAnimations",o.runAnimations,r,i,n),Ee(Boolean,a,"clampAnimations",o.clampAnimations,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(U,a,"silhouetteColor",o.silhouetteColor,r,i,n),Ee(Number,a,"silhouetteSize",o.silhouetteSize,r,i,n),Ee(U,a,"color",o.color,r,i,n),Ee(bl,a,"colorBlendMode",o.colorBlendMode,r,i,n),Ee(Number,a,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let s,c,u=o.nodeTransformations;if(l(u))if(Array.isArray(u))for(s=0,c=u.length;s<c;++s)ZAe(a,u[s],r,i,n);else ZAe(a,u,r,i,n);let f=o.articulations;if(l(f))if(Array.isArray(f))for(s=0,c=f.length;s<c;++s)$Ae(a,f[s],r,i,n);else $Ae(a,f,r,i,n)}function ZAe(e,t,n,i,o){let r=Mr(t.interval);l(n)&&(l(r)?r=Rn.intersect(r,n,u0):r=n);let a=e.nodeTransformations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let h=t[f];if(!l(h))continue;l(a)||(e.nodeTransformations=a=new nu),a.hasProperty(f)||a.addProperty(f);let p=a[f];l(p)||(a[f]=p=new Ab),Ee(d,p,"translation",h.translation,r,i,o),Ee(Qe,p,"rotation",h.rotation,r,i,o),Ee(d,p,"scale",h.scale,r,i,o)}}function $Ae(e,t,n,i,o){let r=Mr(t.interval);l(n)&&(l(r)?r=Rn.intersect(r,n,u0):r=n);let a=e.articulations,s=Object.keys(t);for(let c=0,u=s.length;c<u;++c){let f=s[c];if(f==="interval")continue;let h=t[f];l(h)&&(l(a)||(e.articulations=a=new nu),a.hasProperty(f)||a.addProperty(f),Ee(Number,a,f,h,r,i,o))}}function xst(e,t,n,i){let o=t.path;if(!l(o))return;let r=Mr(o.interval),a=e.path;l(a)||(e.path=a=new s_),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"leadTime",o.leadTime,r,i,n),Ee(Number,a,"trailTime",o.trailTime,r,i,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"resolution",o.resolution,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(String,a,"relativeTo",o.relativeTo,r,i,n)}function Tst(e,t,n,i){let o=t.point;if(!l(o))return;let r=Mr(o.interval),a=e.point;l(a)||(e.point=a=new _b),Ee(Boolean,a,"show",o.show,r,i,n),Ee(Number,a,"pixelSize",o.pixelSize,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(U,a,"color",o.color,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Ht,a,"scaleByDistance",o.scaleByDistance,r,i,n),Ee(Ht,a,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(Number,a,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function Sv(e){this.polygon=e,this._definitionChanged=new _e}Object.defineProperties(Sv.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});Sv.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Fc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Fc(n,i)};Sv.prototype.equals=function(e){return this===e||e instanceof Sv&&q.equals(this.polygon._positions,e.polygon._positions)&&q.equals(this.polygon._holes,e.polygon._holes)};function Sst(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Mr(o.interval),a=e.polygon;l(a)||(e.polygon=a=new Pm),Ee(Boolean,a,"show",o.show,r,i,n),Bv(a,"_positions",o.positions,n),fst(a,"_holes",o.holes,n),(l(a._positions)||l(a._holes))&&(a.hierarchy=new Sv(a)),Ee(Number,a,"height",o.height,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(ot,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Mh,a,"stRotation",o.stRotation,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Boolean,a,"perPositionHeight",o.perPositionHeight,r,i,n),Ee(Boolean,a,"closeTop",o.closeTop,r,i,n),Ee(Boolean,a,"closeBottom",o.closeBottom,r,i,n),Ee(un,a,"arcType",o.arcType,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function wst(e){return e?un.GEODESIC:un.NONE}function Bst(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Mr(o.interval),a=e.polyline;if(l(a)||(e.polyline=a=new pl),Ee(Boolean,a,"show",o.show,r,i,n),Bv(a,"positions",o.positions,n),Ee(Number,a,"width",o.width,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),cf(a,"material",o.material,r,i,n),cf(a,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ee(un,a,"arcType",o.arcType,r,i,n),Ee(Boolean,a,"clampToGround",o.clampToGround,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let s={};Ee(Boolean,s,"followSurface",o.followSurface,r,i,n),a.arcType=Wat(s.followSurface,wst)}}function Dst(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Mr(o.interval),a=e.polylineVolume;l(a)||(e.polylineVolume=a=new yb),Bv(a,"positions",o.positions,n),dst(a,"shape",o.shape,n),Ee(Boolean,a,"show",o.show,r,i,n),Ee(no,a,"cornerType",o.cornerType,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function vst(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Mr(o.interval),a=e.rectangle;l(a)||(e.rectangle=a=new Rm),Ee(Boolean,a,"show",o.show,r,i,n),Ee(ce,a,"coordinates",o.coordinates,r,i,n),Ee(Number,a,"height",o.height,r,i,n),Ee(ot,a,"heightReference",o.heightReference,r,i,n),Ee(Number,a,"extrudedHeight",o.extrudedHeight,r,i,n),Ee(ot,a,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ee(Mh,a,"rotation",o.rotation,r,i,n),Ee(Mh,a,"stRotation",o.stRotation,r,i,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ee(ei,a,"classificationType",o.classificationType,r,i,n),Ee(Number,a,"zIndex",o.zIndex,r,i,n)}function Pst(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Mr(o.interval),a=e.tileset;l(a)||(e.tileset=a=new gb),Ee(Boolean,a,"show",o.show,r,i,n),Ee(wv.default,a,"uri",o.uri,r,i,n),Ee(Number,a,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Rst(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Mr(o.interval),a=e.wall;l(a)||(e.wall=a=new c_),Ee(Boolean,a,"show",o.show,r,i,n),Bv(a,"positions",o.positions,n),KAe(a,"minimumHeights",o.minimumHeights,n),KAe(a,"maximumHeights",o.maximumHeights,n),Ee(Number,a,"granularity",o.granularity,r,i,n),Ee(Boolean,a,"fill",o.fill,r,i,n),cf(a,"material",o.material,r,i,n),Ee(Boolean,a,"outline",o.outline,r,i,n),Ee(U,a,"outlineColor",o.outlineColor,r,i,n),Ee(Number,a,"outlineWidth",o.outlineWidth,r,i,n),Ee(Bn,a,"shadows",o.shadows,r,i,n),Ee(Gt,a,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function ege(e,t,n,i,o){let r=e.id;if(l(r)||(r=Jn()),nJ=r,!l(o._version)&&r!=="document")throw new ue("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")yst(e,o);else{let a=t.getOrCreateEntity(r),s=e.parent;l(s)&&(a.parent=t.getOrCreateEntity(s));for(let c=n.length-1;c>-1;c--)n[c](a,e,t,i)}nJ=void 0}function Mst(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ze.MINIMUM_VALUE)){let r=o.start,a=o.stop,s=X.secondsDifference(a,r),c=Math.round(s/120);return t=new mp,t.startTime=X.clone(r),t.stopTime=X.clone(a),t.clockRange=va.LOOP_STOP,t.multiplier=c,t.currentTime=X.clone(r),t.clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new mp,t.startTime=Ze.MINIMUM_VALUE.clone(),t.stopTime=Ze.MAXIMUM_VALUE.clone(),t.currentTime=Ze.MINIMUM_VALUE.clone(),t.clockRange=va.LOOP_STOP,t.clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Mr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=X.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=va[n.range]??va.LOOP_STOP),l(n.step)&&(t.clockStep=Qo[n.step]??Qo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function oge(e,t,n,i){n=n??V.EMPTY_OBJECT;let o=t,r=n.sourceUri,a=n.credit;if(typeof a=="string"&&(a=new Et(a)),e._credit=a,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return r=De.createIfNeeded(r),Da.setLoading(e,!0),Promise.resolve(o).then(function(s){return Nst(e,s,r,i)}).catch(function(s){return Da.setLoading(e,!1),e._error.raiseEvent(e,s),console.log(s),Promise.reject(s)})}function Nst(e,t,n,i){Da.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new rge,o.removeAll()),Wa._processCzml(t,o,n,void 0,e);let r=Mst(e),a=e._documentPacket;return l(a.name)&&e._name!==a.name?(e._name=a.name,r=!0):!l(e._name)&&l(n)&&(e._name=Cy(n.getUrlComponent()),r=!0),Da.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function rge(){this.name=void 0,this.clock=void 0}function Wa(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._clock=void 0,this._documentPacket=new rge,this._version=void 0,this._entityCollection=new $s(this),this._entityCluster=new xd,this._credit=void 0,this._resourceCredits=[]}Wa.load=function(e,t){return new Wa().load(e,t)};Object.defineProperties(Wa.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Wa.updaters=[pst,Ast,gst,_st,Cst,Est,Ist,bst,nst,ist,xst,Tst,Sst,Bst,Dst,sst,vst,ost,Pst,rst,Rst,ast,hst];Wa.registerUpdater=function(e){Wa.updaters.includes(e)||Wa.updaters.push(e)};Wa.unregisterUpdater=function(e){if(Wa.updaters.includes(e)){let t=Wa.updaters.indexOf(e);Wa.updaters.splice(t,1)}};Wa.prototype.process=function(e,t){return oge(this,e,t,!1)};Wa.prototype.load=function(e,t){return oge(this,e,t,!0)};Wa.prototype.update=function(e){return!0};Wa.processPacketData=Ee;Wa.processPositionPacketData=ige;Wa.processMaterialPacketData=cf;Wa._processCzml=function(e,t,n,i,o){if(i=i??Wa.updaters,Array.isArray(e))for(let r=0,a=e.length;r<a;++r)ege(e[r],t,i,n,o);else ege(e,t,i,n,o)};var ZU=Wa;function Nl(){this._dataSources=[],this._dataSourceAdded=new _e,this._dataSourceRemoved=new _e,this._dataSourceMoved=new _e}Object.defineProperties(Nl.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}}});Nl.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Nl.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};Nl.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=[]};Nl.prototype.contains=function(e){return this.indexOf(e)!==-1};Nl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Nl.prototype.get=function(e){return this._dataSources[e]};Nl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function $U(e,t){return e.indexOf(t)}function age(e,t,n){let i=e._dataSources,o=i.length-1;if(t=D.clamp(t,0,o),n=D.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Nl.prototype.raise=function(e){let t=$U(this._dataSources,e);age(this,t,t+1)};Nl.prototype.lower=function(e){let t=$U(this._dataSources,e);age(this,t,t-1)};Nl.prototype.raiseToTop=function(e){let t=$U(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))};Nl.prototype.lowerToBottom=function(e){let t=$U(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Nl.prototype.isDestroyed=function(){return!1};Nl.prototype.destroy=function(){return this.removeAll(!0),fe(this)};var ez=Nl;function tc(e){e=e??V.EMPTY_OBJECT,this._primitives=[],this._guid=Jn(),this._primitiveAdded=new _e,this._primitiveRemoved=new _e,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(tc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});tc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};tc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};tc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};tc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};tc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function tz(e,t){return e._primitives.indexOf(t)}tc.prototype.raise=function(e){if(l(e)){let t=tz(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};tc.prototype.raiseToTop=function(e){if(l(e)){let t=tz(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};tc.prototype.lower=function(e){if(l(e)){let t=tz(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};tc.prototype.lowerToBottom=function(e){if(l(e)){let t=tz(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};tc.prototype.get=function(e){return this._primitives[e]};tc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};tc.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};tc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};tc.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};tc.prototype.isDestroyed=function(){return!1};tc.prototype.destroy=function(){return this.removeAll(),fe(this)};var yu=tc;function Ap(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Ap.prototype,{length:{get:function(){return this._length}}});Ap.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new yu({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};Ap.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Ap.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};Ap.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};Ap.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Ap.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Ap.prototype.isDestroyed=function(){return!1};Ap.prototype.destroy=function(){return this.removeAll(),fe(this)};var nz=Ap;function pT(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ft}pT.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};pT.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};pT.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};pT.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};pT.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Ct.FAILED};var AT=pT;var aJ={},iz=new d,sge=new d,cge=new Qe,lge=new J;function gT(e,t,n,i,o,r,a,s,c,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),iz),d.multiplyByScalar(n,Math.sin(f),sge),d.add(iz,sge,iz);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(a*h+o*p)/s;return Qe.fromAxisAngle(iz,m,cge),J.fromQuaternion(cge,lge),J.multiplyByVector(lge,c,u),d.normalize(u,u),d.multiplyByScalar(u,s,u),u}var uge=new d,fge=new d,rJ=new d,Lst=new d;aJ.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,a=n?e.length/3*2:e.length/3,s=new Float64Array(a*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let h=f+1,p=f+2,A=d.fromArray(e,f,uge);i.scaleToGeodeticSurface(A,A);let m=d.clone(A,fge),_=i.geodeticSurfaceNormal(A,Lst),y=d.multiplyByScalar(_,o,rJ);d.add(A,y,A),n&&(d.multiplyByScalar(_,r,y),d.add(m,y,m),s[f+u]=m.x,s[h+u]=m.y,s[p+u]=m.z),s[f]=A.x,s[h]=A.y,s[p]=A.z}return s};var Ost=new d,Fst=new d,Qst=new d;aJ.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,a=e.center,s=e.granularity*8,c=i*i,u=o*o,f=o*i,h=d.magnitude(a),p=d.normalize(a,Ost),A=d.cross(d.UNIT_Z,a,Fst);A=d.normalize(A,A);let m=d.cross(p,A,Qst),_=1+Math.ceil(D.PI_OVER_TWO/s),y=D.PI_OVER_TWO/(_-1),C=D.PI_OVER_TWO-_*y;C<0&&(_-=Math.ceil(Math.abs(C)/y));let E=2*(_*(_+2)),I=t?new Array(E*3):void 0,x=0,S=uge,w=fge,v=_*4*3,R=v-1,N=0,L=n?new Array(v):void 0,g,b,T,B,M;for(C=D.PI_OVER_TWO,S=gT(C,r,m,A,c,f,u,h,p,S),t&&(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z),n&&(L[R--]=S.z,L[R--]=S.y,L[R--]=S.x),C=D.PI_OVER_TWO-y,g=1;g<_+1;++g){if(S=gT(C,r,m,A,c,f,u,h,p,S),w=gT(Math.PI-C,r,m,A,c,f,u,h,p,w),t){for(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z,T=2*g+2,b=1;b<T-1;++b)B=b/(T-1),M=d.lerp(S,w,B,rJ),I[x++]=M.x,I[x++]=M.y,I[x++]=M.z;I[x++]=w.x,I[x++]=w.y,I[x++]=w.z}n&&(L[R--]=S.z,L[R--]=S.y,L[R--]=S.x,L[N++]=w.x,L[N++]=w.y,L[N++]=w.z),C=D.PI_OVER_TWO-(g+1)*y}for(g=_;g>1;--g){if(C=D.PI_OVER_TWO-(g-1)*y,S=gT(-C,r,m,A,c,f,u,h,p,S),w=gT(C+Math.PI,r,m,A,c,f,u,h,p,w),t){for(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z,T=2*(g-1)+2,b=1;b<T-1;++b)B=b/(T-1),M=d.lerp(S,w,B,rJ),I[x++]=M.x,I[x++]=M.y,I[x++]=M.z;I[x++]=w.x,I[x++]=w.y,I[x++]=w.z}n&&(L[R--]=S.z,L[R--]=S.y,L[R--]=S.x,L[N++]=w.x,L[N++]=w.y,L[N++]=w.z)}C=D.PI_OVER_TWO,S=gT(-C,r,m,A,c,f,u,h,p,S);let O={};return t&&(I[x++]=S.x,I[x++]=S.y,I[x++]=S.z,O.positions=I,O.numPts=_),n&&(L[R--]=S.z,L[R--]=S.y,L[R--]=S.x,O.outerPositions=L),O};var lf=aJ;var _T=new d,sJ=new d,cJ=new d,dge=new d,ls=new Q,hge=new J,kst=new J,lJ=new Qe,mge=new d,pge=new d,Age=new d,az=new me,gge=new d,_ge=new Q,yge=new Q;function Cge(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,a=t.semiMinorAxis,s=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,A=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,_=f?new Float32Array(u*3):void 0,y=0,C=mge,E=pge,I=Age,x=new qi(s),S=x.project(s.cartesianToCartographic(o,az),gge),w=s.scaleToGeodeticSurface(o,_T);s.geodeticSurfaceNormal(w,w);let v=hge,R=kst;if(c!==0){let M=Qe.fromAxisAngle(w,c,lJ);v=J.fromQuaternion(M,v),M=Qe.fromAxisAngle(w,-c,lJ),R=J.fromQuaternion(M,R)}else v=J.clone(J.IDENTITY,v),R=J.clone(J.IDENTITY,R);let N=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,_ge),L=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,yge),g=e.length,b=n?g:0,T=b/3*2;for(let M=0;M<g;M+=3){let O=M+1,G=M+2,k=d.fromArray(e,M,_T);if(i.st){let z=J.multiplyByVector(v,k,sJ),F=x.project(s.cartesianToCartographic(z,az),cJ);d.subtract(F,S,F),ls.x=(F.x+r)/(2*r),ls.y=(F.y+a)/(2*a),N.x=Math.min(ls.x,N.x),N.y=Math.min(ls.y,N.y),L.x=Math.max(ls.x,L.x),L.y=Math.max(ls.y,L.y),n&&(h[y+T]=ls.x,h[y+1+T]=ls.y),h[y++]=ls.x,h[y++]=ls.y}(i.normal||i.tangent||i.bitangent||f)&&(C=s.geodeticSurfaceNormal(k,C),f&&(_[M+b]=-C.x,_[O+b]=-C.y,_[G+b]=-C.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(E=d.normalize(d.cross(d.UNIT_Z,C,E),E),J.multiplyByVector(R,E,E)),i.normal&&(p[M]=C.x,p[O]=C.y,p[G]=C.z,n&&(p[M+b]=-C.x,p[O+b]=-C.y,p[G+b]=-C.z)),i.tangent&&(A[M]=E.x,A[O]=E.y,A[G]=E.z,n&&(A[M+b]=-E.x,A[O+b]=-E.y,A[G+b]=-E.z)),i.bitangent&&(I=d.normalize(d.cross(C,E,I),I),m[M]=I.x,m[O]=I.y,m[G]=I.z,n&&(m[M+b]=I.x,m[O+b]=I.y,m[G+b]=I.z))))}if(i.st){g=h.length;for(let M=0;M<g;M+=2)h[M]=(h[M]-N.x)/(L.x-N.x),h[M+1]=(h[M+1]-N.y)/(L.y-N.y)}let B=new En;if(i.position){let M=lf.raisePositionsToHeight(e,t,n);B.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(B.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(B.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(B.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),i.bitangent&&(B.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),f&&(B.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:_})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)M=M.fill(1,0,u/2);else{let O=t.offsetAttribute===mn.NONE?0:1;M=M.fill(O)}B.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return B}function Ege(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,a,s;for(i=0,r=1,a=0;a<3;a++)t[n++]=r++,t[n++]=i,t[n++]=r;for(a=2;a<e+1;++a){for(r=a*(a+1)-1,i=(a-1)*a-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*a,s=0;s<o-1;++s)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,a=0;a<o-1;++a)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,a=e-1;a>1;--a){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*a,s=0;s<o-1;++s)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(a=0;a<3;a++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var f0=new d;function Ust(e){let t=e.center;f0=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,f0),e.height,f0),f0=d.add(t,f0,f0);let n=new le(f0,e.semiMajorAxis),i=lf.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,a=Cge(o,e,!1),s=Ege(r);return s=Ue.createTypedArray(o.length/3,s),{boundingSphere:n,attributes:a,indices:s}}function zst(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,a=t.ellipsoid,s=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,A=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,_=n.bitangent?new Float32Array(f*3):void 0,y=t.shadowVolume,C=y?new Float32Array(f*3):void 0,E=0,I=mge,x=pge,S=Age,w=new qi(a),v=w.project(a.cartesianToCartographic(i,az),gge),R=a.scaleToGeodeticSurface(i,_T);a.geodeticSurfaceNormal(R,R);let N=Qe.fromAxisAngle(R,u,lJ),L=J.fromQuaternion(N,hge),g=Q.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,_ge),b=Q.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,yge),T=e.length,B=T/3*2;for(let O=0;O<T;O+=3){let G=O+1,k=O+2,z=d.fromArray(e,O,_T),F;if(n.st){let Y=J.multiplyByVector(L,z,sJ),$=w.project(a.cartesianToCartographic(Y,az),cJ);d.subtract($,v,$),ls.x=($.x+o)/(2*o),ls.y=($.y+r)/(2*r),g.x=Math.min(ls.x,g.x),g.y=Math.min(ls.y,g.y),b.x=Math.max(ls.x,b.x),b.y=Math.max(ls.y,b.y),p[E+B]=ls.x,p[E+1+B]=ls.y,p[E++]=ls.x,p[E++]=ls.y}z=a.scaleToGeodeticSurface(z,z),F=d.clone(z,sJ),I=a.geodeticSurfaceNormal(z,I),y&&(C[O+T]=-I.x,C[G+T]=-I.y,C[k+T]=-I.z);let H=d.multiplyByScalar(I,s,dge);if(z=d.add(z,H,z),H=d.multiplyByScalar(I,c,H),F=d.add(F,H,F),n.position&&(h[O+T]=F.x,h[G+T]=F.y,h[k+T]=F.z,h[O]=z.x,h[G]=z.y,h[k]=z.z),n.normal||n.tangent||n.bitangent){S=d.clone(I,S);let Y=d.fromArray(e,(O+3)%T,dge);d.subtract(Y,z,Y);let $=d.subtract(F,z,cJ);I=d.normalize(d.cross($,Y,I),I),n.normal&&(A[O]=I.x,A[G]=I.y,A[k]=I.z,A[O+T]=I.x,A[G+T]=I.y,A[k+T]=I.z),n.tangent&&(x=d.normalize(d.cross(S,I,x),x),m[O]=x.x,m[G]=x.y,m[k]=x.z,m[O+T]=x.x,m[O+1+T]=x.y,m[O+2+T]=x.z),n.bitangent&&(_[O]=S.x,_[G]=S.y,_[k]=S.z,_[O+T]=S.x,_[G+T]=S.y,_[k+T]=S.z)}}if(n.st){T=p.length;for(let O=0;O<T;O+=2)p[O]=(p[O]-g.x)/(b.x-g.x),p[O+1]=(p[O+1]-g.y)/(b.y-g.y)}let M=new En;if(n.position&&(M.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(M.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),n.tangent&&(M.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(M.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:_})),y&&(M.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:C})),l(t.offsetAttribute)){let O=new Uint8Array(f);if(t.offsetAttribute===mn.TOP)O=O.fill(1,0,f/2);else{let G=t.offsetAttribute===mn.NONE?0:1;O=O.fill(G)}M.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}return M}function Gst(e){let t=e.length/3,n=Ue.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,a=o+t,s=(r+1)%t,c=s+t;n[i++]=r,n[i++]=a,n[i++]=s,n[i++]=s,n[i++]=a,n[i++]=c}return n}var oz=new le,rz=new le;function Vst(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,_T),e.height,_T);oz.center=d.add(t,o,oz.center),oz.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),rz.center=d.add(t,o,rz.center),rz.radius=i;let r=lf.computeEllipsePositions(e,!0,!0),a=r.positions,s=r.numPts,c=r.outerPositions,u=le.union(oz,rz),f=Cge(a,e,!0),h=Ege(s),p=h.length;h.length=p*2;let A=a.length/3;for(let x=0;x<p;x+=3)h[x+p]=h[x+2]+A,h[x+1+p]=h[x+1]+A,h[x+2+p]=h[x]+A;let m=Ue.createTypedArray(A*2/3,h),_=new yt({attributes:f,indices:m,primitiveType:Pe.TRIANGLES}),y=zst(c,e);h=Gst(c);let C=Ue.createTypedArray(c.length*2/3,h),E=new yt({attributes:y,indices:C,primitiveType:Pe.TRIANGLES}),I=jn.combineInstances([new Lt({geometry:_}),new Lt({geometry:E})]);return{boundingSphere:u,attributes:I[0].attributes,indices:I[0].indices}}function Ige(e,t,n,i,o,r,a){let c=lf.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(c,p*3);let h=ce.fromCartesianArray(f,r,a);return h.width>D.PI&&(h.north=h.north>0?D.PI_OVER_TWO-D.EPSILON7:h.north,h.south=h.south<0?D.EPSILON7-D.PI_OVER_TWO:h.south,h.east=D.PI,h.west=-D.PI),h}function _p(e){e=e??V.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.vertexFormat??ke.DEFAULT,s=e.height??0,c=e.extrudedHeight??s;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,s),this._granularity=r,this._vertexFormat=ke.clone(a),this._extrudedHeight=Math.min(c,s),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}_p.packedLength=d.packedLength+te.packedLength+ke.packedLength+9;_p.pack=function(e,t,n){return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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 bge=new d,xge=new te,Tge=new ke,gp={center:bge,ellipsoid:xge,vertexFormat:Tge,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};_p.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,bge);t+=d.packedLength;let o=te.unpack(e,t,xge);t+=te.packedLength;let r=ke.unpack(e,t,Tge);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],A=e[t++]===1,m=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._semiMajorAxis=a,n._semiMinorAxis=s,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=A,n._offsetAttribute=m===-1?void 0:m,n):(gp.height=f,gp.extrudedHeight=p,gp.granularity=h,gp.stRotation=u,gp.rotation=c,gp.semiMajorAxis=a,gp.semiMinorAxis=s,gp.shadowVolume=A,gp.offsetAttribute=m===-1?void 0:m,new _p(gp))};_p.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??te.default,o=e.semiMajorAxis,r=e.semiMinorAxis,a=e.granularity??D.RADIANS_PER_DEGREE,s=e.rotation??0;return Ige(n,o,r,s,a,i,t)};_p.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=Vst(o);else if(r=Ust(o),l(e._offsetAttribute)){let a=r.attributes.position.values.length,s=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(a/3).fill(s);r.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new yt({attributes:r.attributes,indices:r.indices,primitiveType:Pe.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};_p.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new _p({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};function Hst(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=lf.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=d.fromArray(i,c*3);let a=e._ellipsoid,s=e.rectangle;return yt._textureCoordinateRotationPoints(r,t,a,s)}Object.defineProperties(_p.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Ige(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Hst(this)),this._textureCoordinateRotationPoints}}});var Cu=_p;var Sge=new d,d0=new d;function Wst(e){let t=e.center;d0=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,d0),e.height,d0),d0=d.add(t,d0,d0);let n=new le(d0,e.semiMajorAxis),i=lf.computeEllipsePositions(e,!1,!0).outerPositions,o=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:lf.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,a=Ue.createTypedArray(r,r*2),s=0;for(let c=0;c<r;++c)a[s++]=c,a[s++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:a}}var sz=new le,cz=new le;function jst(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,Sge),e.height,Sge);sz.center=d.add(t,o,sz.center),sz.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),cz.center=d.add(t,o,cz.center),cz.radius=i;let r=lf.computeEllipsePositions(e,!1,!0).outerPositions,a=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:lf.raisePositionsToHeight(r,e,!0)})});r=a.position.values;let s=le.union(sz,cz),c=r.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)m=m.fill(1,0,c/2);else{let _=e.offsetAttribute===mn.NONE?0:1;m=m.fill(_)}a.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=Ue.createTypedArray(c,c*2+u*2);c/=2;let h=0,p;for(p=0;p<c;++p)f[h++]=p,f[h++]=(p+1)%c,f[h++]=p+c,f[h++]=(p+1)%c+c;let A;if(u>0){let m=Math.min(u,c);A=Math.round(c/m);let _=Math.min(A*u,c);for(p=0;p<_;p+=A)f[h++]=p,f[h++]=p+c}return{boundingSphere:s,attributes:a,indices:f}}function yT(e){e=e??V.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??te.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.height??0,s=e.extrudedHeight??a;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=te.clone(n),this._rotation=e.rotation??0,this._height=Math.max(s,a),this._granularity=r,this._extrudedHeight=Math.min(s,a),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}yT.packedLength=d.packedLength+te.packedLength+8;yT.pack=function(e,t,n){return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var wge=new d,Bge=new te,ng={center:wge,ellipsoid:Bge,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};yT.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,wge);t+=d.packedLength;let o=te.unpack(e,t,Bge);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._center=d.clone(i,n._center),n._ellipsoid=te.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=a,n._rotation=s,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(ng.height=c,ng.extrudedHeight=f,ng.granularity=u,ng.rotation=s,ng.semiMajorAxis=r,ng.semiMinorAxis=a,ng.numberOfVerticalLines=h,ng.offsetAttribute=p===-1?void 0:p,new yT(ng))};yT.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=jst(o);else if(r=Wst(o),l(e._offsetAttribute)){let a=r.attributes.position.values.length,s=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(a/3).fill(s);r.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new yt({attributes:r.attributes,indices:r.indices,primitiveType:Pe.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var Dd=yT;var Dge=new U,vge=d.ZERO,Pge=new d,Rge=new ce;function Yst(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 Nh(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Yst(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Nh.prototype=Object.create(ri.prototype),Nh.prototype.constructor=Nh);Nh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Dge)),l(o)||(o=U.WHITE),i.color=Jt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,vge,Pge))),new Lt({id:t,geometry:new Cu(this._options),attributes:i})};Nh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Dge),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,vge,Pge))),new Lt({id:t,geometry:new Dd(this._options),attributes:r})};Nh.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};Nh.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Ti.prototype._isHidden.call(this,e,t)};Nh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!q.isConstant(t.rotation)||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.numberOfVerticalLines)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Nh.prototype._setStaticOptions=function(e,t){let n=q.getValueOrUndefined(t.height,Ze.MINIMUM_VALUE),i=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),o=q.getValueOrUndefined(t.extrudedHeight,Ze.MINIMUM_VALUE),r=q.getValueOrDefault(t.extrudedHeightReference,Ze.MINIMUM_VALUE,ot.NONE);l(o)&&!l(n)&&(n=0);let a=this._options;a.vertexFormat=this._materialProperty instanceof Kt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,a.center=e.position.getValue(Ze.MINIMUM_VALUE,a.center),a.semiMajorAxis=t.semiMajorAxis.getValue(Ze.MINIMUM_VALUE,a.semiMajorAxis),a.semiMinorAxis=t.semiMinorAxis.getValue(Ze.MINIMUM_VALUE,a.semiMinorAxis),a.rotation=q.getValueOrUndefined(t.rotation,Ze.MINIMUM_VALUE),a.granularity=q.getValueOrUndefined(t.granularity,Ze.MINIMUM_VALUE),a.stRotation=q.getValueOrUndefined(t.stRotation,Ze.MINIMUM_VALUE),a.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,Ze.MINIMUM_VALUE),a.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),a.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=vi.getMinimumMaximumHeights(Cu.computeRectangle(a,Rge)).minimumTerrainHeight),a.extrudedHeight=o};Nh.DynamicGeometryUpdater=CT;function CT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(CT.prototype=Object.create(xi.prototype),CT.prototype.constructor=CT);CT.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||xi.prototype._isHidden.call(this,e,t,n)};CT.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,ot.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),s=q.getValueOrDefault(t.extrudedHeightReference,n,ot.NONE);l(a)&&!l(o)&&(o=0),i.center=q.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=q.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=q.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=q.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,a,s),i.height=ri.getGeometryHeight(o,r),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND&&(a=vi.getMinimumMaximumHeights(Cu.computeRectangle(i,Rge)).minimumTerrainHeight),i.extrudedHeight=a};var lz=Nh;var qst=new d,Kst=new d,Xst=new d,Jst=new d,Zst=new d,$st=new d(1,1,1),Mge=Math.cos,Nge=Math.sin;function ig(e){e=e??V.EMPTY_OBJECT;let t=e.radii??$st,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??D.TWO_PI,r=e.minimumCone??0,a=e.maximumCone??D.PI,s=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??ke.DEFAULT;this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=a,this._stackPartitions=s,this._slicePartitions=c,this._vertexFormat=ke.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}ig.packedLength=2*d.packedLength+ke.packedLength+7;ig.pack=function(e,t,n){return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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 Lge=new d,Oge=new d,Fge=new ke,Dy={radii:Lge,innerRadii:Oge,vertexFormat:Fge,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};ig.unpack=function(e,t,n){t=t??0;let i=d.unpack(e,t,Lge);t+=d.packedLength;let o=d.unpack(e,t,Oge);t+=d.packedLength;let r=ke.unpack(e,t,Fge);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return l(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=ke.clone(r,n._vertexFormat),n._minimumClock=a,n._maximumClock=s,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(Dy.minimumClock=a,Dy.maximumClock=s,Dy.minimumCone=c,Dy.maximumCone=u,Dy.stackPartitions=f,Dy.slicePartitions=h,Dy.offsetAttribute=p===-1?void 0:p,new ig(Dy))};ig.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,a=e._maximumCone,s=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/D.TWO_PI),u=Math.round(u*Math.abs(a-r)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,h,p=0,A=[r],m=[i];for(f=0;f<u;f++)A.push(r+f*(a-r)/(u-1));for(A.push(a),h=0;h<c;h++)m.push(i+h*(o-i)/(c-1));m.push(o);let _=A.length,y=m.length,C=0,E=1,I=n.x!==t.x||n.y!==t.y||n.z!==t.z,x=!1,S=!1,w=!1;I&&(E=2,r>0&&(x=!0,C+=c-1),a<Math.PI&&(S=!0,C+=c-1),(o-i)%D.TWO_PI?(w=!0,C+=(u-1)*2+1):C+=1);let v=y*_*E,R=new Float64Array(v*3),N=new Array(v).fill(!1),L=new Array(v).fill(!1),g=c*u*E,b=6*(g+C+1-(c+u)*E),T=Ue.createTypedArray(g,b),B=s.normal?new Float32Array(v*3):void 0,M=s.tangent?new Float32Array(v*3):void 0,O=s.bitangent?new Float32Array(v*3):void 0,G=s.st?new Float32Array(v*2):void 0,k=new Array(_),z=new Array(_);for(f=0;f<_;f++)k[f]=Nge(A[f]),z[f]=Mge(A[f]);let F=new Array(y),H=new Array(y);for(h=0;h<y;h++)H[h]=Mge(m[h]),F[h]=Nge(m[h]);for(f=0;f<_;f++)for(h=0;h<y;h++)R[p++]=t.x*k[f]*H[h],R[p++]=t.y*k[f]*F[h],R[p++]=t.z*z[f];let Y=v/2;if(I)for(f=0;f<_;f++)for(h=0;h<y;h++)R[p++]=n.x*k[f]*H[h],R[p++]=n.y*k[f]*F[h],R[p++]=n.z*z[f],N[Y]=!0,f>0&&f!==_-1&&h!==0&&h!==y-1&&(L[Y]=!0),Y++;p=0;let $,W;for(f=1;f<_-2;f++)for($=f*y,W=(f+1)*y,h=1;h<y-2;h++)T[p++]=W+h,T[p++]=W+h+1,T[p++]=$+h+1,T[p++]=W+h,T[p++]=$+h+1,T[p++]=$+h;if(I){let nt=_*y;for(f=1;f<_-2;f++)for($=nt+f*y,W=nt+(f+1)*y,h=1;h<y-2;h++)T[p++]=W+h,T[p++]=$+h,T[p++]=$+h+1,T[p++]=W+h,T[p++]=$+h+1,T[p++]=W+h+1}let K,Z;if(I){if(x)for(Z=_*y,f=1;f<y-2;f++)T[p++]=f,T[p++]=f+1,T[p++]=Z+f+1,T[p++]=f,T[p++]=Z+f+1,T[p++]=Z+f;if(S)for(K=_*y-y,Z=_*y*E-y,f=1;f<y-2;f++)T[p++]=K+f+1,T[p++]=K+f,T[p++]=Z+f,T[p++]=K+f+1,T[p++]=Z+f,T[p++]=Z+f+1}if(w){for(f=1;f<_-2;f++)Z=y*_+y*f,K=y*f,T[p++]=Z,T[p++]=K+y,T[p++]=K,T[p++]=Z,T[p++]=Z+y,T[p++]=K+y;for(f=1;f<_-2;f++)Z=y*_+y*(f+1)-1,K=y*(f+1)-1,T[p++]=K+y,T[p++]=Z,T[p++]=K,T[p++]=K+y,T[p++]=Z+y,T[p++]=Z}let pe=new En;s.position&&(pe.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:R}));let ge=0,re=0,ye=0,Ce=0,ve=v/2,Ne,Le=te.fromCartesian3(t),Oe=te.fromCartesian3(n);if(s.st||s.normal||s.tangent||s.bitangent){for(f=0;f<v;f++){Ne=N[f]?Oe:Le;let nt=d.fromArray(R,f*3,qst),Fe=Ne.geodeticSurfaceNormal(nt,Kst);if(L[f]&&d.negate(Fe,Fe),s.st){let _t=Q.negate(Fe,Zst);G[ge++]=Math.atan2(_t.y,_t.x)/D.TWO_PI+.5,G[ge++]=Math.asin(Fe.z)/Math.PI+.5}if(s.normal&&(B[re++]=Fe.x,B[re++]=Fe.y,B[re++]=Fe.z),s.tangent||s.bitangent){let _t=Xst,rt=0,je;if(N[f]&&(rt=ve),!x&&f>=rt&&f<rt+y*2?je=d.UNIT_X:je=d.UNIT_Z,d.cross(je,Fe,_t),d.normalize(_t,_t),s.tangent&&(M[ye++]=_t.x,M[ye++]=_t.y,M[ye++]=_t.z),s.bitangent){let st=d.cross(Fe,_t,Jst);d.normalize(st,st),O[Ce++]=st.x,O[Ce++]=st.y,O[Ce++]=st.z}}}s.st&&(pe.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:G})),s.normal&&(pe.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:B})),s.tangent&&(pe.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:M})),s.bitangent&&(pe.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:O}))}if(l(e._offsetAttribute)){let nt=R.length,Fe=e._offsetAttribute===mn.NONE?0:1,_t=new Uint8Array(nt/3).fill(Fe);pe.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:_t})}return new yt({attributes:pe,indices:T,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromEllipsoid(Le),offsetAttribute:e._offsetAttribute})};var uJ;ig.getUnitEllipsoid=function(){return l(uJ)||(uJ=ig.createGeometry(new ig({radii:new d(1,1,1),vertexFormat:ke.POSITION_ONLY}))),uJ};var nc=ig;var ect=new Kt(U.WHITE),fJ=d.ZERO,dJ=new d,tct=new d,nct=new d,hJ=new U,ict=new d(1,1,1);function oct(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 uf(e,t){Ti.call(this,{entity:e,scene:t,geometryOptions:new oct(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(uf.prototype=Object.create(Ti.prototype),uf.prototype.constructor=uf);Object.defineProperties(uf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});uf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,a=new wn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),c=$n.fromDistanceDisplayCondition(s),u={show:a,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,hJ)),l(f)||(f=U.WHITE),r=Jt.fromColor(f),u.color=r}return l(this._options.offsetAttribute)&&(u.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,fJ,dJ))),new Lt({id:i,geometry:new nc(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};uf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,hJ),a=this._distanceDisplayConditionProperty.getValue(e),s={show:new wn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:$n.fromDistanceDisplayCondition(a),offset:void 0};return l(this._options.offsetAttribute)&&(s.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,fJ,dJ))),new Lt({id:i,geometry:new Cd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:s})};uf.prototype._computeCenter=function(e,t){return q.getValueOrUndefined(this._entity.position,e,t)};uf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Ti.prototype._isHidden.call(this,e,t)};uf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.radii.isConstant||!q.isConstant(t.innerRadii)||!q.isConstant(t.stackPartitions)||!q.isConstant(t.slicePartitions)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.minimumClock)||!q.isConstant(t.maximumClock)||!q.isConstant(t.minimumCone)||!q.isConstant(t.maximumCone)||!q.isConstant(t.subdivisions)};uf.prototype._setStaticOptions=function(e,t){let n=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ze.MINIMUM_VALUE,i.radii),i.innerRadii=q.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=q.getValueOrUndefined(t.minimumClock,Ze.MINIMUM_VALUE),i.maximumClock=q.getValueOrUndefined(t.maximumClock,Ze.MINIMUM_VALUE),i.minimumCone=q.getValueOrUndefined(t.minimumCone,Ze.MINIMUM_VALUE),i.maximumCone=q.getValueOrUndefined(t.maximumCone,Ze.MINIMUM_VALUE),i.stackPartitions=q.getValueOrUndefined(t.stackPartitions,Ze.MINIMUM_VALUE),i.slicePartitions=q.getValueOrUndefined(t.slicePartitions,Ze.MINIMUM_VALUE),i.subdivisions=q.getValueOrUndefined(t.subdivisions,Ze.MINIMUM_VALUE),i.offsetAttribute=n!==ot.NONE?mn.ALL:void 0};uf.prototype._onEntityPropertyChanged=l_;uf.DynamicGeometryUpdater=Dv;function Dv(e,t,n){xi.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new P,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new d,this._material={}}l(Object.create)&&(Dv.prototype=Object.create(xi.prototype),Dv.prototype.constructor=Dv);Dv.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!q.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=q.getValueOrUndefined(n.radii,e,tct),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=q.getValueOrDefault(n.fill,e,!0),a=q.getValueOrDefault(n.outline,e,!1),s=q.getValueOrClonedDefault(n.outlineColor,e,U.BLACK,hJ),c=vr.getValue(e,n.material??ect,this._material),u=q.getValueOrUndefined(n.innerRadii,e,nct),f=q.getValueOrUndefined(n.minimumClock,e),h=q.getValueOrUndefined(n.maximumClock,e),p=q.getValueOrUndefined(n.minimumCone,e),A=q.getValueOrUndefined(n.maximumCone,e),m=q.getValueOrUndefined(n.stackPartitions,e),_=q.getValueOrUndefined(n.slicePartitions,e),y=q.getValueOrUndefined(n.subdivisions,e),C=q.getValueOrDefault(n.outlineWidth,e,1),E=q.getValueOrDefault(n.heightReference,e,ot.NONE),I=E!==ot.NONE?mn.ALL:void 0,x=this._scene.mode,S=x===oe.SCENE3D&&E===ot.NONE,w=this._options,v=this._geometryUpdater.shadowsProperty.getValue(e),N=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=q.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,fJ,dJ);if(!S||this._lastSceneMode!==x||!l(this._primitive)||w.stackPartitions!==m||w.slicePartitions!==_||l(u)&&!d.equals(w.innerRadii!==u)||w.minimumClock!==f||w.maximumClock!==h||w.minimumCone!==p||w.maximumCone!==A||w.subdivisions!==y||this._lastOutlineWidth!==C||w.offsetAttribute!==I){let b=this._primitives;b.removeAndDestroy(this._primitive),b.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=x,this._lastOutlineWidth=C,w.stackPartitions=m,w.slicePartitions=_,w.subdivisions=y,w.offsetAttribute=I,w.radii=d.clone(S?ict:i,w.radii),l(u)?S?w.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,w.innerRadii):w.innerRadii=d.clone(u,w.innerRadii):w.innerRadii=void 0,w.minimumClock=f,w.maximumClock=h,w.minimumCone=p,w.maximumCone=A;let T=new _o({material:c,translucent:c.isTranslucent(),closed:!0});w.vertexFormat=T.vertexFormat;let B=this._geometryUpdater.createFillGeometryInstance(e,S,this._modelMatrix);this._primitive=b.add(new Ln({geometryInstances:B,appearance:T,asynchronous:!1,shadows:v}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,S,this._modelMatrix);this._outlinePrimitive=b.add(new Ln({geometryInstances:M,appearance:new gn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(C)}}),asynchronous:!1,shadows:v})),this._lastShow=r,this._lastOutlineShow=a,this._lastOutlineColor=U.clone(s,this._lastOutlineColor),this._lastDistanceDisplayCondition=N,this._lastOffset=d.clone(L,this._lastOffset)}else if(this._primitive.ready){let b=this._primitive,T=this._outlinePrimitive;b.show=!0,T.show=!0,b.appearance.material=c;let B=this._attributes;l(B)||(B=b.getGeometryInstanceAttributes(t),this._attributes=B),r!==this._lastShow&&(B.show=wn.toValue(r,B.show),this._lastShow=r);let M=this._outlineAttributes;l(M)||(M=T.getGeometryInstanceAttributes(t),this._outlineAttributes=M),a!==this._lastOutlineShow&&(M.show=wn.toValue(a,M.show),this._lastOutlineShow=a),U.equals(s,this._lastOutlineColor)||(M.color=Jt.toValue(s,M.color),U.clone(s,this._lastOutlineColor)),Gt.equals(N,this._lastDistanceDisplayCondition)||(B.distanceDisplayCondition=$n.toValue(N,B.distanceDisplayCondition),M.distanceDisplayCondition=$n.toValue(N,M.distanceDisplayCondition),Gt.clone(N,this._lastDistanceDisplayCondition)),d.equals(L,this._lastOffset)||(B.offset=go.toValue(L,B.offset),M.offset=go.toValue(L,B.offset),d.clone(L,this._lastOffset))}S&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=P.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var uz=uf;function ET(e){e=e??V.EMPTY_OBJECT;let t=e.vertexFormat??ke.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}ET.packedLength=ke.packedLength;ET.pack=function(e,t,n){return n=n??0,ke.pack(e._vertexFormat,t,n),t};var Qge=new ke,rct={vertexFormat:Qge};ET.unpack=function(e,t,n){t=t??0;let i=ke.unpack(e,t,Qge);return l(n)?(n._vertexFormat=ke.clone(i,n._vertexFormat),n):new ET(rct)};var fz=new d(-.5,-.5,0),dz=new d(.5,.5,0);ET.createGeometry=function(e){let t=e._vertexFormat,n=new En,i,o;if(t.position){if(o=new Float64Array(12),o[0]=fz.x,o[1]=fz.y,o[2]=0,o[3]=dz.x,o[4]=fz.y,o[5]=0,o[6]=dz.x,o[7]=dz.y,o[8]=0,o[9]=fz.x,o[10]=dz.y,o[11]=0,n.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new yt({attributes:n,indices:i,primitiveType:Pe.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var hz=ET;function IT(){this._workerName="createPlaneOutlineGeometry"}IT.packedLength=0;IT.pack=function(e,t){return t};IT.unpack=function(e,t,n){return l(n)?n:new IT};var vy=new d(-.5,-.5,0),mz=new d(.5,.5,0);IT.createGeometry=function(){let e=new En,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=vy.x,n[1]=vy.y,n[2]=vy.z,n[3]=mz.x,n[4]=vy.y,n[5]=vy.z,n[6]=mz.x,n[7]=mz.y,n[8]=vy.z,n[9]=vy.x,n[10]=mz.y,n[11]=vy.z,e.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new yt({attributes:e,indices:t,primitiveType:Pe.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var pz=IT;var act=new d,kge=new U;function sct(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function vd(e,t){Ti.call(this,{entity:e,scene:t,geometryOptions:new sct(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(vd.prototype=Object.create(Ti.prototype),vd.prototype.constructor=vd);vd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=$n.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Kt){let A;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(A=this._materialProperty.color.getValue(e,kge)),l(A)||(A=U.WHITE),o=Jt.fromColor(A),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),h=q.getValueOrDefault(c.plane,e,u.plane),p=q.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=mJ(h,p,f,f),new Lt({id:t,geometry:new hz(this._options),modelMatrix:f,attributes:i})};vd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,kge),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,a=this._options,s=t.computeModelMatrix(e),c=q.getValueOrDefault(r.plane,e,a.plane),u=q.getValueOrUndefined(r.dimensions,e,a.dimensions);return a.plane=c,a.dimensions=u,s=mJ(c,u,s,s),new Lt({id:t,geometry:new pz,modelMatrix:s,attributes:{show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o)}})};vd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Ti.prototype._isHidden.call(this,e,t)};vd.prototype._getIsClosed=function(e){return!1};vd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!q.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!q.isConstant(t.outlineWidth)};vd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ze.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ze.MINIMUM_VALUE,i.dimensions)};vd.DynamicGeometryUpdater=bT;function bT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(bT.prototype=Object.create(xi.prototype),bT.prototype.constructor=bT);bT.prototype._isHidden=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(e.position,n,act);return!l(o)||!l(i.plane)||!l(i.dimensions)||xi.prototype._isHidden.call(this,e,t,n)};bT.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=q.getValueOrDefault(t.plane,n,i.plane),i.dimensions=q.getValueOrUndefined(t.dimensions,n,i.dimensions)};var cct=new d,lct=new d,uct=new d,fct=new d,dct=new J,hct=new J,mct=new P;function mJ(e,t,n,i){let o=e.normal,r=e.distance,a=d.multiplyByScalar(o,-r,uct),s=d.clone(d.UNIT_Z,lct);D.equalsEpsilon(Math.abs(d.dot(s,o)),1,D.EPSILON8)&&(s=d.clone(d.UNIT_Y,s));let c=d.cross(s,o,cct);s=d.cross(o,c,s),d.normalize(c,c),d.normalize(s,s);let u=dct;J.setColumn(u,0,c,u),J.setColumn(u,1,s,u),J.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,fct),h=J.multiplyByScale(u,f,hct),p=P.fromRotationTranslation(h,a,mct);return P.multiplyTransformation(n,p,i)}vd.createPrimitiveMatrix=mJ;var Az=vd;var pct=new d,Act=new et,gct=new Q,_ct=new Q,yct=new d,Cct=new d,Ect=new d,vv=new d,Ict=new d,bct=new d,Uge=new Qe,xct=new J,Tct=new J,Sct=new d;function wct(e,t,n,i,o,r,a,s,c){let u=e.positions,f=wi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Ue.createTypedArray(u.length,f.length);h.set(f);let p=xct;if(i!==0){let g=Qe.fromAxisAngle(a,i,Uge);if(p=J.fromQuaternion(g,p),t.tangent||t.bitangent){g=Qe.fromAxisAngle(a,-i,Uge);let b=J.fromQuaternion(g,Tct);s=d.normalize(J.multiplyByVector(b,s,s),s),t.bitangent&&(c=d.normalize(d.cross(a,s,c),c))}}else p=J.clone(J.IDENTITY,p);let A=_ct;t.st&&(A.x=n.x,A.y=n.y);let m=u.length,_=m*3,y=new Float64Array(_),C=t.normal?new Float32Array(_):void 0,E=t.tangent?new Float32Array(_):void 0,I=t.bitangent?new Float32Array(_):void 0,x=t.st?new Float32Array(m*2):void 0,S=0,w=0,v=0,R=0,N=0;for(let g=0;g<m;g++){let b=u[g];if(y[S++]=b.x,y[S++]=b.y,y[S++]=b.z,t.st)if(l(o)&&o.positions.length===m)x[N++]=o.positions[g].x,x[N++]=o.positions[g].y;else{let T=J.multiplyByVector(p,b,pct),B=r(T,gct);Q.subtract(B,A,B);let M=D.clamp(B.x/n.width,0,1),O=D.clamp(B.y/n.height,0,1);x[N++]=M,x[N++]=O}t.normal&&(C[w++]=a.x,C[w++]=a.y,C[w++]=a.z),t.tangent&&(E[R++]=s.x,E[R++]=s.y,E[R++]=s.z),t.bitangent&&(I[v++]=c.x,I[v++]=c.y,I[v++]=c.z)}let L=new En;return t.position&&(L.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:y})),t.normal&&(L.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:C})),t.tangent&&(L.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(L.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:I})),t.st&&(L.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:x})),new yt({attributes:L,indices:h,primitiveType:Pe.TRIANGLES})}function h0(e){e=e??V.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??ke.DEFAULT;this._vertexFormat=ke.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ni.computeHierarchyPackedLength(t,d)+ke.packedLength+te.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,Q):1)+2}h0.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new h0(t)};h0.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,Q):t[n++]=-1,t[n++]=e.packedLength,t};var Bct=te.clone(te.UNIT_SPHERE),Dct=new ke,vct={polygonHierarchy:{}};h0.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Bct);t+=te.packedLength;let r=ke.unpack(e,t,Dct);t+=ke.packedLength;let a=e[t++],s=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,Q);l(s)?(t=s.startingIndex,delete s.startingIndex):t++;let c=e[t++];return l(n)||(n=new h0(vct)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._stRotation=a,n._textureCoordinates=s,n.packedLength=c,n};h0.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),a=n.positions;if(a=jo(a,d.equalsEpsilon,!0),a.length<3)return;let s=yct,c=Cct,u=Ect,f=Ict,h=bct;if(!ly.computeProjectTo2DArguments(a,vv,f,h))return;if(s=d.cross(f,h,s),s=d.normalize(s,s),!d.equalsEpsilon(vv,d.ZERO,D.EPSILON6)){let N=e._ellipsoid.geodeticSurfaceNormal(vv,Sct);d.dot(s,N)<0&&(s=d.negate(s,s),f=d.negate(f,f))}let A=ly.createProjectPointsTo2DFunction(vv,f,h),m=ly.createProjectPointTo2DFunction(vv,f,h);t.tangent&&(c=d.clone(f,c)),t.bitangent&&(u=d.clone(h,u));let _=ni.polygonsFromHierarchy(n,r,A,!1),y=_.hierarchy,C=_.polygons,E=function(N){return N},I=r?ni.polygonsFromHierarchy(o,!0,E,!1).polygons:void 0;if(y.length===0)return;a=y[0].outerRing;let x=le.fromPoints(a),S=ni.computeBoundingRectangle(s,m,a,i,Act),w=[];for(let N=0;N<C.length;N++){let L=new Lt({geometry:wct(C[N],t,S,i,r?I[N]:void 0,m,s,c,u)});w.push(L)}let v=jn.combineInstances(w)[0];v.attributes.position.values=new Float64Array(v.attributes.position.values),v.indices=Ue.createTypedArray(v.attributes.position.values.length/3,v.indices);let R=v.attributes;return t.position||delete R.position,new yt({attributes:R,indices:v.indices,primitiveType:v.primitiveType,boundingSphere:x})};var gz=h0;var zge=[],_z=[];function Pct(e,t,n,i,o){let a=Fa.fromPoints(t,e).projectPointsOntoPlane(t,zge);wi.computeWindingOrder2D(a)===ts.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],_=t[(u+1)%f];c[h++]=m.x,c[h++]=m.y,c[h++]=m.z,c[h++]=_.x,c[h++]=_.y,c[h++]=_.z}else{let m=0;if(o===un.GEODESIC)for(u=0;u<f;u++)m+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===un.RHUMB)for(u=0;u<f;u++)m+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let _;o===un.GEODESIC?_=ni.subdivideLine(t[u],t[(u+1)%f],n,_z):o===un.RHUMB&&(_=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,_z));let y=_.length;for(let C=0;C<y;++C)c[h++]=_[C]}}f=c.length/3;let p=f*2,A=Ue.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)A[h++]=u,A[h++]=u+1;return A[h++]=f-1,A[h++]=0,new Lt({geometry:new yt({attributes:new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c})}),indices:A,primitiveType:Pe.LINES})})}function Rct(e,t,n,i,o){let a=Fa.fromPoints(t,e).projectPointsOntoPlane(t,zge);wi.computeWindingOrder2D(a)===ts.CLOCKWISE&&(a.reverse(),t=t.slice().reverse());let c,u,f=t.length,h=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let y=t[u],C=t[(u+1)%f];c[p++]=y.x,c[p++]=y.y,c[p++]=y.z,c[p++]=C.x,c[p++]=C.y,c[p++]=C.z}else{let y=0;if(o===un.GEODESIC)for(u=0;u<f;u++)y+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===un.RHUMB)for(u=0;u<f;u++)y+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(y*3*2),u=0;u<f;++u){h[u]=p/3;let C;o===un.GEODESIC?C=ni.subdivideLine(t[u],t[(u+1)%f],n,_z):o===un.RHUMB&&(C=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,_z));let E=C.length;for(let I=0;I<E;++I)c[p++]=C[I]}}f=c.length/6;let A=h.length,m=(f*2+A)*2,_=Ue.createTypedArray(f+A,m);for(p=0,u=0;u<f;++u)_[p++]=u,_[p++]=(u+1)%f,_[p++]=u+f,_[p++]=(u+1)%f+f;for(u=0;u<A;u++){let y=h[u];_[p++]=y,_[p++]=y+f}return new Lt({geometry:new yt({attributes:new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c})}),indices:_,primitiveType:Pe.LINES})})}function m0(e){let t=e.polygonHierarchy,n=e.ellipsoid??te.default,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),a=e.arcType??un.GEODESIC,s=e.height??0,c=e.extrudedHeight??s;if(!r){let u=Math.max(s,c);c=Math.min(s,c),s=u}this._ellipsoid=te.clone(n),this._granularity=i,this._height=s,this._extrudedHeight=c,this._arcType=a,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,d)+te.packedLength+8}m0.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,d),te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var Mct=te.clone(te.UNIT_SPHERE),Nct={polygonHierarchy:{}};m0.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=te.unpack(e,t,Mct);t+=te.packedLength;let r=e[t++],a=e[t++],s=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return l(n)||(n=new m0(Nct)),n._polygonHierarchy=i,n._ellipsoid=te.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=a,n._granularity=s,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};m0.fromPositions=function(e){e=e??V.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new m0(t)};m0.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,a=ni.polygonOutlinesFromHierarchy(i,!o,t);if(a.length===0)return;let s,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,h,0,D.EPSILON2),A,m;if(p)for(m=0;m<a.length;m++){if(s=Rct(t,a[m],u,o,r),s.geometry=ni.scaleToGeodeticHeightExtruded(s.geometry,f,h,t,o),l(e._offsetAttribute)){let C=s.geometry.attributes.position.values.length/3,E=new Uint8Array(C);e._offsetAttribute===mn.TOP?E=E.fill(1,0,C/2):(A=e._offsetAttribute===mn.NONE?0:1,E=E.fill(A)),s.geometry.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}c.push(s)}else for(m=0;m<a.length;m++){if(s=Pct(t,a[m],u,o,r),s.geometry.attributes.position.values=wi.scaleToGeodeticHeight(s.geometry.attributes.position.values,f,t,!o),l(e._offsetAttribute)){let C=s.geometry.attributes.position.values.length;A=e._offsetAttribute===mn.NONE?0:1;let E=new Uint8Array(C/3).fill(A);s.geometry.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}c.push(s)}let _=jn.combineInstances(c)[0],y=le.fromVertices(_.attributes.position.values);return new yt({attributes:_.attributes,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:y,offsetAttribute:e._offsetAttribute})};var yz=m0;var Gge="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Vge="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",Hge=new U,Wge=d.ZERO,jge=new d,Yge=new ce,Lct=[],Oct=new Q;function Fct(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 ff(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Fct(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(ff.prototype=Object.create(ri.prototype),ff.prototype.constructor=ff);ff.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Hge)),l(a)||(a=U.WHITE),o.color=Jt.fromColor(a)}l(i.offsetAttribute)&&(o.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wge,jge)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new gz(i):r=new v_(i),new Lt({id:t,geometry:r,attributes:o})};ff.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Hge),r=this._distanceDisplayConditionProperty.getValue(e),a={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:$n.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(a.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,Wge,jge)));let s;return i.perPositionHeight&&!l(i.extrudedHeight)?s=new Bh(i):s=new yz(i),new Lt({id:t,geometry:s,attributes:a})};ff.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Fa.fromPoints(i,o),a=r.projectPointsOntoPlane(i,Lct),s=a.length,c=0,u=s-1,f=new Q;for(let p=0;p<s;u=p++){let A=a[p],m=a[u],_=A.x*m.y-m.x*A.y,y=Q.add(A,m,Oct);y=Q.multiplyByScalar(y,_,y),f=Q.add(f,y,f),c+=_}let h=1/(c*3);return f=Q.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};ff.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Ti.prototype._isHidden.call(this,e,t)};ff.prototype._isOnTerrain=function(e,t){let n=ri.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(Ze.MINIMUM_VALUE):!0);return n&&!o};ff.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.textureCoordinates)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.perPositionHeight)||!q.isConstant(t.closeTop)||!q.isConstant(t.closeBottom)||!q.isConstant(t.zIndex)||!q.isConstant(t.arcType)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};ff.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ze.MINIMUM_VALUE),r=q.getValueOrUndefined(t.height,Ze.MINIMUM_VALUE),a=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),s=q.getValueOrUndefined(t.extrudedHeight,Ze.MINIMUM_VALUE),c=q.getValueOrDefault(t.extrudedHeightReference,Ze.MINIMUM_VALUE,ot.NONE),u=q.getValueOrDefault(t.perPositionHeight,Ze.MINIMUM_VALUE,!1);r=ri.getGeometryHeight(r,a);let f;if(u?(l(r)&&(r=void 0,bt(Gge)),a!==ot.NONE&&u&&(r=void 0,bt(Vge))):(l(s)&&!l(r)&&(r=0),f=ri.computeGeometryOffsetAttribute(r,a,s,c)),i.polygonHierarchy=o,i.granularity=q.getValueOrUndefined(t.granularity,Ze.MINIMUM_VALUE),i.stRotation=q.getValueOrUndefined(t.stRotation,Ze.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=q.getValueOrDefault(t.closeTop,Ze.MINIMUM_VALUE,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,Ze.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=q.getValueOrDefault(t.arcType,Ze.MINIMUM_VALUE,un.GEODESIC),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,Ze.MINIMUM_VALUE),s=ri.getGeometryExtrudedHeight(s,c),s===ri.CLAMP_TO_GROUND){let h=v_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Yge);s=vi.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=s};ff.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};ff.DynamicGeometryUpdater=xT;function xT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(xT.prototype=Object.create(xi.prototype),xT.prototype.constructor=xT);xT.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||xi.prototype._isHidden.call(this,e,t,n)};xT.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=q.getValueOrUndefined(t.hierarchy,n);let o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,ot.NONE),a=q.getValueOrDefault(t.extrudedHeightReference,n,ot.NONE),s=q.getValueOrUndefined(t.extrudedHeight,n),c=q.getValueOrUndefined(t.perPositionHeight,n);o=ri.getGeometryHeight(o,a);let u;if(c?(l(o)&&(o=void 0,bt(Gge)),r!==ot.NONE&&c&&(o=void 0,bt(Vge))):(l(s)&&!l(o)&&(o=0),u=ri.computeGeometryOffsetAttribute(o,r,s,a)),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=q.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=q.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=q.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=q.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=q.getValueOrDefault(t.arcType,n,un.GEODESIC),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND){let f=v_.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Yge);s=vi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=s};var Cz=ff;function Qct(e,t,n,i){let o=new En;i.position&&(o.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,a=e.length/3,s=(a-r*2)/(r*2),c=wi.triangulate(t),u=(s-1)*r*6+c.length*2,f=Ue.createTypedArray(a,u),h,p,A,m,_,y,C=r*2,E=0;for(h=0;h<s-1;h++){for(p=0;p<r-1;p++)A=p*2+h*r*2,y=A+C,m=A+1,_=m+C,f[E++]=m,f[E++]=A,f[E++]=_,f[E++]=_,f[E++]=A,f[E++]=y;A=r*2-2+h*r*2,m=A+1,_=m+C,y=A+C,f[E++]=m,f[E++]=A,f[E++]=_,f[E++]=_,f[E++]=A,f[E++]=y}if(i.st||i.tangent||i.bitangent){let S=new Float32Array(a*2),w=1/(s-1),v=1/n.height,R=n.height/2,N,L,g=0;for(h=0;h<s;h++){for(N=h*w,L=v*(t[0].y+R),S[g++]=N,S[g++]=L,p=1;p<r;p++)L=v*(t[p].y+R),S[g++]=N,S[g++]=L,S[g++]=N,S[g++]=L;L=v*(t[0].y+R),S[g++]=N,S[g++]=L}for(p=0;p<r;p++)N=0,L=v*(t[p].y+R),S[g++]=N,S[g++]=L;for(p=0;p<r;p++)N=(s-1)*w,L=v*(t[p].y+R),S[g++]=N,S[g++]=L;o.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:new Float32Array(S)})}let I=a-r*2;for(h=0;h<c.length;h+=3){let S=c[h]+I,w=c[h+1]+I,v=c[h+2]+I;f[E++]=S,f[E++]=w,f[E++]=v,f[E++]=v+r,f[E++]=w+r,f[E++]=S+r}let x=new yt({attributes:o,indices:f,boundingSphere:le.fromVertices(e),primitiveType:Pe.TRIANGLES});if(i.normal&&(x=jn.computeNormal(x)),i.tangent||i.bitangent){try{x=jn.computeTangentAndBitangent(x)}catch{bt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(x.attributes.tangent=void 0),i.bitangent||(x.attributes.bitangent=void 0),i.st||(x.attributes.st=void 0)}return x}function Rv(e){e=e??V.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??no.ROUNDED,this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*Q.packedLength,this.packedLength=i+te.packedLength+ke.packedLength+2}Rv.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._shape;for(r=a.length,t[n++]=r,i=0;i<r;++i,n+=Q.packedLength)Q.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var qge=te.clone(te.UNIT_SPHERE),Kge=new ke,Pv={polylinePositions:void 0,shapePositions:void 0,ellipsoid:qge,vertexFormat:Kge,cornerType:void 0,granularity:void 0};Rv.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=new Array(o);for(i=0;i<o;++i,t+=Q.packedLength)a[i]=Q.unpack(e,t);let s=te.unpack(e,t,qge);t+=te.packedLength;let c=ke.unpack(e,t,Kge);t+=ke.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=r,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=ke.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(Pv.polylinePositions=r,Pv.shapePositions=a,Pv.cornerType=u,Pv.granularity=f,new Rv(Pv))};var kct=new et;Rv.createGeometry=function(e){let t=e._positions,n=jo(t,d.equalsEpsilon),i=e._shape;if(i=up.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;wi.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=et.fromPoints(i,kct),r=up.computePositions(n,i,o,e,!0);return Qct(r,i,o,e._vertexFormat)};var Ez=Rv;function Uct(e,t){let n=new En;n.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,a=e.length/3/i,s=Ue.createTypedArray(o,2*i*(a+1)),c,u,f=0;c=0;let h=c*i;for(u=0;u<i-1;u++)s[f++]=u+h,s[f++]=u+h+1;for(s[f++]=i-1+h,s[f++]=h,c=a-1,h=c*i,u=0;u<i-1;u++)s[f++]=u+h,s[f++]=u+h+1;for(s[f++]=i-1+h,s[f++]=h,c=0;c<a-1;c++){let A=i*c,m=A+i;for(u=0;u<i;u++)s[f++]=u+A,s[f++]=u+m}return new yt({attributes:n,indices:Ue.createTypedArray(o,s),boundingSphere:le.fromVertices(e),primitiveType:Pe.LINES})}function Nv(e){e=e??V.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._cornerType=e.cornerType??no.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*Q.packedLength,this.packedLength=i+te.packedLength+2}Nv.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._shape;for(r=a.length,t[n++]=r,i=0;i<r;++i,n+=Q.packedLength)Q.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Xge=te.clone(te.UNIT_SPHERE),Mv={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Xge,height:void 0,cornerType:void 0,granularity:void 0};Nv.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=new Array(o);for(i=0;i<o;++i,t+=Q.packedLength)a[i]=Q.unpack(e,t);let s=te.unpack(e,t,Xge);t+=te.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(Mv.polylinePositions=r,Mv.shapePositions=a,Mv.cornerType=c,Mv.granularity=u,new Nv(Mv))};var zct=new et;Nv.createGeometry=function(e){let t=e._positions,n=jo(t,d.equalsEpsilon),i=e._shape;if(i=up.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;wi.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=et.fromPoints(i,zct),r=up.computePositions(n,i,o,e,!1);return Uct(r,i)};var Iz=Nv;var Jge=new U;function Gct(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 yp(e,t){Ti.call(this,{entity:e,scene:t,geometryOptions:new Gct(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(yp.prototype=Object.create(Ti.prototype),yp.prototype.constructor=yp);yp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=$n.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Jge)),l(c)||(c=U.WHITE),o=Jt.fromColor(c),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};return new Lt({id:t,geometry:new Ez(this._options),attributes:i})};yp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Jge),o=this._distanceDisplayConditionProperty.getValue(e);return new Lt({id:t,geometry:new Iz(this._options),attributes:{show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o)}})};yp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Ti.prototype._isHidden.call(this,e,t)};yp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!q.isConstant(t.granularity)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.cornerType)};yp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Kt;o.vertexFormat=r?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ze.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ze.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(Ze.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(Ze.MINIMUM_VALUE):void 0};yp.DynamicGeometryUpdater=TT;function TT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(TT.prototype=Object.create(xi.prototype),TT.prototype.constructor=TT);TT.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||xi.prototype._isHidden.call(this,e,t,n)};TT.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=q.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=q.getValueOrUndefined(t.shape,n),i.granularity=q.getValueOrUndefined(t.granularity,n),i.cornerType=q.getValueOrUndefined(t.cornerType,n)};var bz=yp;var pJ=new d,e_e=new d,t_e=new d,n_e=new d,i_e=new ce,Vct=new Q,Hct=new le,Wct=new le;function o_e(e,t){let n=new yt({attributes:new En,primitiveType:Pe.TRIANGLES});return n.attributes.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function jct(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,a=t.tangent?new Float32Array(o):void 0,s=t.bitangent?new Float32Array(o):void 0,c=0,u=n_e,f=t_e,h=e_e;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let A=d.fromArray(e,p,pJ),m=c+1,_=c+2;h=n.geodeticSurfaceNormal(A,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),J.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[c]=h.x,r[m]=h.y,r[_]=h.z),t.tangent&&(a[c]=f.x,a[m]=f.y,a[_]=f.z),t.bitangent&&(s[c]=u.x,s[m]=u.y,s[_]=u.z),c+=3}return o_e(t,{positions:e,normals:r,tangents:a,bitangents:s})}var AJ=new d,r_e=new d;function Yct(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,a=t.bitangent?new Float32Array(i):void 0,s=0,c=0,u=0,f=!0,h=n_e,p=t_e,A=e_e;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let _=d.fromArray(e,m,pJ),y=d.fromArray(e,(m+6)%i,AJ);if(f){let C=d.fromArray(e,(m+3)%i,r_e);d.subtract(y,_,y),d.subtract(C,_,C),A=d.normalize(d.cross(C,y,A),A),f=!1}d.equalsEpsilon(y,_,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(_,h),t.tangent&&(p=d.normalize(d.cross(h,A,p),p))),t.normal&&(o[s++]=A.x,o[s++]=A.y,o[s++]=A.z,o[s++]=A.x,o[s++]=A.y,o[s++]=A.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(a[u++]=h.x,a[u++]=h.y,a[u++]=h.z,a[u++]=h.x,a[u++]=h.y,a[u++]=h.z)}return o_e(t,{positions:e,normals:o,tangents:r,bitangents:a})}function a_e(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,a=t.northCap,s=t.southCap,c=0,u=o,f=o,h=0;a&&(c=1,f-=1,h+=1),s&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,A=n.st?new Float32Array(h*2):void 0,m=0,_=0,y=pJ,C=Vct,E=Number.MAX_VALUE,I=Number.MAX_VALUE,x=-Number.MAX_VALUE,S=-Number.MAX_VALUE;for(let b=c;b<u;++b)for(let T=0;T<r;++T)vs.computePosition(t,i,n.st,b,T,y,C),p[m++]=y.x,p[m++]=y.y,p[m++]=y.z,n.st&&(A[_++]=C.x,A[_++]=C.y,E=Math.min(E,C.x),I=Math.min(I,C.y),x=Math.max(x,C.x),S=Math.max(S,C.y));if(a&&(vs.computePosition(t,i,n.st,0,0,y,C),p[m++]=y.x,p[m++]=y.y,p[m++]=y.z,n.st&&(A[_++]=C.x,A[_++]=C.y,E=C.x,I=C.y,x=C.x,S=C.y)),s&&(vs.computePosition(t,i,n.st,o-1,0,y,C),p[m++]=y.x,p[m++]=y.y,p[m]=y.z,n.st&&(A[_++]=C.x,A[_]=C.y,E=Math.min(E,C.x),I=Math.min(I,C.y),x=Math.max(x,C.x),S=Math.max(S,C.y))),n.st&&(E<0||I<0||x>1||S>1))for(let b=0;b<A.length;b+=2)A[b]=(A[b]-E)/(x-E),A[b+1]=(A[b+1]-I)/(S-I);let w=jct(p,n,i,t.tangentRotationMatrix),v=6*(r-1)*(f-1);a&&(v+=3*(r-1)),s&&(v+=3*(r-1));let R=Ue.createTypedArray(h,v),N=0,L=0,g;for(g=0;g<f-1;++g){for(let b=0;b<r-1;++b){let T=N,B=T+r,M=B+1,O=T+1;R[L++]=T,R[L++]=B,R[L++]=O,R[L++]=O,R[L++]=B,R[L++]=M,++N}++N}if(a||s){let b=h-1,T=h-1;a&&s&&(b=h-2);let B,M;if(N=0,a)for(g=0;g<r-1;g++)B=N,M=B+1,R[L++]=b,R[L++]=B,R[L++]=M,++N;if(s)for(N=(f-1)*r,g=0;g<r-1;g++)B=N,M=B+1,R[L++]=B,R[L++]=T,R[L++]=M,++N}return w.indices=R,n.st&&(w.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:A})),w}function ST(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 wT(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 gJ=new ke;function qct(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,a=e._surfaceHeight,s=e._ellipsoid,c=t.height,u=t.width,f;if(n){let rt=ke.clone(o,gJ);rt.normal=!0,e._vertexFormat=rt}let h=a_e(e,t);n&&(e._vertexFormat=o);let p=wi.scaleToGeodeticHeight(h.attributes.position.values,a,s,!1);p=new Float64Array(p);let A=p.length,m=A*2,_=new Float64Array(m);_.set(p);let y=wi.scaleToGeodeticHeight(h.attributes.position.values,r,s);_.set(y,A),h.attributes.position.values=_;let C=o.normal?new Float32Array(m):void 0,E=o.tangent?new Float32Array(m):void 0,I=o.bitangent?new Float32Array(m):void 0,x=o.st?new Float32Array(m/3*2):void 0,S,w;if(o.normal){for(w=h.attributes.normal.values,C.set(w),f=0;f<A;f++)w[f]=-w[f];C.set(w,A),h.attributes.normal.values=C}if(n){w=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let rt=new Float32Array(m);for(f=0;f<A;f++)w[f]=-w[f];rt.set(w,A),h.attributes.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:rt})}let v,R=l(i);if(R){let rt=A/3*2,je=new Uint8Array(rt);i===mn.TOP?je=je.fill(1,0,rt/2):(v=i===mn.NONE?0:1,je=je.fill(v)),h.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:je})}if(o.tangent){let rt=h.attributes.tangent.values;for(E.set(rt),f=0;f<A;f++)rt[f]=-rt[f];E.set(rt,A),h.attributes.tangent.values=E}if(o.bitangent){let rt=h.attributes.bitangent.values;I.set(rt),I.set(rt,A),h.attributes.bitangent.values=I}o.st&&(S=h.attributes.st.values,x.set(S),x.set(S,A/3*2),h.attributes.st.values=x);let N=h.indices,L=N.length,g=A/3,b=Ue.createTypedArray(m/3,L*2);for(b.set(N),f=0;f<L;f+=3)b[f+L]=N[f+2]+g,b[f+1+L]=N[f+1]+g,b[f+2+L]=N[f]+g;h.indices=b;let T=t.northCap,B=t.southCap,M=c,O=2,G=0,k=4,z=4;T&&(O-=1,M-=1,G+=1,k-=2,z-=1),B&&(O-=1,M-=1,G+=1,k-=2,z-=1),G+=O*u+2*M-k;let F=(G+z)*2,H=new Float64Array(F*3),Y=n?new Float32Array(F*3):void 0,$=R?new Uint8Array(F):void 0,W=o.st?new Float32Array(F*2):void 0,K=i===mn.TOP;R&&!K&&(v=i===mn.ALL?1:0,$=$.fill(v));let Z=0,pe=0,ge=0,re=0,ye=u*M,Ce;for(f=0;f<ye;f+=u)Ce=f*3,H=ST(H,Z,Ce,p,y),Z+=6,o.st&&(W=wT(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=w[Ce],Y[ge++]=w[Ce+1],Y[ge++]=w[Ce+2]),K&&($[re++]=1,re+=1);if(B){let rt=T?ye+1:ye;for(Ce=rt*3,f=0;f<2;f++)H=ST(H,Z,Ce,p,y),Z+=6,o.st&&(W=wT(W,pe,rt*2,S),pe+=4),n&&(ge+=3,Y[ge++]=w[Ce],Y[ge++]=w[Ce+1],Y[ge++]=w[Ce+2]),K&&($[re++]=1,re+=1)}else for(f=ye-u;f<ye;f++)Ce=f*3,H=ST(H,Z,Ce,p,y),Z+=6,o.st&&(W=wT(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=w[Ce],Y[ge++]=w[Ce+1],Y[ge++]=w[Ce+2]),K&&($[re++]=1,re+=1);for(f=ye-1;f>0;f-=u)Ce=f*3,H=ST(H,Z,Ce,p,y),Z+=6,o.st&&(W=wT(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=w[Ce],Y[ge++]=w[Ce+1],Y[ge++]=w[Ce+2]),K&&($[re++]=1,re+=1);if(T){let rt=ye;for(Ce=rt*3,f=0;f<2;f++)H=ST(H,Z,Ce,p,y),Z+=6,o.st&&(W=wT(W,pe,rt*2,S),pe+=4),n&&(ge+=3,Y[ge++]=w[Ce],Y[ge++]=w[Ce+1],Y[ge++]=w[Ce+2]),K&&($[re++]=1,re+=1)}else for(f=u-1;f>=0;f--)Ce=f*3,H=ST(H,Z,Ce,p,y),Z+=6,o.st&&(W=wT(W,pe,f*2,S),pe+=4),n&&(ge+=3,Y[ge++]=w[Ce],Y[ge++]=w[Ce+1],Y[ge++]=w[Ce+2]),K&&($[re++]=1,re+=1);let ve=Yct(H,o,s);o.st&&(ve.attributes.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:W})),n&&(ve.attributes.extrudeDirection=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:Y})),R&&(ve.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:$}));let Ne=Ue.createTypedArray(F,G*6),Le,Oe,nt,Fe;A=H.length/3;let _t=0;for(f=0;f<A-1;f+=2){Le=f,Fe=(Le+2)%A;let rt=d.fromArray(H,Le*3,AJ),je=d.fromArray(H,Fe*3,r_e);d.equalsEpsilon(rt,je,D.EPSILON10)||(Oe=(Le+1)%A,nt=(Oe+2)%A,Ne[_t++]=Le,Ne[_t++]=Oe,Ne[_t++]=Fe,Ne[_t++]=Fe,Ne[_t++]=Oe,Ne[_t++]=nt)}return ve.indices=Ne,ve=jn.combineInstances([new Lt({geometry:h}),new Lt({geometry:ve})]),ve[0]}var Kct=[new d,new d,new d,new d],s_e=new me,Xct=new me;function _J(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=vs.computeOptions(e,t,n,0,i_e,s_e),a=r.height,s=r.width,c=Kct;return vs.computePosition(r,i,!1,0,0,c[0]),vs.computePosition(r,i,!1,0,s-1,c[1]),vs.computePosition(r,i,!1,a-1,0,c[2]),vs.computePosition(r,i,!1,a-1,s-1,c[3]),ce.fromCartesianArray(c,i,o)}function Cp(e){e=e??V.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ce.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=ke.clone(e.vertexFormat??ke.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}Cp.packedLength=ce.packedLength+te.packedLength+ke.packedLength+7;Cp.pack=function(e,t,n){return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.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 c_e=new ce,l_e=te.clone(te.UNIT_SPHERE),Py={rectangle:c_e,ellipsoid:l_e,vertexFormat:gJ,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Cp.unpack=function(e,t,n){t=t??0;let i=ce.unpack(e,t,c_e);t+=ce.packedLength;let o=te.unpack(e,t,l_e);t+=te.packedLength;let r=ke.unpack(e,t,gJ);t+=ke.packedLength;let a=e[t++],s=e[t++],c=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=te.clone(o,n._ellipsoid),n._vertexFormat=ke.clone(r,n._vertexFormat),n._granularity=a,n._surfaceHeight=s,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(Py.granularity=a,Py.height=s,Py.rotation=c,Py.stRotation=u,Py.extrudedHeight=f,Py.shadowVolume=h,Py.offsetAttribute=p===-1?void 0:p,new Cp(Py))};Cp.computeRectangle=function(e,t){e=e??V.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??te.default,r=e.rotation??0;return _J(n,i,r,o,t)};var Jct=new J,Zge=new Qe,Zct=new me;Cp.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,a=vs.computeOptions(t,e._granularity,i,o,i_e,s_e,Xct),s=Jct;if(o!==0||i!==0){let A=ce.center(t,Zct),m=n.geodeticSurfaceNormalCartographic(A,AJ);Qe.fromAxisAngle(m,-o,Zge),J.fromQuaternion(Zge,s)}else J.clone(J.IDENTITY,s);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);a.lonScalar=1/e._rectangle.width,a.latScalar=1/e._rectangle.height,a.tangentRotationMatrix=s;let h,p;if(t=e._rectangle,f){h=qct(e,a);let A=le.fromRectangle3D(t,n,c,Wct),m=le.fromRectangle3D(t,n,u,Hct);p=le.union(A,m)}else{if(h=a_e(e,a),h.attributes.position.values=wi.scaleToGeodeticHeight(h.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let A=h.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,_=new Uint8Array(A/3).fill(m);h.attributes.applyOffset=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}p=le.fromRectangle3D(t,n,c)}return r.position||delete h.attributes.position,new yt({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Cp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),a=n(i,o);return new Cp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:a,height:r,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};var $ge=new ce,$ct=[new Q,new Q,new Q],elt=new Ki,tlt=new me;function nlt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,$ge),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=_J(t,n,o,i,$ge),a=$ct;a[0].x=r.west,a[0].y=r.south,a[1].x=r.west,a[1].y=r.north,a[2].x=r.east,a[2].y=r.south;let s=e.rectangle,c=Ki.fromRotation(e._stRotation,elt),u=ce.center(s,tlt);for(let m=0;m<3;++m){let _=a[m];_.x-=u.longitude,_.y-=u.latitude,Ki.multiplyByVector(c,_,_),_.x+=u.longitude,_.y+=u.latitude,_.x=(_.x-s.west)/s.width,_.y=(_.y-s.south)/s.height}let f=a[0],h=a[1],p=a[2],A=new Array(6);return Q.pack(f,A),Q.pack(h,A,2),Q.pack(p,A,4),A}Object.defineProperties(Cp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=_J(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=nlt(this)),this._textureCoordinateRotationPoints}}});var BT=Cp;var u_e=new U,f_e=d.ZERO,d_e=new d,h_e=new ce,ilt=new ce,olt=new me;function rlt(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 Lh(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new rlt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Lh.prototype=Object.create(ri.prototype),Lh.prototype.constructor=Lh);Lh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:$n.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,u_e)),l(o)||(o=U.WHITE),i.color=Jt.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,f_e,d_e))),new Lt({id:t,geometry:new BT(this._options),attributes:i})};Lh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,u_e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=go.fromCartesian3(q.getValueOrDefault(this._terrainOffsetProperty,e,f_e,d_e))),new Lt({id:t,geometry:new kx(this._options),attributes:r})};Lh.prototype._computeCenter=function(e,t){let n=q.getValueOrUndefined(this._entity.rectangle.coordinates,e,ilt);if(!l(n))return;let i=ce.center(n,olt);return me.toCartesian(i,te.default,t)};Lh.prototype._isHidden=function(e,t){return!l(t.coordinates)||Ti.prototype._isHidden.call(this,e,t)};Lh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!q.isConstant(t.height)||!q.isConstant(t.extrudedHeight)||!q.isConstant(t.granularity)||!q.isConstant(t.stRotation)||!q.isConstant(t.rotation)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.zIndex)||this._onTerrain&&!q.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Lh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=q.getValueOrUndefined(t.height,Ze.MINIMUM_VALUE),o=q.getValueOrDefault(t.heightReference,Ze.MINIMUM_VALUE,ot.NONE),r=q.getValueOrUndefined(t.extrudedHeight,Ze.MINIMUM_VALUE),a=q.getValueOrDefault(t.extrudedHeightReference,Ze.MINIMUM_VALUE,ot.NONE);l(r)&&!l(i)&&(i=0);let s=this._options;s.vertexFormat=n?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,s.rectangle=t.coordinates.getValue(Ze.MINIMUM_VALUE,s.rectangle),s.granularity=q.getValueOrUndefined(t.granularity,Ze.MINIMUM_VALUE),s.stRotation=q.getValueOrUndefined(t.stRotation,Ze.MINIMUM_VALUE),s.rotation=q.getValueOrUndefined(t.rotation,Ze.MINIMUM_VALUE),s.offsetAttribute=ri.computeGeometryOffsetAttribute(i,o,r,a),s.height=ri.getGeometryHeight(i,o),r=ri.getGeometryExtrudedHeight(r,a),r===ri.CLAMP_TO_GROUND&&(r=vi.getMinimumMaximumHeights(BT.computeRectangle(s,h_e)).minimumTerrainHeight),s.extrudedHeight=r};Lh.DynamicGeometryUpdater=DT;function DT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(DT.prototype=Object.create(xi.prototype),DT.prototype.constructor=DT);DT.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||xi.prototype._isHidden.call(this,e,t,n)};DT.prototype._setOptions=function(e,t,n){let i=this._options,o=q.getValueOrUndefined(t.height,n),r=q.getValueOrDefault(t.heightReference,n,ot.NONE),a=q.getValueOrUndefined(t.extrudedHeight,n),s=q.getValueOrDefault(t.extrudedHeightReference,n,ot.NONE);l(a)&&!l(o)&&(o=0),i.rectangle=q.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=q.getValueOrUndefined(t.granularity,n),i.stRotation=q.getValueOrUndefined(t.stRotation,n),i.rotation=q.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,a,s),i.height=ri.getGeometryHeight(o,r),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND&&(a=vi.getMinimumMaximumHeights(BT.computeRectangle(i,h_e)).minimumTerrainHeight),i.extrudedHeight=a};var xz=Lh;var m_e={};function alt(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var slt=new me,clt=new me;function llt(e,t,n,i){t=jo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),a=l(n),s=new Array(o),c=new Array(o),u=new Array(o),f=t[0];s[0]=f;let h=e.cartesianToCartographic(f,slt);a&&(h.height=n[0]),c[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=c[0],A=u[0],m=p===A,_=1;for(let y=1;y<o;++y){let C=t[y],E=e.cartesianToCartographic(C,clt);a&&(E.height=n[y]),m=m&&E.height===0,alt(h,E)?h.height<E.height&&(c[_-1]=E.height):(s[_]=C,c[_]=E.height,r?u[_]=i[y]:u[_]=0,m=m&&c[_]===u[_],me.clone(E,h),++_)}if(!(m||_<2))return s.length=_,c.length=_,u.length=_,{positions:s,topHeights:c,bottomHeights:u}}var ult=new Array(2),flt=new Array(2),dlt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};m_e.computePositions=function(e,t,n,i,o,r){let a=llt(e,t,n,i);if(!l(a))return;t=a.positions,n=a.topHeights,i=a.bottomHeights;let s=t.length,c=s-2,u,f,h=D.chordLength(o,e.maximumRadius),p=dlt;if(p.minDistance=h,p.ellipsoid=e,r){let A=0,m;for(m=0;m<s-1;m++)A+=to.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(A*3),f=new Float64Array(A*3);let _=ult,y=flt;p.positions=_,p.height=y;let C=0;for(m=0;m<s-1;m++){_[0]=t[m],_[1]=t[m+1],y[0]=n[m],y[1]=n[m+1];let E=to.generateArc(p);u.set(E,C),y[0]=i[m],y[1]=i[m+1],f.set(to.generateArc(p),C),C+=E.length}}else p.positions=t,p.height=n,u=new Float64Array(to.generateArc(p)),p.height=i,f=new Float64Array(to.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var vT=m_e;var yJ=new d,Tz=new d,hlt=new d,p_e=new d,mlt=new d,plt=new d,Alt=new d;function p0(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??ke.DEFAULT,r=e.granularity??D.RADIANS_PER_DEGREE,a=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=ke.clone(o),this._granularity=r,this._ellipsoid=te.clone(a),this._workerName="createWallGeometry";let s=1+t.length*d.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+te.packedLength+ke.packedLength+1}p0.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._minimumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];let s=e._maximumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n]=e._granularity,t};var A_e=te.clone(te.UNIT_SPHERE),g_e=new ke,Lv={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:A_e,vertexFormat:g_e,granularity:void 0};p0.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];let c=te.unpack(e,t,A_e);t+=te.packedLength;let u=ke.unpack(e,t,g_e);t+=ke.packedLength;let f=e[t];return l(n)?(n._positions=r,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._vertexFormat=ke.clone(u,n._vertexFormat),n._granularity=f,n):(Lv.positions=r,Lv.minimumHeights=a,Lv.maximumHeights=s,Lv.granularity=f,new p0(Lv))};p0.fromConstantHeights=function(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,a=l(o),s=l(r);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=o),s&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new p0(c)};p0.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,a=e._ellipsoid,s=vT.computePositions(a,t,i,n,r,!0);if(!l(s))return;let c=s.bottomPositions,u=s.topPositions,f=s.numCorners,h=u.length,p=h*2,A=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,_=o.tangent?new Float32Array(p):void 0,y=o.bitangent?new Float32Array(p):void 0,C=o.st?new Float32Array(p/3*2):void 0,E=0,I=0,x=0,S=0,w=0,v=Alt,R=plt,N=mlt,L=!0;h/=3;let g,b=0,T=1/(h-f-1);for(g=0;g<h;++g){let k=g*3,z=d.fromArray(u,k,yJ),F=d.fromArray(c,k,Tz);if(o.position&&(A[E++]=F.x,A[E++]=F.y,A[E++]=F.z,A[E++]=z.x,A[E++]=z.y,A[E++]=z.z),o.st&&(C[w++]=b,C[w++]=0,C[w++]=b,C[w++]=1),o.normal||o.tangent||o.bitangent){let H=d.clone(d.ZERO,p_e),Y=d.subtract(z,a.geodeticSurfaceNormal(z,Tz),Tz);if(g+1<h&&(H=d.fromArray(u,k+3,p_e)),L){let $=d.subtract(H,z,hlt),W=d.subtract(Y,z,yJ);v=d.normalize(d.cross(W,$,v),v),L=!1}d.equalsEpsilon(z,H,D.EPSILON10)?L=!0:(b+=T,o.tangent&&(R=d.normalize(d.subtract(H,z,R),R)),o.bitangent&&(N=d.normalize(d.cross(v,R,N),N))),o.normal&&(m[I++]=v.x,m[I++]=v.y,m[I++]=v.z,m[I++]=v.x,m[I++]=v.y,m[I++]=v.z),o.tangent&&(_[S++]=R.x,_[S++]=R.y,_[S++]=R.z,_[S++]=R.x,_[S++]=R.y,_[S++]=R.z),o.bitangent&&(y[x++]=N.x,y[x++]=N.y,y[x++]=N.z,y[x++]=N.x,y[x++]=N.y,y[x++]=N.z)}}let B=new En;o.position&&(B.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:A})),o.normal&&(B.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(B.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:_})),o.bitangent&&(B.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:y})),o.st&&(B.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:C}));let M=p/3;p-=6*(f+1);let O=Ue.createTypedArray(M,p),G=0;for(g=0;g<M-2;g+=2){let k=g,z=g+2,F=d.fromArray(A,k*3,yJ),H=d.fromArray(A,z*3,Tz);if(d.equalsEpsilon(F,H,D.EPSILON10))continue;let Y=g+1,$=g+3;O[G++]=Y,O[G++]=k,O[G++]=$,O[G++]=$,O[G++]=k,O[G++]=z}return new yt({attributes:B,indices:O,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromVertices(A)})};var Sz=p0;var __e=new d,y_e=new d;function A0(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??te.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=te.clone(r),this._workerName="createWallOutlineGeometry";let a=1+t.length*d.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+te.packedLength+1}A0.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._minimumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];let s=e._maximumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n]=e._granularity,t};var C_e=te.clone(te.UNIT_SPHERE),Ov={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:C_e,granularity:void 0};A0.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];let c=te.unpack(e,t,C_e);t+=te.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=a,n._maximumHeights=s,n._ellipsoid=te.clone(c,n._ellipsoid),n._granularity=u,n):(Ov.positions=r,Ov.minimumHeights=a,Ov.maximumHeights=s,Ov.granularity=u,new A0(Ov))};A0.fromConstantHeights=function(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,a=l(o),s=l(r);if(a||s){let u=t.length;n=a?new Array(u):void 0,i=s?new Array(u):void 0;for(let f=0;f<u;++f)a&&(n[f]=o),s&&(i[f]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new A0(c)};A0.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,a=vT.computePositions(r,t,i,n,o,!1);if(!l(a))return;let s=a.bottomPositions,c=a.topPositions,u=c.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let A;for(A=0;A<u;++A){let E=A*3,I=d.fromArray(c,E,__e),x=d.fromArray(s,E,y_e);h[p++]=x.x,h[p++]=x.y,h[p++]=x.z,h[p++]=I.x,h[p++]=I.y,h[p++]=I.z}let m=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h})}),_=f/3;f=2*_-4+_;let y=Ue.createTypedArray(_,f),C=0;for(A=0;A<_-2;A+=2){let E=A,I=A+2,x=d.fromArray(h,E*3,__e),S=d.fromArray(h,I*3,y_e);if(d.equalsEpsilon(x,S,D.EPSILON10))continue;let w=A+1,v=A+3;y[C++]=w,y[C++]=E,y[C++]=w,y[C++]=v,y[C++]=E,y[C++]=I}return y[C++]=_-2,y[C++]=_-1,new yt({attributes:m,indices:y,primitiveType:Pe.LINES,boundingSphere:le.fromVertices(h)})};var wz=A0;var E_e=new U;function glt(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 Oh(e,t){Ti.call(this,{entity:e,scene:t,geometryOptions:new glt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Oh.prototype=Object.create(Ti.prototype),Oh.prototype.constructor=Oh);Oh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),s=$n.fromDistanceDisplayCondition(a);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,E_e)),l(c)||(c=U.WHITE),o=Jt.fromColor(c),i={show:r,distanceDisplayCondition:s,color:o}}else i={show:r,distanceDisplayCondition:s};return new Lt({id:t,geometry:new Sz(this._options),attributes:i})};Oh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=q.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,E_e),o=this._distanceDisplayConditionProperty.getValue(e);return new Lt({id:t,geometry:new wz(this._options),attributes:{show:new wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:$n.fromDistanceDisplayCondition(o)}})};Oh.prototype._isHidden=function(e,t){return!l(t.positions)||Ti.prototype._isHidden.call(this,e,t)};Oh.prototype._getIsClosed=function(e){return!1};Oh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!q.isConstant(t.minimumHeights)||!q.isConstant(t.maximumHeights)||!q.isConstant(t.outlineWidth)||!q.isConstant(t.granularity)};Oh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Kt,a=this._options;a.vertexFormat=r?gn.VERTEX_FORMAT:_o.MaterialSupport.TEXTURED.vertexFormat,a.positions=t.positions.getValue(Ze.MINIMUM_VALUE,a.positions),a.minimumHeights=l(n)?n.getValue(Ze.MINIMUM_VALUE,a.minimumHeights):void 0,a.maximumHeights=l(i)?i.getValue(Ze.MINIMUM_VALUE,a.maximumHeights):void 0,a.granularity=l(o)?o.getValue(Ze.MINIMUM_VALUE):void 0};Oh.DynamicGeometryUpdater=PT;function PT(e,t,n){xi.call(this,e,t,n)}l(Object.create)&&(PT.prototype=Object.create(xi.prototype),PT.prototype.constructor=PT);PT.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||xi.prototype._isHidden.call(this,e,t,n)};PT.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=q.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=q.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=q.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=q.getValueOrUndefined(t.granularity,n)};var Bz=Oh;var g0=[fF,zU,MU,lz,uz,Az,Cz,bz,xz,Bz];function _0(e,t){this.entity=e,this.scene=t;let n=new Array(g0.length),i=new _e,o=new Hr;for(let r=0;r<n.length;r++){let a=new g0[r](e,t);o.add(a.geometryChanged,s=>{i.raiseEvent(s)}),n[r]=a}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(_0.prototype._onEntityPropertyChanged,this)}_0.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)};_0.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};_0.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),fe(this)};_0.registerUpdater=function(e){g0.includes(e)||g0.push(e)};_0.unregisterUpdater=function(e){if(g0.includes(e)){let t=g0.indexOf(e);g0.splice(t,1)}};var RT=_0;var I_e=new U,_lt=new Gt,ylt=new Gt,Clt=d.ZERO,Elt=new d;function Fh(e,t,n,i,o,r,a){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=a,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.updaters=new Ft,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.subscriptions=new Ft,this.showsUpdated=new Ft,this.itemsToRemove=[],this.invalidated=!1;let s;l(o)&&(s=o.definitionChanged.addEventListener(Fh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=s}Fh.prototype.onMaterialChanged=function(){this.invalidated=!0};Fh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Fh.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||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Fh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Fh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Ln({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,C=q.getValueOrDefault(y,e,U.WHITE,I_e);U.equals(h._lastColor,C)||(h._lastColor=U.clone(C,h._lastColor),h.color=Jt.toValue(C,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let y=u.depthFailMaterialProperty.color,C=q.getValueOrDefault(y,e,U.WHITE,I_e);U.equals(h._lastDepthFailColor,C)||(h._lastDepthFailColor=U.clone(C,h._lastDepthFailColor),h.depthFailColor=Jt.toValue(C,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=wn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let y=q.getValueOrDefault(m,e,ylt,_lt);Gt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Gt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(y,h.distanceDisplayCondition))}let _=u.terrainOffsetProperty;if(!q.isConstant(_)){let y=q.getValueOrDefault(_,e,Clt,Elt);d.equals(y,h._lastOffset)||(h._lastOffset=d.clone(y,h._lastOffset),h.offset=go.toValue(y,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Fh.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=wn.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Fh.prototype.contains=function(e){return this.updaters.contains(e.id)};Fh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};Fh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function MT(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}MT.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 s=0;s<r;s++){let c=n[s];if(c.isMaterial(t)){c.add(t,o);return}}let a=new Fh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);a.add(t,o),n.push(a)};function b_e(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}MT.prototype.remove=function(e){b_e(this._solidItems,e)||b_e(this._translucentItems,e)};function x_e(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let a=t[r],s=a.itemsToRemove,c=s.length;if(c>0)for(r=0;r<c;r++){let u=s[r];a.remove(u),e.add(n,u),i=!0}}return i}function Dz(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let a=t[r];if(a.invalidated){t.splice(r,1);let s=a.updaters.values,c=s.length;for(let u=0;u<c;u++)e.add(n,s[u]);a.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}MT.prototype.update=function(e){let t=Dz(this,this._solidItems,e,!0);t=Dz(this,this._translucentItems,e,t)&&t;let n=x_e(this,this._solidItems,e),i=x_e(this,this._translucentItems,e);return(n||i)&&(t=Dz(this,this._solidItems,e,t)&&t,t=Dz(this,this._translucentItems,e,t)&&t),t};function T_e(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return Ct.FAILED}MT.prototype.getBoundingSphere=function(e,t){let n=T_e(this._solidItems,e,t);return n===Ct.FAILED?T_e(this._translucentItems,e,t):n};function S_e(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}MT.prototype.removeAllPrimitives=function(){S_e(this._solidItems),S_e(this._translucentItems)};var Qh=MT;var Ilt=new Gt,blt=new Gt,xlt=d.ZERO,Tlt=new d;function kh(e,t,n,i,o,r,a){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=a,this.updaters=new Ft,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(kh.prototype.onMaterialChanged,this),this.subscriptions=new Ft,this.showsUpdated=new Ft}kh.prototype.onMaterialChanged=function(){this.invalidated=!0};kh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};kh.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||!q.isConstant(t.distanceDisplayConditionProperty)||!q.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};kh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var Slt=new U;kh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=vr.getValue(e,this.materialProperty,this.material);let s;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;s=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Ln({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:s,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=vr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=vr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let y=c.depthFailMaterialProperty.color,C=q.getValueOrDefault(y,e,U.WHITE,Slt);U.equals(h._lastDepthFailColor,C)||(h._lastDepthFailColor=U.clone(C,h._lastDepthFailColor),h.depthFailColor=Jt.toValue(C,h.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=wn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let y=q.getValueOrDefault(m,e,blt,Ilt);Gt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Gt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(y,h.distanceDisplayCondition))}let _=c.terrainOffsetProperty;if(!q.isConstant(_)){let y=q.getValueOrDefault(_,e,xlt,Tlt);d.equals(y,h._lastOffset)||(h._lastOffset=d.clone(y,h._lastOffset),h.offset=go.toValue(y,h.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};kh.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,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=wn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};kh.prototype.contains=function(e){return this.updaters.contains(e.id)};kh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};kh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function NT(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}NT.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let a=n[r];if(a.isMaterial(t)){a.add(e,t);return}}let o=new kh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};NT.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}}};NT.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 a=r.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};NT.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 Ct.FAILED};NT.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 Uh=NT;function vz(e,t,n=0,i=e.length-1,o=wlt){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),h=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*h*(c-h)/c)*(u-c/2<0?-1:1),A=Math.max(n,Math.floor(t-u*h/c+p)),m=Math.min(i,Math.floor(t+(c-u)*h/c+p));vz(e,t,A,m,o)}let r=e[t],a=n,s=i;for(Fv(e,n,t),o(e[i],r)>0&&Fv(e,n,i);a<s;){for(Fv(e,a,s),a++,s--;o(e[a],r)<0;)a++;for(;o(e[s],r)>0;)s--}o(e[n],r)===0?Fv(e,n,s):(s++,Fv(e,s,i)),s<=t&&(n=s+1),t<=s&&(i=s-1)}}function Fv(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function wlt(e,t){return e<t?-1:e>t?1:0}var Uv=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!Rz(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let a=0;a<n.children.length;a++){let s=n.children[a],c=n.leaf?o(s):s;Rz(t,c)&&(n.leaf?i.push(s):EJ(t,c)?this._all(s,i):r.push(s))}n=r.pop()}return i}collides(t){let n=this.data;if(!Rz(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],a=n.leaf?this.toBBox(r):r;if(Rz(t,a)){if(n.leaf||EJ(t,a))return!0;i.push(r)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=OT([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],a=[],s,c,u;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],s=a.pop(),u=!0),i.leaf){let f=Blt(t,i.children,n);if(f!==-1)return i.children.splice(f,1),r.push(i),this._condense(r),this}!u&&!i.leaf&&EJ(i,o)?(r.push(i),a.push(s),s=0,c=i,i=i.children[0]):c?(s++,i=c.children[s],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,o){let r=i-n+1,a=this._maxEntries,s;if(r<=a)return s=OT(t.slice(n,i+1)),LT(s,this.toBBox),s;o||(o=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,o-1))),s=OT([]),s.leaf=!1,s.height=o;let c=Math.ceil(r/a),u=c*Math.ceil(Math.sqrt(a));w_e(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let h=Math.min(f+u-1,i);w_e(t,f,h,c,this.compareMinY);for(let p=f;p<=h;p+=c){let A=Math.min(p+c-1,h);s.children.push(this._build(t,p,A,o-1))}}return LT(s,this.toBBox),s}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,a=1/0,s;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=CJ(u),h=Plt(t,u)-f;h<a?(a=h,r=f<r?f:r,s=u):h===a&&f<r&&(r=f,s=u)}n=s||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],a=this._chooseSubtree(o,this.data,n,r);for(a.children.push(t),kv(a,o);n>=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let a=this._chooseSplitIndex(i,r,o),s=OT(i.children.splice(a,i.children.length-a));s.height=i.height,s.leaf=i.leaf,LT(i,this.toBBox),LT(s,this.toBBox),n?t[n-1].children.push(s):this._splitRoot(i,s)}_splitRoot(t,n){this.data=OT([t,n]),this.data.height=t.height+1,this.data.leaf=!1,LT(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,a=1/0;for(let s=n;s<=i-n;s++){let c=Qv(t,0,s,this.toBBox),u=Qv(t,s,i,this.toBBox),f=Rlt(c,u),h=CJ(c)+CJ(u);f<r?(r=f,o=s,a=h<a?h:a):f===r&&h<a&&(a=h,o=s)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:Dlt,r=t.leaf?this.compareMinY:vlt,a=this._allDistMargin(t,n,i,o),s=this._allDistMargin(t,n,i,r);a<s&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,a=Qv(t,0,n,r),s=Qv(t,i-n,i,r),c=Pz(a)+Pz(s);for(let u=n;u<i-n;u++){let f=t.children[u];kv(a,t.leaf?r(f):f),c+=Pz(a)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];kv(s,t.leaf?r(f):f),c+=Pz(s)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)kv(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():LT(t[n],this.toBBox)}};function Blt(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function LT(e,t){Qv(e,0,e.children.length,t,e)}function Qv(e,t,n,i,o){o||(o=OT(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r=t;r<n;r++){let a=e.children[r];kv(o,e.leaf?i(a):a)}return o}function kv(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Dlt(e,t){return e.minX-t.minX}function vlt(e,t){return e.minY-t.minY}function CJ(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Pz(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Plt(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Rlt(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),o=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function EJ(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Rz(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function OT(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function w_e(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let a=t+Math.ceil((n-t)/i/2)*i;vz(e,a,t,n,o),r.push(t,a,a,n)}}function Mz(){this._tree=new Uv}function y0(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}y0.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};Mz.prototype.insert=function(e,t){let n=y0.fromRectangleAndId(e,t,new y0);this._tree.insert(n)};function Mlt(e,t){return e.id===t.id}var Nlt=new y0;Mz.prototype.remove=function(e,t){let n=y0.fromRectangleAndId(e,t,Nlt);this._tree.remove(n,Mlt)};var Llt=new y0;Mz.prototype.collides=function(e){let t=y0.fromRectangleAndId("",e,Llt);return this._tree.collides(t)};var FT=Mz;var Olt=new U,Flt=new Gt,Qlt=new Gt;function og(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.updaters=new Ft,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.subscriptions=new Ft,this.showsUpdated=new Ft,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new FT}og.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};og.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||!q.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};og.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};og.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Zl({show:!1,asynchronous:!0,geometryInstances:a.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||c){let _=u.fillMaterialProperty.color,y=q.getValueOrDefault(_,e,U.WHITE,Olt);U.equals(h._lastColor,y)||(h._lastColor=U.clone(y,h._lastColor),h.color=Jt.toValue(y,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=wn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let _=q.getValueOrDefault(m,e,Qlt,Flt);Gt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Gt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(_,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};og.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=wn.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};og.prototype.contains=function(e){return this.updaters.contains(e.id)};og.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Ct.DONE):Ct.FAILED};og.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function QT(e,t){this._batches=[],this._primitives=e,this._classificationType=t}QT.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=q.getValueOrDefault(t.zIndex,0),r,a=i.length;for(let s=0;s<a;++s){let c=i[s];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new og(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};QT.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};QT.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 a=o[t],s=a.itemsToRemove,c=s.length;for(let u=0;u<c;u++){n=s[u],a.remove(n);let f=this.add(e,n);a.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let a=o[t];a.isDirty&&(i=o[t].update(e)&&i,a.isDirty=!1),a.geometry.length===0&&o.splice(t,1)}return i};QT.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 Ct.FAILED};QT.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var zv=QT;var klt=new Gt,Ult=new Gt;function Ep(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ft,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.material=void 0,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.subscriptions=new Ft,this.showsUpdated=new Ft,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new FT}Ep.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Ep.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};Ep.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||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,a,s,c){a==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Ep.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Ep.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=vr.getValue(e,this.materialProperty,this.material);let s=this.appearanceType;n=new Zl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new s({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=vr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=wn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let _=q.getValueOrDefault(m,e,Ult,klt);Gt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Gt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(_,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Ep.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,a=this.geometry.get(o.id),s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=wn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Ep.prototype.contains=function(e){return this.updaters.contains(e.id)};Ep.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};Ep.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function kT(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}kT.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Yf.shouldUseSphericalCoordinates(o.geometry.rectangle),a=q.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===a&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let s=new Ep(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,a);s.add(e,t,o),n.push(s)};kT.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};kT.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};kT.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 Ct.FAILED};kT.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 Nz=kT;var zlt=new U,Glt=new Gt,Vlt=new Gt,Hlt=d.ZERO,Wlt=new d;function rg(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.updaters=new Ft,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.itemsToRemove=[],this.subscriptions=new Ft,this.showsUpdated=new Ft}rg.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||!q.isConstant(e.distanceDisplayConditionProperty)||!q.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,a,s){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};rg.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};rg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let a=this.geometry.values;if(a.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Ln({show:!1,asynchronous:!0,geometryInstances:a.slice(),appearance:new gn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let a=this.updatersWithAttributes.values,s=a.length,c=this.waitingOnCreate;for(r=0;r<s;r++){let u=a[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(l(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||c){let y=u.outlineColorProperty,C=q.getValueOrDefault(y,e,U.WHITE,zlt);U.equals(h._lastColor,C)||(h._lastColor=U.clone(C,h._lastColor),h.color=Jt.toValue(C,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),A=h.show[0]===1;p!==A&&(h.show=wn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!q.isConstant(m)){let y=q.getValueOrDefault(m,e,Vlt,Glt);Gt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Gt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(y,h.distanceDisplayCondition))}let _=u.terrainOffsetProperty;if(!q.isConstant(_)){let y=q.getValueOrDefault(_,e,Hlt,Wlt);d.equals(y,h._lastOffset)||(h._lastOffset=d.clone(y,h._lastOffset),h.offset=go.toValue(y,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};rg.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),a=this.attributes.get(r.id.id);l(a)||(a=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,a));let s=o.entity.isShowing,c=a.show[0]===1;s!==c&&(a.show=wn.toValue(s,a.show),r.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};rg.prototype.contains=function(e){return this.updaters.contains(e.id)};rg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};rg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function UT(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ft,this._translucentBatches=new Ft}UT.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new rg(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new rg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};UT.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};UT.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,a=r.length,s=this._translucentBatches.values,c=s.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<a;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=s[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};UT.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let s=i[n];if(s.contains(e))return s.getBoundingSphere(e,t)}let r=this._translucentBatches.values,a=r.length;for(n=0;n<a;n++){let s=r[n];if(s.contains(e))return s.getBoundingSphere(e,t)}return Ct.FAILED};UT.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 Gv=UT;var jlt=[];function Eu(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ft,this._removedObjects=new Ft,this._changedObjects=new Ft;let o=Bn.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 a;for(a=0;a<o;++a)this._outlineBatches[a]=new Gv(n,e,a,!1),this._outlineBatches[o+a]=new Gv(n,e,a,!0),this._closedColorBatches[a]=new Qh(n,gn,void 0,!0,a,!0),this._closedColorBatches[o+a]=new Qh(n,gn,void 0,!0,a,!1),this._closedMaterialBatches[a]=new Uh(n,_o,void 0,!0,a,!0),this._closedMaterialBatches[o+a]=new Uh(n,_o,void 0,!0,a,!1),this._openColorBatches[a]=new Qh(n,gn,void 0,!1,a,!0),this._openColorBatches[o+a]=new Qh(n,gn,void 0,!1,a,!1),this._openMaterialBatches[a]=new Uh(n,_o,void 0,!1,a,!0),this._openMaterialBatches[o+a]=new Uh(n,_o,void 0,!1,a,!1);let s=ei.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(s),u=[];if(r)for(a=0;a<s;++a)u.push(new Nz(i,a,_o)),c[a]=new zv(i,a);else for(a=0;a<s;++a)c[a]=new zv(i,a);this._groundColorBatches=c,this._groundMaterialBatches=u,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 Ft,this._updaterSets=new Ft,this._entityCollection=t,t.collectionChanged.addEventListener(Eu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,jlt)}Eu.registerUpdater=function(e){RT.registerUpdater(e)};Eu.unregisterUpdater=function(e){RT.unregisterUpdater(e)};Eu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,a=r.values,s,c,u,f,h=this;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(_){h._removeUpdater(_),h._insertUpdaterIntoBatch(e,_)}):(o.push(c),n.push(c));for(s=o.length-1;s>-1;s--)c=o[s],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new RT(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(_){h._insertUpdaterIntoBatch(e,_)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Eu._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,A=this._batches,m=A.length;for(s=0;s<m;s++)p=A[s].update(e)&&p;return p};var Ylt=[],qlt=new le;Eu.prototype.getBoundingSphere=function(e,t){let n=Ylt,i=qlt,o=0,r=Ct.DONE,a=this._batches,s=a.length,c=e.id;if(!this._updaterSets.get(c))return Ct.FAILED;let u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<s;p++){if(r=a[p].getBoundingSphere(h,i),r===Ct.PENDING)return Ct.PENDING;r===Ct.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?Ct.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),Ct.DONE)};Eu.prototype.isDestroyed=function(){return!1};Eu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Eu.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),fe(this)};Eu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Eu.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=Bn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Eu._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Eu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(o.set(s,c),r.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,o.remove(s)?r.set(s,c):i.set(s,c)};var Lz=Eu;var Klt=1,Xlt="30px sans-serif",Jlt=Ir.FILL,Zlt=U.WHITE,$lt=U.BLACK,eut=1,tut=!1,nut=new U(.165,.165,.165,.8),iut=new Q(7,5),out=Q.ZERO,rut=d.ZERO,aut=ot.NONE,sut=Ni.CENTER,cut=Yn.CENTER,lut=new d,uut=new U,fut=new U,dut=new U,hut=new Q,mut=new d,put=new Q,Aut=new Ht,gut=new Ht,_ut=new Ht,yut=new Gt;function B_e(e){this.entity=e,this.label=void 0,this.index=void 0}function Ry(e,t){t.collectionChanged.addEventListener(Ry.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}Ry.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],a=r.entity,s=a._label,c,u=r.label,f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;if(f&&(h=q.getValueOrUndefined(a._position,e,lut),c=q.getValueOrUndefined(s._text,e),f=l(h)&&l(c)),!f){IJ(r,a,n);continue}q.isConstant(a._position)||(n._clusterDirty=!0);let p=!1,A=q.getValueOrDefault(s._heightReference,e,aut);l(u)||(u=n.getLabel(a),u.id=a,r.label=u,p=d.equals(u.position,h)&&u.heightReference===A),u.show=!0,u.position=h,u.text=c,u.scale=q.getValueOrDefault(s._scale,e,Klt),u.font=q.getValueOrDefault(s._font,e,Xlt),u.style=q.getValueOrDefault(s._style,e,Jlt),u.fillColor=q.getValueOrDefault(s._fillColor,e,Zlt,uut),u.outlineColor=q.getValueOrDefault(s._outlineColor,e,$lt,fut),u.outlineWidth=q.getValueOrDefault(s._outlineWidth,e,eut),u.showBackground=q.getValueOrDefault(s._showBackground,e,tut),u.backgroundColor=q.getValueOrDefault(s._backgroundColor,e,nut,dut),u.backgroundPadding=q.getValueOrDefault(s._backgroundPadding,e,iut,hut),u.pixelOffset=q.getValueOrDefault(s._pixelOffset,e,out,put),u.eyeOffset=q.getValueOrDefault(s._eyeOffset,e,rut,mut),u.heightReference=A,u.horizontalOrigin=q.getValueOrDefault(s._horizontalOrigin,e,sut),u.verticalOrigin=q.getValueOrDefault(s._verticalOrigin,e,cut),u.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,Aut),u.pixelOffsetScaleByDistance=q.getValueOrUndefined(s._pixelOffsetScaleByDistance,e,gut),u.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,_ut),u.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,yut),u.disableDepthTestDistance=q.getValueOrUndefined(s._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};Ry.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Ct.FAILED;let i=n.label;return t.center=d.clone(i._clampedPosition??i.position,t.center),t.radius=0,Ct.DONE};Ry.prototype.isDestroyed=function(){return!1};Ry.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ry.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return fe(this)};Ry.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&a.set(r.id,new B_e(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?a.contains(r.id)||a.set(r.id,new B_e(r)):(IJ(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],IJ(a.get(r.id),r,s),a.remove(r.id)};function IJ(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var Oz=Ry;var Cut=1,Eut=!0,Iut=0,but=!0,xut=!0,Tut=Bn.ENABLED,Sut=ot.NONE,wut=U.RED,But=0,Dut=U.WHITE,vut=bl.HIGHLIGHT,Put=.5,Rut=new Q(1,1),D_e={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Mut=new P,Nut=new P,v_e=new U,P_e=new Array(4),Lut=new d;function My(e,t){t.collectionChanged.addEventListener(My.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ft,this._onCollectionChanged(t,t.values,[],[])}async function Out(e,t,n,i,o){let r=e._primitives,a=e._modelHash;try{let s=await ad.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(a[t.id]))return;s._marsOptions=t._model?._marsOptions,s.id=t,r.add(s),a[t.id].modelPrimitive=s,s.errorEvent.addEventListener(c=>{l(a[t.id])&&(console.log(c),c.name!=="TextureError"&&s.incrementallyLoadTextures&&(a[t.id].loadFailed=!0))})}catch(s){if(e.isDestroyed()||!l(a[t.id]))return;console.log(s),a[t.id].loadFailed=!0}}My.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let a=t[o],s=a._model,c,u=n[a.id],f=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),h;if(f&&(h=a.computeModelMatrix(e,Mut),c=De.createIfNeeded(q.getValueOrUndefined(s._uri,e)),f=l(h)&&l(c)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!l(u)||c.url!==u.url){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[a.id]),u={modelPrimitive:void 0,url:c.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...D_e}},n[a.id]=u;let m=q.getValueOrDefault(s._incrementallyLoadTextures,e,but),_=q.getValueOrDefault(s._environmentMapOptions,e,D_e,u.environmentMapOptionsScratch);Out(this,a,c,m,_)}let p=u.modelPrimitive;if(!l(p))continue;p.show=!0,p.scale=q.getValueOrDefault(s._scale,e,Cut),p.enableVerticalExaggeration=q.getValueOrDefault(s._enableVerticalExaggeration,e,Eut),p.minimumPixelSize=q.getValueOrDefault(s._minimumPixelSize,e,Iut),p.maximumScale=q.getValueOrUndefined(s._maximumScale,e),p.modelMatrix=P.clone(h,p.modelMatrix),p.shadows=q.getValueOrDefault(s._shadows,e,Tut),p.heightReference=q.getValueOrDefault(s._heightReference,e,Sut),p.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e),p.silhouetteColor=q.getValueOrDefault(s._silhouetteColor,e,wut,v_e),p.silhouetteSize=q.getValueOrDefault(s._silhouetteSize,e,But),p.color=q.getValueOrDefault(s._color,e,Dut,v_e),p.colorBlendMode=q.getValueOrDefault(s._colorBlendMode,e,vut),p.colorBlendAmount=q.getValueOrDefault(s._colorBlendAmount,e,Put),p.clippingPlanes=q.getValueOrUndefined(s._clippingPlanes,e),p.clampAnimations=q.getValueOrDefault(s._clampAnimations,e,xut),p.imageBasedLighting.imageBasedLightingFactor=q.getValueOrDefault(s._imageBasedLightingFactor,e,Rut);let A=q.getValueOrUndefined(s._lightColor,e);if(l(A)&&(U.pack(A,P_e,0),A=d.unpack(P_e,0,Lut)),p.lightColor=A,p.customShader=q.getValueOrUndefined(s._customShader,e),n[a.id].modelUpdated=!0,p.ready){!s._readyOk&&s._marsOptions&&s._marsOptions.callback&&(s._marsOptions.callback(a,p),s._readyOk=!0);let m=q.getValueOrDefault(s._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:Ju.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let _=q.getValueOrUndefined(s._nodeTransformations,e,u.nodeTransformationsScratch);if(l(_)){let E=Object.keys(_);for(let I=0,x=E.length;I<x;++I){let S=E[I],w=_[S];if(!l(w))continue;let v=p.getNode(S);if(!l(v))continue;let R=P.fromTranslationRotationScale(w,Nut);v.matrix=P.multiply(v.originalMatrix,R,R)}}let y=!1,C=q.getValueOrUndefined(s._articulations,e,u.articulationsScratch);if(l(C)){let E=Object.keys(C);for(let I=0,x=E.length;I<x;++I){let S=E[I],w=C[S];l(w)&&(y=!0,p.setArticulationStage(S,w))}}y&&p.applyArticulations()}}return!0};My.prototype.isDestroyed=function(){return!1};My.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(My.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)bJ(this,e[i],t,n);return fe(this)};var Fz=new d,Fut=new me;My.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Ct.FAILED;if(n.loadFailed)return Ct.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Ct.PENDING;if(!i.ready||!n.modelUpdated)return Ct.PENDING;let o=this._scene,r=o.ellipsoid??te.default;if(i.heightReference!==ot.NONE){let s=i.modelMatrix;Fz.x=s[12],Fz.y=s[13],Fz.z=s[14];let c=r.cartesianToCartographic(Fz,Fut),u=o.getHeight(c,i.heightReference);return l(u)&&(Hf(i.heightReference)?c.height=u:c.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Ct.DONE}return le.clone(i.boundingSphere,t),Ct.DONE};My.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._entitiesToVisualize,s=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&a.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(Qut(r,s),a.set(r.id,r)):(bJ(this,r,s,c),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],bJ(this,r,s,c),a.remove(r.id)};function bJ(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Qut(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var Qz=My;function Ny(e){this._definitionChanged=new _e,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Ny.prototype,{isConstant:{get:function(){return q.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Oi.FIXED}}});var kut=new X;Ny.prototype.getValue=function(e,t){return l(e)||(e=X.now(kut)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Ny.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Ny.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?te.default.scaleToGeodeticSurface(n,n):void 0};Ny.prototype.equals=function(e){return this===e||e instanceof Ny&&this._value===e._value};Ny.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var ag=Ny;var R_e=new J,M_e=new J,N_e=new J,Uut=new d,L_e=new d,zut=new d,Gut=new d,kz=new Qe,Uz=new P,zz=new J;function Vv(e,t,n,i,o){if(!(!l(t)||!l(n))){if(d.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,kz)&&(Qe.conjugate(kz,kz),J.fromQuaternion(kz,zz),J.multiplyByVector(zz,o,o));else if(l(SJ(e,i.position,Uz)))P.inverse(Uz,Uz),P.getRotation(Uz,zz),J.multiplyByVector(zz,o,o);else return;return o}}function SJ(e,t,n){let i=t.getValue(e,Uut);if(l(i)){let o=X.addSeconds(e,.01,new X),r=t.getValue(o,L_e);if(l(r)&&!d.equalsEpsilon(i,r,D.EPSILON16)){let a=At.computeFixedToIcrfMatrix(e,R_e),s=At.computeFixedToIcrfMatrix(o,M_e),c;!l(a)||!l(s)?(c=At.computeTemeToPseudoFixedMatrix(e,N_e),a=J.transpose(c,R_e),s=At.computeTemeToPseudoFixedMatrix(o,M_e),J.transpose(s,s)):c=J.transpose(a,N_e);let u=zut;d.normalize(i,u),d.normalize(r,r),J.multiplyByVector(a,u,u),J.multiplyByVector(s,r,r);let f=d.cross(u,r,Gut);if(!d.equalsEpsilon(f,d.ZERO,D.EPSILON16)){let h=d.cross(f,u,L_e);return J.multiplyByVector(c,h,h),J.multiplyByVector(c,f,f),J.multiplyByVector(c,u,u),d.normalize(h,h),d.normalize(f,f),d.normalize(u,u),l(n)||(n=new P),n[0]=h.x,n[1]=h.y,n[2]=h.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var Vut=60,Hut=1,U_e=new Rn,xJ=new Rn,TJ=new Rn;function O_e(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}var Gz=new d;function Wut(e,t,n,i,o,r,a,s,c){let u,f,h=!1;r instanceof $o&&(u=r,f=u.position,r=Oi.FIXED,h=!0);let p=s,A,m;A=e.getValueInReferenceFrame(t,r,c[p]),h?(m=f.getValueInReferenceFrame(t,r,Gz),A=Vv(t,A,m,u,A),l(A)&&(c[p++]=A)):l(A)&&(c[p++]=A);let _=!l(o)||X.lessThanOrEquals(o,t)||X.greaterThanOrEquals(o,n),y=0,C=i.length,E=i[y],I=n,x=!1,S,w,v;for(;y<C;){if(!_&&X.greaterThanOrEquals(E,o)&&(A=e.getValueInReferenceFrame(o,r,c[p]),h?(m=f.getValueInReferenceFrame(o,r,Gz),l(A)&&l(m)&&(A=Vv(o,A,m,u,A),l(A)&&(c[p++]=A))):l(A)&&(c[p++]=A),_=!0),X.greaterThan(E,t)&&X.lessThan(E,I)&&!E.equals(o)&&(A=e.getValueInReferenceFrame(E,r,c[p]),h?(m=f.getValueInReferenceFrame(E,r,Gz),l(A)&&l(m)&&(A=Vv(E,A,m,u,A),l(A)&&(c[p++]=A))):l(A)&&(c[p++]=A)),y<C-1){if(a>0&&!x){let R=i[y+1],N=X.secondsDifference(R,E);x=N>a,x&&(S=Math.ceil(N/a),w=0,v=N/Math.max(S,2),S=Math.max(S-1,1))}if(x&&w<S){E=X.addSeconds(E,v,new X),w++;continue}}x=!1,y++,E=i[y]}return A=e.getValueInReferenceFrame(n,r,c[p]),h?(m=f.getValueInReferenceFrame(n,r,Gz),l(A)&&l(m)&&(A=Vv(n,A,m,u,A),l(A)&&(c[p++]=A))):l(A)&&(c[p++]=A),p}function jut(e,t,n,i,o,r,a,s){let c,u=0,f=a,h=t,p=!l(i)||X.lessThanOrEquals(i,t)||X.greaterThanOrEquals(i,n);for(;X.lessThan(h,n);)!p&&X.greaterThanOrEquals(h,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,s[f]),l(c)&&(s[f]=c,f++),u++,h=X.addSeconds(t,r*u,new X);return c=e.getValueInReferenceFrame(n,o,s[f]),l(c)&&(s[f]=c,f++),f}function Yut(e,t,n,i,o,r,a,s){let c,u=0,f=a,h=t,p=Math.max(r,60),A=!l(i)||X.lessThanOrEquals(i,t)||X.greaterThanOrEquals(i,n);for(;X.lessThan(h,n);)!A&&X.greaterThanOrEquals(h,i)&&(A=!0,c=e.getValueInReferenceFrame(i,o,s[f]),l(c)&&(s[f]=c,f++)),c=e.getValueInReferenceFrame(h,o,s[f]),l(c)&&(s[f]=c,f++),u++,h=X.addSeconds(t,p*u,new X);return c=e.getValueInReferenceFrame(n,o,s[f]),l(c)&&(s[f]=c,f++),f}function qut(e,t,n,i,o,r,a,s){TJ.start=t,TJ.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!Rn.intersect(h,TJ,U_e).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=X.addSeconds(h.start,X.secondsDifference(h.stop,h.start)/2,new X));let A=e.getValueInReferenceFrame(p,o,s[c]);l(A)&&(s[c]=A,c++)}}return c}function Kut(e,t,n,i,o,r,a,s){let c=e.getValueInReferenceFrame(t,o,s[a]);return l(c)&&(s[a++]=c),a}function Xut(e,t,n,i,o,r,a,s){xJ.start=t,xJ.stop=n;let c=a,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!Rn.intersect(h,xJ,U_e).isEmpty){let p=h.start,A=h.stop,m=t;X.greaterThan(p,m)&&(m=p);let _=n;X.lessThan(A,_)&&(_=A),c=z_e(h.data,m,_,i,o,r,c,s)}}return c}function z_e(e,t,n,i,o,r,a,s){for(;e instanceof by;)e=e.resolvedProperty;if(e instanceof yc){let c=e._property._times;a=Wut(e,t,n,c,i,o,r,a,s)}else e instanceof dF?a=jut(e,t,n,i,o,r,a,s):e instanceof _c?a=Xut(e,t,n,i,o,r,a,s):e instanceof Ty?a=qut(e,t,n,i,o,r,a,s):e instanceof eu||e instanceof ag&&q.isConstant(e)?a=Kut(e,t,n,i,o,r,a,s):a=Yut(e,t,n,i,o,r,a,s);return a}function G_e(e,t,n,i,o,r,a){l(a)||(a=[]);let s=z_e(e,t,n,i,o,r,0,a);return a.length=s,a}var F_e=new J,Q_e=new Qe,k_e=new J;function Hv(e,t){this._unusedIndexes=[],this._polylineCollection=new ap,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}Hv.prototype.update=function(e){let t=this._referenceFrame;if(t===Oi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,F_e);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,F_e)),P.fromRotationTranslation(n,d.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof $o){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,Q_e))&&(J.fromQuaternion(Q_e,k_e),P.fromRotationTranslation(k_e,n,this._polylineCollection.modelMatrix)):SJ(e,t.position,this._polylineCollection.modelMatrix)}};Hv.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,a,s=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(s)||s.getValue(e));if(u){let p=q.getValueOrUndefined(i._leadTime,e),A=q.getValueOrUndefined(i._trailTime,e),m=n._availability,_=l(m),y=l(p),C=l(A);if(u=_||y&&C,u){if(C&&(r=X.addSeconds(e,-A,new X)),y&&(a=X.addSeconds(e,p,new X)),_){let E=m.start,I=m.stop;(!C||X.greaterThan(E,r))&&(r=E),(!y||X.lessThan(I,a))&&(a=I)}u=X.lessThan(r,a)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);return}if(!l(c)){let p=this._unusedIndexes;if(p.length>0){let m=p.pop();c=this._polylineCollection.get(m),t.index=m}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=q.getValueOrDefault(i._resolution,e,Vut),h=G_e(o,r,a,e,this._referenceFrame,f,c.positions.slice());if(h.length<2){c.show=!1;return}c.show=!0,c.positions=h,c.material=vr.getValue(e,i._material,c.material),c.width=q.getValueOrDefault(i._width,e,Hut),c.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};Hv.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};Hv.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),fe(this)};function Ip(e,t){t.collectionChanged.addEventListener(Ip.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}Ip.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity,s=a._position,c=a._path,u=r.updater,f=!1,h=Oi.FIXED,p=h.toString();if(this._scene.mode===oe.SCENE3D){let m=q.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(h=Oi.FIXED,p=h.toString()):m==="INERTIAL"?(h=Oi.INERTIAL,p=h.toString()):(f=!0,h=this._entityCollection.getById(m),p=m):(h=s.referenceFrame,p=h.toString())}let A=this._updaters[p];if(u===A&&l(A)){A.updateObject(e,r);continue}l(u)&&u.removeObject(r),!(f&&!l(h))&&(l(A)||(A=new Hv(this._scene,h),A.update(e),this._updaters[p]=A),r.updater=A,l(A)&&A.updateObject(e,r))}return!0};Ip.prototype.isDestroyed=function(){return!1};Ip.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ip.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return fe(this)};Ip.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a,s=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&s.set(r.id,new O_e(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?s.contains(r.id)||s.set(r.id,new O_e(r)):(a=s.get(r.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],a=s.get(r.id),l(a)&&(l(a.updater)&&a.updater.removeObject(a),s.remove(r.id))};Ip._subSample=G_e;Ip._computeVvlhTransform=SJ;Ip._transformToEntityFrame=Vv;var Vz=Ip;var V_e=U.WHITE,H_e=U.BLACK,W_e=0,j_e=1,Y_e=0,q_e=Qr.NONE,K_e=new U,Jut=new d,X_e=new U,J_e=new Ht,Z_e=new Ht,$_e=new Gt;function eye(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 Ly(e,t){t.collectionChanged.addEventListener(Ly.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ft,this._onCollectionChanged(t,t.values,[],[])}Ly.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],a=r.entity,s=a._point,c=r.pointPrimitive,u=r.billboard,f=q.getValueOrDefault(s._heightReference,e,ot.NONE),h=a.isShowing&&a.isAvailable(e)&&q.getValueOrDefault(s._show,e,!0),p;if(h&&(p=q.getValueOrUndefined(a._position,e,Jut),h=l(p)),!h){Wv(r,a,n);continue}q.isConstant(a._position)||(n._clusterDirty=!0);let A=!1,m=!1;if(f!==ot.NONE&&!l(u)?(l(c)&&(Wv(r,a,n),c=void 0),u=n.getBillboard(a),u.id=a,u.image=void 0,r.billboard=u,A=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===ot.NONE&&!l(c)&&(l(u)&&(Wv(r,a,n),u=void 0),c=n.getPoint(a),c.id=a,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,J_e),c.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,Z_e),c.color=q.getValueOrDefault(s._color,e,V_e,K_e),c.outlineColor=q.getValueOrDefault(s._outlineColor,e,H_e,X_e),c.outlineWidth=q.getValueOrDefault(s._outlineWidth,e,W_e),c.pixelSize=q.getValueOrDefault(s._pixelSize,e,j_e),c.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,$_e),c.disableDepthTestDistance=q.getValueOrDefault(s._disableDepthTestDistance,e,Y_e),c.splitDirection=q.getValueOrDefault(s._splitDirection,e,q_e);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=q.getValueOrUndefined(s._scaleByDistance,e,J_e),u.translucencyByDistance=q.getValueOrUndefined(s._translucencyByDistance,e,Z_e),u.distanceDisplayCondition=q.getValueOrUndefined(s._distanceDisplayCondition,e,$_e),u.disableDepthTestDistance=q.getValueOrDefault(s._disableDepthTestDistance,e,Y_e),u.splitDirection=q.getValueOrDefault(s._splitDirection,e,q_e),u.heightReference=f;let _=q.getValueOrDefault(s._color,e,V_e,K_e),y=q.getValueOrDefault(s._outlineColor,e,H_e,X_e),C=Math.round(q.getValueOrDefault(s._outlineWidth,e,W_e)),E=Math.max(1,Math.round(q.getValueOrDefault(s._pixelSize,e,j_e)));if(C>0?(u.scale=1,A=A||C!==r.outlineWidth||E!==r.pixelSize||!U.equals(_,r.color)||!U.equals(y,r.outlineColor)):(u.scale=E/50,E=50,A=A||C!==r.outlineWidth||!U.equals(_,r.color)||!U.equals(y,r.outlineColor)),A){r.color=U.clone(_,r.color),r.outlineColor=U.clone(y,r.outlineColor),r.pixelSize=E,r.outlineWidth=C;let I=_.alpha,x=_.toCssColorString(),S=y.toCssColorString(),w=JSON.stringify([x,E,S,C]);u.setImage(w,bx(I,x,S,C,E))}m&&u._updateClamping()}}return!0};Ly.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Ct.FAILED;if(l(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!l(i._clampedPosition))return Ct.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,Ct.DONE};Ly.prototype.isDestroyed=function(){return!1};Ly.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ly.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return fe(this)};Ly.prototype._onCollectionChanged=function(e,t,n,i){let o,r,a=this._items,s=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&a.set(r.id,new eye(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?a.contains(r.id)||a.set(r.id,new eye(r)):(Wv(a.get(r.id),r,s),a.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Wv(a.get(r.id),r,s),a.remove(r.id)};function Wv(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Hz=Ly;var rye=[];function Zut(e,t,n,i,o){let r=rye;r.length=o;let a,s=n.red,c=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,A=i.blue,m=i.alpha;if(U.equals(n,i)){for(a=0;a<o;a++)r[a]=U.clone(n);return r}let _=(h-s)/o,y=(p-c)/o,C=(A-u)/o,E=(m-f)/o;for(a=0;a<o;a++)r[a]=new U(s+a*_,c+a*y,u+a*C,f+a*E);return r}function jv(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=ke.clone(e.vertexFormat??ke.DEFAULT),this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=te.clone(e.ellipsoid??te.default),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=l(n)?1+n.length*U.packedLength:1,this.packedLength=r+te.packedLength+ke.packedLength+4}jv.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._colors;for(r=l(a)?a.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var aye=te.clone(te.UNIT_SPHERE),sye=new ke,C0={positions:void 0,colors:void 0,ellipsoid:aye,vertexFormat:sye,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};jv.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)a[i]=U.unpack(e,t);let s=te.unpack(e,t,aye);t+=te.packedLength;let c=ke.unpack(e,t,sye);t+=ke.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=a,n._ellipsoid=te.clone(s,n._ellipsoid),n._vertexFormat=ke.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(C0.positions=r,C0.colors=a,C0.width=u,C0.colorsPerVertex=f,C0.arcType=h,C0.granularity=p,new jv(C0))};var tye=new d,nye=new d,iye=new d,oye=new d;jv.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,a=e._granularity,s=e._ellipsoid,c,u,f,h=[],p=jo(e._positions,d.equalsEpsilon,!1,h);if(l(i)&&h.length>0){let M=0,O=h[0];i=i.filter(function(G,k){let z=!1;return o?z=k===O||k===0&&O===1:z=k+1===O,z?(M++,O=h[M],!1):!0})}let A=p.length;if(A<2||t<=0)return;if(r===un.GEODESIC||r===un.RHUMB){let M,O;r===un.GEODESIC?(M=D.chordLength(a,s.maximumRadius),O=to.numberOfPoints):(M=a,O=to.numberOfPointsRhumbLine);let G=to.extractHeights(p,s);if(l(i)){let k=1;for(c=0;c<A-1;++c)k+=O(p[c],p[c+1],M);let z=new Array(k),F=0;for(c=0;c<A-1;++c){let H=p[c],Y=p[c+1],$=i[c],W=O(H,Y,M);if(o&&c<k){let K=i[c+1],Z=Zut(H,Y,$,K,W),pe=Z.length;for(u=0;u<pe;++u)z[F++]=Z[u]}else for(u=0;u<W;++u)z[F++]=U.clone($)}z[F]=U.clone(i[i.length-1]),i=z,rye.length=0}r===un.GEODESIC?p=to.generateCartesianArc({positions:p,minDistance:M,ellipsoid:s,height:G}):p=to.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:s,height:G})}A=p.length;let m=A*4-4,_=new Float64Array(m*3),y=new Float64Array(m*3),C=new Float64Array(m*3),E=new Float32Array(m*2),I=n.st?new Float32Array(m*2):void 0,x=l(i)?new Uint8Array(m*4):void 0,S=0,w=0,v=0,R=0,N;for(u=0;u<A;++u){u===0?(N=tye,d.subtract(p[0],p[1],N),d.add(p[0],N,N)):N=p[u-1],d.clone(N,iye),d.clone(p[u],nye),u===A-1?(N=tye,d.subtract(p[A-1],p[A-2],N),d.add(p[A-1],N,N)):N=p[u+1],d.clone(N,oye);let M,O;l(x)&&(u!==0&&!o?M=i[u-1]:M=i[u],u!==A-1&&(O=i[u]));let G=u===0?2:0,k=u===A-1?2:4;for(f=G;f<k;++f){d.pack(nye,_,S),d.pack(iye,y,S),d.pack(oye,C,S),S+=3;let z=f-2<0?-1:1;if(E[w++]=2*(f%2)-1,E[w++]=z*t,n.st&&(I[v++]=u/(A-1),I[v++]=Math.max(E[w-2],0)),l(x)){let F=f<2?M:O;x[R++]=U.floatToByte(F.red),x[R++]=U.floatToByte(F.green),x[R++]=U.floatToByte(F.blue),x[R++]=U.floatToByte(F.alpha)}}}let L=new En;L.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:_}),L.prevPosition=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:y}),L.nextPosition=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:C}),L.expandAndWidth=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:E}),n.st&&(L.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:I})),l(x)&&(L.color=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,values:x,normalize:!0}));let g=Ue.createTypedArray(m,A*6-6),b=0,T=0,B=A-1;for(u=0;u<B;++u)g[T++]=b,g[T++]=b+2,g[T++]=b+1,g[T++]=b+1,g[T++]=b+2,g[T++]=b+3,b+=4;return new yt({attributes:L,indices:g,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:$d.POLYLINES})};var Oy=jv;var $ut=new hi(0),Wz={},cye=new U,eft=new Kt(U.WHITE),tft=new hi(!0),nft=new hi(Bn.DISABLED),ift=new hi(new Gt),oft=new hi(ei.BOTH);function rft(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function aft(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function zh(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(zh.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new _e,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new rft,this._groundGeometryOptions=new aft,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(zh.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&q.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}}});zh.prototype.isOutlineVisible=function(e){return!1};zh.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};zh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new wn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=$n.fromDistanceDisplayCondition(o),a={show:i,distanceDisplayCondition:r},s;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,cye)),l(s)||(s=U.WHITE),a.color=Jt.fromColor(s)),this.clampToGround?new Lt({id:t,geometry:new sb(this._groundGeometryOptions),attributes:a}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(s=this._depthFailMaterialProperty.color.getValue(e,cye)),l(s)||(s=U.WHITE),a.depthFailColor=Jt.fromColor(s)),new Lt({id:t,geometry:new Oy(this._geometryOptions),attributes:a}))};zh.prototype.createOutlineGeometryInstance=function(e){};zh.prototype.isDestroyed=function(){return!1};zh.prototype.destroy=function(){this._entitySubscription(),fe(this)};zh.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,a=o.show;if(l(a)&&a.isConstant&&!a.getValue(Ze.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let s=o.zIndex,c=o.material??eft,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=a??tft,this._shadowsProperty=o.shadows??nft,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??ift,this._classificationTypeProperty=o.classificationType??oft,this._fillEnabled=!0,this._zIndex=s??$ut;let f=o.width,h=o.arcType,p=o.clampToGround,A=o.granularity;if(!r.isConstant||!q.isConstant(f)||!q.isConstant(h)||!q.isConstant(A)||!q.isConstant(p)||!q.isConstant(s))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,_=r.getValue(Ze.MINIMUM_VALUE,m.positions);if(!l(_)||_.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let y;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?y=Qa.VERTEX_FORMAT:y=mc.VERTEX_FORMAT,m.vertexFormat=y,m.positions=_,m.width=l(f)?f.getValue(Ze.MINIMUM_VALUE):void 0,m.arcType=l(h)?h.getValue(Ze.MINIMUM_VALUE):void 0,m.granularity=l(A)?A.getValue(Ze.MINIMUM_VALUE):void 0;let C=this._groundGeometryOptions;C.positions=_,C.width=m.width,C.arcType=m.arcType,C.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(Ze.MINIMUM_VALUE):!1,!this._clampToGround&&l(s)&&bt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};zh.prototype.createDynamicUpdater=function(e,t){return new Yv(e,t,this)};var zT={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Yv(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 lye(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Wz[n];!l(i)||i.isDestroyed()?(i=new ap,Wz[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}Yv.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=q.getValueOrUndefined(o,e,this._positions);t._clampToGround=q.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=q.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=q.getValueOrDefault(i._arcType,e,un.GEODESIC),t._groundGeometryOptions.granularity=q.getValueOrDefault(i._granularity,e,9999);let a=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(a.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Kt)p=new Qa;else{let A=vr.getValue(e,h,this._material);p=new mc({material:A,translucent:A.isTranslucent()}),this._material=A}this._groundPolylinePrimitive=a.add(new Bm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),q.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let s=lye(this);if(!n.isShowing||!n.isAvailable(e)||!q.getValueOrDefault(i._show,e,!0)){s.show=!1;return}if(!l(r)||r.length<2){s.show=!1;return}let c=un.GEODESIC;c=q.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==un.NONE&&l(u)&&(zT.ellipsoid=f,zT.positions=r,zT.granularity=q.getValueOrUndefined(i._granularity,e),zT.height=to.extractHeights(r,f),c===un.GEODESIC?r=to.generateCartesianArc(zT):r=to.generateCartesianRhumbArc(zT)),s.show=!0,s.positions=r.slice(),s.material=vr.getValue(e,t.fillMaterialProperty,s.material),s.width=q.getValueOrDefault(i._width,e,1),s.distanceDisplayCondition=q.getValueOrUndefined(i._distanceDisplayCondition,e,s.distanceDisplayCondition)};Yv.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return le.clone(n.boundingSphere,e),Ct.DONE}return l(t)&&!t.ready?Ct.PENDING:Ct.DONE}else{let t=lye(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),Ct.DONE}return Ct.FAILED};Yv.prototype.isDestroyed=function(){return!1};Yv.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Wz[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Wz[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),fe(this)};var jz=zh;var sft=new U,cft=new Gt,lft=new Gt;function Gh(e,t,n,i,o){let r;n instanceof Kt?r=Qa:r=mc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Ft,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ft,this.material=void 0,this.updatersWithAttributes=new Ft,this.attributes=new Ft,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Gh.prototype.onMaterialChanged,this),this.subscriptions=new Ft,this.showsUpdated=new Ft,this.zIndex=i,this._asynchronous=o}Gh.prototype.onMaterialChanged=function(){this.invalidated=!0};Gh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};Gh.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||!q.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,a,s,c){a==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Gh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Gh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let s=this.appearanceType;n=new Bm({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new s,classificationType:this.classificationType}),this.appearanceType===mc&&(this.material=vr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let s=this.oldPrimitive;l(s)&&(i.remove(s),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===mc&&(this.material=vr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let a=this.updatersWithAttributes.values,s=a.length;for(r=0;r<s;r++){let c=a[r],u=c.entity,f=this.geometry.get(c.id),h=this.attributes.get(f.id.id);if(l(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!c.fillMaterialProperty.isConstant){let _=c.fillMaterialProperty.color,y=q.getValueOrDefault(_,e,U.WHITE,sft);U.equals(h._lastColor,y)||(h._lastColor=U.clone(y,h._lastColor),h.color=Jt.toValue(y,h.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),A=h.show[0]===1;p!==A&&(h.show=wn.toValue(p,h.show));let m=c.distanceDisplayConditionProperty;if(!q.isConstant(m)){let _=q.getValueOrDefault(m,e,lft,cft);Gt.equals(_,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Gt.clone(_,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=$n.toValue(_,h.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Gh.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,a=this.geometry.get(o.id);if(!a)continue;let s=this.attributes.get(a.id.id);l(s)||(s=e.getGeometryInstanceAttributes(a.id),this.attributes.set(a.id.id,s));let c=r.isShowing,u=s.show[0]===1;c!==u&&(s.show=wn.toValue(c,s.show),a.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Gh.prototype.contains=function(e){return this.updaters.contains(e.id)};Gh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Ct.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Ct.FAILED:(i.boundingSphere.clone(t),Ct.DONE)};Gh.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function GT(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}GT.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=q.getValueOrDefault(t.zIndex,0);for(let s=0;s<i;++s){let c=n[s];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let a=new Gh(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);a.add(e,t,o),n.push(a)};GT.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}}};GT.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 a=r.updaters.values,s=a.length;for(let c=0;c<s;c++)this.add(e,a[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};GT.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 Ct.FAILED};GT.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 Yz=GT;var uft=[];function uye(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function fye(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let a=n.classificationTypeProperty.getValue(t);e._groundBatches[a].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Kt?1:2);let r;l(i)&&(r=i+o*Bn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function bp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ft,this._removedObjects=new Ft,this._changedObjects=new Ft;let o,r=Bn.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 Qh(n,Qa,void 0,!1,o),this._materialBatches[o]=new Uh(n,mc,void 0,!1,o),this._colorBatches[o+r]=new Qh(n,Qa,Qa,!1,o),this._materialBatches[o+r]=new Uh(n,mc,Qa,!1,o),this._colorBatches[o+r*2]=new Qh(n,Qa,mc,!1,o),this._materialBatches[o+r*2]=new Uh(n,mc,mc,!1,o);this._dynamicBatch=new AT(n,i);let a=ei.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(a),o=0;o<a;++o)this._groundBatches[o]=new Yz(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ft,this._updaters=new Ft,this._entityCollection=t,t.collectionChanged.addEventListener(bp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,uft)}bp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,a=r.values,s,c,u,f;for(s=a.length-1;s>-1;s--)c=a[s],u=c.id,f=this._updaters.get(u),f.entity===c?(uye(this,f),fye(this,e,f)):(o.push(c),n.push(c));for(s=o.length-1;s>-1;s--)c=o[s],u=c.id,f=this._updaters.get(u),uye(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(s=n.length-1;s>-1;s--)c=n[s],u=c.id,f=new jz(c,this._scene),this._updaters.set(u,f),fye(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(bp._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,A=p.length;for(s=0;s<A;s++)h=p[s].update(e)&&h;return h};var fft=[],dft=new le;bp.prototype.getBoundingSphere=function(e,t){let n=fft,i=dft,o=0,r=Ct.DONE,a=this._batches,s=a.length,c=this._updaters.get(e.id);if(!c)return Ct.FAILED;for(let u=0;u<s;u++){if(r=a[u].getBoundingSphere(c,i),r===Ct.PENDING)return Ct.PENDING;r===Ct.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?Ct.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),Ct.DONE)};bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(bp.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),fe(this)};bp._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};bp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,a,s,c;for(a=n.length-1;a>-1;a--)c=n[a],s=c.id,i.remove(s)||(o.set(s,c),r.remove(s));for(a=t.length-1;a>-1;a--)c=t[a],s=c.id,o.remove(s)?r.set(s,c):i.set(s,c)};var qz=bp;function Iu(e){Zl.initializeTerrainHeights(),Bm.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??Iu.defaultVisualizersCallback;let i=!1,o=new yu,r=new yu;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let a=new QU;this._onDataSourceAdded(void 0,a),this._defaultDataSource=a;let s,c;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),s(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};s=a.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=s,this._removeDataSourceCollectionListener=c,this._ready=!1}var VT=[];Iu.registerVisualizer=function(e){VT.includes(e)||VT.push(e)};Iu.unregisterVisualizer=function(e){if(VT.includes(e)){let t=VT.indexOf(e);VT.splice(t,1)}};Iu.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new p1(t,i),new Lz(e,i,n._primitives,n._groundPrimitives),new Oz(t,i),new Qz(e,i),new bU(e,i),new Hz(t,i),new Vz(e,i),new qz(e,i,n._primitives,n._groundPrimitives),...VT.map(o=>new o(e,i))]};Object.defineProperties(Iu.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}}});Iu.prototype.isDestroyed=function(){return!1};Iu.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),fe(this)};Iu.prototype.update=function(e){if(!vi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,a=this._dataSourceCollection,s=a.length;for(n=0;n<s;n++){let c=a.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Iu.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let a=o._resourceCredits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)e.creditDisplay.addCreditToNextFrame(a[c])}}};var hft=[],mft=new le;Iu.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Ct.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 A=p.get(i);if(A.entities.contains(e)){r=A;break}}}if(!l(r))return Ct.FAILED;let a=hft,s=mft,c=0,u=Ct.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,s),!t&&u===Ct.PENDING)return Ct.PENDING;u===Ct.DONE&&(a[c]=le.clone(s,a[c]),c++)}}return c===0?Ct.FAILED:(a.length=c,le.fromBoundingSpheres(a,n),Ct.DONE)};Iu.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new yu),a=o.add(new nz);t._primitives=r,t._groundPrimitives=a;let s=t.clustering;s._initialize(n),r.add(s),t._visualizers=this._visualizersCallback(n,s,t)};Iu.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,a=t.clustering;o.remove(a);let s=t._visualizers,c=s.length;for(let u=0;u<c;u++)s[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Iu.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,a=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(a)):t===n-1?(i.lower(r),o.lower(a)):t===0?(i.lowerToBottom(r),o.lowerToBottom(a),i.raise(r),o.raise(a)):(i.raiseToTop(r),o.raiseToTop(a))};var Kz=Iu;function wJ(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}wJ.clone=function(e,t){if(l(e))return l(t)||(t=new wJ),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Vh=wJ;var dye=new J,hye=new J,mye=new J,pft=new P,Xz=new d,pye=new d,BJ=new d,DJ=new d,Aye=new d,gye=new d,Aft=new Qe,gft=new d,_ft=new J,HT=new X,yft=1.25;function Cft(e,t,n,i,o,r,a,s,c,u){let f=e.scene.mode,h=o.getValue(c,e._lastCartesian);if(l(h)){let p=!1,A=!1,m,_,y;if(f===oe.SCENE3D){X.addSeconds(c,.001,HT);let v=o.getValue(HT,Xz);if(l(v)||(X.addSeconds(c,-.001,HT),v=o.getValue(HT,Xz),A=!0),l(v)){let R=At.computeFixedToIcrfMatrix(c,dye),N=At.computeFixedToIcrfMatrix(HT,hye),L;!l(R)||!l(N)?(L=At.computeTemeToPseudoFixedMatrix(c,mye),R=J.transpose(L,dye),N=At.computeTemeToPseudoFixedMatrix(HT,hye),J.transpose(N,N)):L=J.transpose(R,mye);let g=J.multiplyByVector(R,h,Aye),b=J.multiplyByVector(N,v,gye);d.subtract(g,b,DJ);let T=d.magnitude(DJ)*1e3,B=D.GRAVITATIONALPARAMETER,M=-B/(T*T-2*B/d.magnitude(g));M<0||M>yft*u.maximumRadius?(m=pye,d.normalize(h,m),d.negate(m,m),y=d.clone(d.UNIT_Z,BJ),_=d.cross(y,m,Xz),d.magnitude(_)>D.EPSILON7&&(d.normalize(m,m),d.normalize(_,_),y=d.cross(m,_,BJ),d.normalize(y,y),p=!0)):d.equalsEpsilon(h,v,D.EPSILON7)||(y=pye,d.normalize(g,y),d.normalize(b,b),_=d.cross(y,b,BJ),A&&(_=d.multiplyByScalar(_,-1,_)),d.equalsEpsilon(_,d.ZERO,D.EPSILON7)||(m=d.cross(_,y,Xz),J.multiplyByVector(L,m,m),J.multiplyByVector(L,_,_),J.multiplyByVector(L,y,y),d.normalize(m,m),d.normalize(_,_),d.normalize(y,y),p=!0))}}l(e.boundingSphere)&&(h=e.boundingSphere.center);let C,E,I;i&&(C=d.clone(t.position,DJ),E=d.clone(t.direction,Aye),I=d.clone(t.up,gye));let x=pft,S;l(a)&&(S=a.getValue(c,Aft));let w=r.getValue(c,gft);if(s===n_.INERTIAL&&l(S))P.fromTranslationQuaternionRotationScale(h,S,d.ONE,x);else if(s===n_.VELOCITY&&l(w)){let v=At.rotationMatrixFromPositionVelocity(h,w,u,_ft);P.fromRotationTranslation(v,h,x)}else s===n_.ENU||!p?At.eastNorthUpToFixedFrame(h,u,x):(x[0]=m.x,x[1]=m.y,x[2]=m.z,x[3]=0,x[4]=_.x,x[5]=_.y,x[6]=_.z,x[7]=0,x[8]=y.x,x[9]=y.y,x[10]=y.z,x[11]=0,x[12]=h.x,x[13]=h.y,x[14]=h.z,x[15]=0);t._setTransform(x),i&&(d.clone(C,t.position),d.clone(E,t.direction),d.clone(I,t.up),d.cross(E,I,t.right))}if(n){let p=f===oe.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function qv(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??te.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new wy(e.position,!0),this._offset3D=new d}Object.defineProperties(qv,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});qv.defaultOffset3D=new d(-14e3,3500,3500);var E0=new Vh,Eft=new d;qv.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,a=r.trackingReferenceFrame,s=r.position;if(!l(s))return;let c=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,A=f||h,m=!0;if(f){let _=r.viewFrom,y=l(_);if(!y&&l(t)){E0.pitch=-D.PI_OVER_FOUR,E0.range=0;let C=s.getValue(e,Eft);if(l(C))if(p.getCameraDistance)E0.range=p.getCameraDistance(),E0.heading=p.heading,E0.pitch=p.pitch;else{let E=2-1/Math.max(1,d.magnitude(C)/i.maximumRadius);E0.pitch*=E}p.viewBoundingSphere(t,E0),this.boundingSphere=t,A=!1,m=!1}else(!y||!l(_.getValue(e,this._offset3D)))&&d.clone(qv._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Cft(this,p,A,m,s,c,u,a,e,i)};var Jz=qv;var vJ=new Date(2107,11,31),PJ=new Date(1980,0,1),Xn=void 0,df="undefined",Hh="function";var Ift=64,_ye=2;try{typeof navigator!=df&&navigator.hardwareConcurrency&&(_ye=navigator.hardwareConcurrency)}catch{}var bft={workerURI:"./core/web-worker.js",wasmURI:"./core/streams/zlib/zlib-streams.wasm",chunkSize:64*1024,maxWorkers:_ye,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,CompressionStream:typeof CompressionStream!=df&&CompressionStream,DecompressionStream:typeof DecompressionStream!=df&&DecompressionStream},yye=Object.assign({},bft);function Kv(){return yye}function Zz(e){return Math.max(e.chunkSize,Ift)}function WT(e){let{baseURI:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:a,CompressionStream:s,DecompressionStream:c,CompressionStreamZlib:u,DecompressionStreamZlib:f,workerURI:h,wasmURI:p}=e;Pd("baseURI",t),Pd("wasmURI",p),Pd("workerURI",h),Pd("chunkSize",n),Pd("maxWorkers",i),Pd("terminateWorkerTimeout",o),Pd("useCompressionStream",r),Pd("useWebWorkers",a),Pd("CompressionStream",s),Pd("DecompressionStream",c),Pd("CompressionStreamZlib",u),Pd("DecompressionStreamZlib",f)}function Pd(e,t){t!==Xn&&(yye[e]=t)}var ja,$z,Wh,RJ;function MJ(e){ja=e,{malloc:$z,free:Wh,memory:RJ}=ja}function Cye(e,t,n={}){let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){let a;if(this.out=$z(o),this.in=$z(r),this.inBufferSize=r,this._scratch=new Uint8Array(o),e?(this._process=ja.deflate_process,this._last_consumed=ja.deflate_last_consumed,this._end=ja.deflate_end,this.streamHandle=ja.deflate_new(),t==="gzip"?a=ja.deflate_init_gzip(this.streamHandle,i):t==="deflate-raw"?a=ja.deflate_init_raw(this.streamHandle,i):a=ja.deflate_init(this.streamHandle,i)):t==="deflate64-raw"?(this._process=ja.inflate9_process,this._last_consumed=ja.inflate9_last_consumed,this._end=ja.inflate9_end,this.streamHandle=ja.inflate9_new(),a=ja.inflate9_init_raw(this.streamHandle)):(this._process=ja.inflate_process,this._last_consumed=ja.inflate_last_consumed,this._end=ja.inflate_end,this.streamHandle=ja.inflate_new(),t==="deflate-raw"?a=ja.inflate_init_raw(this.streamHandle):t==="gzip"?a=ja.inflate_init_gzip(this.streamHandle):a=ja.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)},transform(a,s){try{let c=a,u=new Uint8Array(RJ.buffer),f=this._process,h=this._last_consumed,p=this.out,A=this._scratch,m=0;for(;m<c.length;){let _=Math.min(c.length-m,32768);(!this.in||this.inBufferSize<_)&&(this.in&&Wh&&Wh(this.in),this.in=$z(_),this.inBufferSize=_),u.set(c.subarray(m,m+_),this.in);let y=f(this.streamHandle,this.in,_,p,o,0);if(!e&&y<0)throw new Error("process error:"+y);let C=y&16777215;C&&(A.set(u.subarray(p,p+C),0),s.enqueue(A.slice(0,C)));let E=h(this.streamHandle);if(E===0)break;m+=E}}catch(c){this._end&&this.streamHandle&&this._end(this.streamHandle),this.in&&Wh&&Wh(this.in),this.out&&Wh&&Wh(this.out),s.error(c)}},flush(a){try{let s=new Uint8Array(RJ.buffer),c=this._process,u=this.out,f=this._scratch;for(;;){let h=c(this.streamHandle,0,0,u,o,4);if(!e&&h<0)throw new Error("process error:"+h);let p=h&16777215,A=h>>24&255;if(p&&(f.set(s.subarray(u,u+p),0),a.enqueue(f.slice(0,p))),A===1||p===0)break}}catch(s){a.error(s)}finally{if(this._end&&this.streamHandle){let s=this._end(this.streamHandle);s!==0&&a.error(new Error("end error:"+s))}this.in&&Wh&&Wh(this.in),this.out&&Wh&&Wh(this.out)}}})}var Xv=class{constructor(t="deflate",n){return Cye(!0,t,n)}},Jv=class{constructor(t="deflate",n){return Cye(!1,t,n)}};var eG=!1;async function Eye(e,{baseURI:t}){if(!eG){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=xft(e);else throw r}let o=await WebAssembly.instantiate(n);MJ(o.instance.exports),eG=!0}}function xft(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var Tft="Writer iterator completed too soon",Sft="Writer not initialized",wft="text/plain";var Bft="Content-Type";var Dft=64*1024,NJ="writable",jT=class{constructor(){this.size=0}init(){this.initialized=!0}},Zv=class extends jT{get readable(){let t=this,{chunkSize:n=Dft}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:a,diskNumberStart:s}=i,{chunkOffset:c}=this,u=a===Xn?n:Math.min(n,a-c),f=await ic(t,r+c,u,s);o.enqueue(f),c+n>a||a===Xn&&!f.length&&u?o.close():this.chunkOffset+=n}});return i}},tG=class extends jT{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(Sft);return t.writeUint8Array(i)}});Object.defineProperty(t,NJ,{get(){return n}})}writeUint8Array(){}};var $v=class extends tG{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length&&(o.length>2?n.data+=btoa(o):n.pending+=o)}getData(){return this.data+btoa(this.pending)}},xp=class extends Zv{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,a=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,o)),new Uint8Array(a)}},YT=class extends jT{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([Bft,t]),Object.defineProperty(n,NJ,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},eP=class extends xp{constructor(t){super(new Blob([t],{type:wft}))}},tP=class extends YT{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,a)=>{Object.assign(o,{onload:({target:s})=>r(s.result),onerror:()=>a(o.error)}),o.readAsText(i,t)})}}};var nG=class extends Zv{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,a,s=i;s==-1&&(s=r.length-1);let c=t;for(;r[s]&&c>=r[s].size;)c-=r[s].size,s++;let u=r[s];if(u){let f=u.size;if(c+n<=f)a=await ic(u,c,n);else{let h=f-c;a=new Uint8Array(n);let p=await ic(u,c,h);a.set(p,0);let A=await o.readUint8Array(t+h,n-h,i);a.set(A,h),p.length+A.length<n&&(a=a.subarray(0,p.length+A.length))}}else a=new Uint8Array;return o.lastDiskNumber=Math.max(s,o.lastDiskNumber),a}},nP=class extends jT{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,a,s=new WritableStream({async write(f){let{availableSize:h}=i;if(a)f.length>=h?(await c(f.subarray(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,a=null,await this.write(f.subarray(h))):await c(f);else{let{value:p,done:A}=await t.next();if(A&&!p)throw new Error(Tft);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Sp(o),r=p.writable,a=r.getWriter(),await this.write(f)}},async close(){await a.ready,await u()}});Object.defineProperty(i,NJ,{get(){return s}});async function c(f){let h=f.length;h&&(await a.ready,await a.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){await a.close()}}},I0=class{constructor(t){return Array.isArray(t)&&(t=new nG(t)),t instanceof ReadableStream&&(t={readable:t}),t}},qT=class{constructor(t){return t.writable===Xn&&typeof t.next==Hh&&(t=new nP(t)),t instanceof WritableStream&&(t={writable:t}),t.size===Xn&&(t.size=0),t instanceof nP||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}};async function Sp(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function ic(e,t,n,i){return e.readUint8Array(t,n,i)}var Iye=[];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;Iye[e]=t}var sg=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^Iye[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var iP=class extends TransformStream{constructor(){let t,n=new sg;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function KT(e){if(typeof TextEncoder==df){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 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 a=0;a<e.length;a++)i.push(n|e[a]>>>t),n=e[a]<<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}},oP={bytes:{fromBits(e){let n=Ll.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)(r&3)===0&&(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Ll.partial(8*(n&3),i)),t}}},bye={};bye.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=oP.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),a=0;for(let s=t.blockSize+i-(t.blockSize+i&t.blockSize-1);s<=o;s+=t.blockSize)t._block(r.subarray(16*a,16*(a+1))),a+=1;return n.splice(0,16*a),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 u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],a=n[2],s=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,a,s)+c+i[u]+t._key[Math.floor(u/20)]|0;c=s,s=a,a=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0}};var LJ={};LJ.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,a,s,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[a=e.slice(0),s=[]],r=o;r<4*o+28;r++){let u=a[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),a[r]=a[r-o]^u}for(let u=0;r;u++,r--){let f=a[u&3?r:r-4];r<=4||u<4?s[u]=f:s[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],a,s,c,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=a=0;!n[f];f^=s||1,a=r[a]||1){let h=a^a<<1^a<<2^a<<3^a<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[c=o[s=o[f]]];let p=u*16843009^c*65537^s*257^f*16843008,A=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=A=A<<24^A>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],a=r[0],s=r[1],c=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],A=e[2]^n[2],m=e[t?1:3]^n[3],_=4,y,C,E;for(let I=0;I<i;I++)y=a[h>>>24]^s[p>>16&255]^c[A>>8&255]^u[m&255]^n[_],C=a[p>>>24]^s[A>>16&255]^c[m>>8&255]^u[h&255]^n[_+1],E=a[A>>>24]^s[m>>16&255]^c[h>>8&255]^u[p&255]^n[_+2],m=a[m>>>24]^s[h>>16&255]^c[p>>8&255]^u[A&255]^n[_+3],_+=4,h=y,p=C,A=E;for(let I=0;I<4;I++)o[t?3&-I:I]=f[h>>>24]<<24^f[p>>16&255]<<16^f[A>>8&255]<<8^f[m&255]^n[_++],y=h,h=p,p=A,A=m,m=y;return o}};var xye={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}},OJ={};OJ.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 a=e.encrypt(n);t[r]^=a[0],t[r+1]^=a[1],t[r+2]^=a[2],t[r+3]^=a[3]}return Ll.clamp(t,o)}};var Fy={importKey(e){return new Fy.hmacSha1(oP.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,a,s,c,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,A=Ll;for(t=oP.bytes.toBits(t),u=1;p<(o||1);u++){for(r=a=e.encrypt(A.concat(t,[u])),s=1;s<n;s++)for(a=e.encrypt(a),c=0;c<a.length;c++)r[c]^=a[c];for(s=0;p<(o||1)&&s<r.length;s++)h.setInt32(p,r[s]),p+=4}return f.slice(0,i/8)}};Fy.hmacSha1=class{constructor(e){let t=this,n=t._hash=bye.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 vft=typeof crypto!=df&&typeof crypto.getRandomValues==Hh,cg="Invalid password",Qy="Invalid signature",lg="zipjs-abort-check-password";function iG(e){return vft?crypto.getRandomValues(e):xye.getRandomValues(e)}var XT=16,Pft="raw",wye={name:"PBKDF2"},Rft={name:"HMAC"},Mft="SHA-1",Nft=Object.assign({hash:Rft},wye),FJ=Object.assign({iterations:1e3,hash:{name:Mft}},wye),Lft=["deriveBits"],aP=[8,12,16],rP=[16,24,32],ky=10,Oft=[0,0,0,0],aG=typeof crypto!=df,lP=aG&&crypto.subtle,Bye=aG&&typeof lP!=df,wp=oP.bytes,Fft=LJ.aes,Qft=OJ.ctrGladman,kft=Fy.hmacSha1,Tye=aG&&Bye&&typeof lP.importKey==Hh,Sye=aG&&Bye&&typeof lP.deriveBits==Hh,oG=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:Pye(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(a,s){let c=this,{password:u,strength:f,resolveReady:h,ready:p}=c;u?(await Uft(c,f,u,Rd(a,0,aP[f]+2)),a=Rd(a,aP[f]+2),r?s.error(new Error(lg)):h()):await p;let A=new Uint8Array(a.length-ky-(a.length-ky)%XT);s.enqueue(Dye(c,a,A,0,ky,!0))},async flush(a){let{signed:s,ctr:c,hmac:u,pending:f,ready:h}=this;if(u&&c){await h;let p=Rd(f,0,f.length-ky),A=Rd(f,f.length-ky),m=new Uint8Array;if(p.length){let _=cP(wp,p);u.update(_);let y=c.update(_);m=sP(wp,y)}if(s){let _=Rd(sP(wp,u.digest()),0,ky);for(let y=0;y<ky;y++)if(_[y]!=A[y])throw new Error(Qy)}a.enqueue(m)}}})}},rG=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:Pye(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,a){let s=this,{password:c,strength:u,resolveReady:f,ready:h}=s,p=new Uint8Array;c?(p=await zft(s,u,c),f()):await h;let A=new Uint8Array(p.length+r.length-r.length%XT);A.set(p,0),a.enqueue(Dye(s,r,A,p.length,0))},async flush(r){let{ctr:a,hmac:s,pending:c,ready:u}=this;if(s&&a){await u;let f=new Uint8Array;if(c.length){let h=a.update(cP(wp,c));s.update(h),f=sP(wp,h)}o.signature=sP(wp,s.digest()).slice(0,ky),r.enqueue(QJ(f,o.signature))}}}),o=this}};function Dye(e,t,n,i,o,r){let{ctr:a,hmac:s,pending:c}=e,u=t.length-o;c.length&&(t=QJ(c,t),n=Hft(n,u-u%XT));let f;for(f=0;f<=u-XT;f+=XT){let h=cP(wp,Rd(t,f,f+XT));r&&s.update(h);let p=a.update(h);r||s.update(p),n.set(sP(wp,p),f+i)}return e.pending=Rd(t,f),n}async function Uft(e,t,n,i){let o=await vye(e,t,n,Rd(i,0,aP[t])),r=Rd(i,aP[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(cg)}async function zft(e,t,n){let i=iG(new Uint8Array(aP[t])),o=await vye(e,t,n,i);return QJ(i,o)}async function vye(e,t,n,i){e.password=null;let o=await Gft(Pft,n,Nft,!1,Lft),r=await Vft(Object.assign({salt:i},FJ),o,8*(rP[t]*2+2)),a=new Uint8Array(r),s=cP(wp,Rd(a,0,rP[t])),c=cP(wp,Rd(a,rP[t],rP[t]*2)),u=Rd(a,rP[t]*2);return Object.assign(e,{keys:{key:s,authentication:c,passwordVerification:u},ctr:new Qft(new Fft(s),Array.from(Oft)),hmac:new kft(c)}),u}async function Gft(e,t,n,i,o){if(Tye)try{return await lP.importKey(e,t,n,i,o)}catch{return Tye=!1,Fy.importKey(t)}else return Fy.importKey(t)}async function Vft(e,t,n){if(Sye)try{return await lP.deriveBits(e,t,n)}catch{return Sye=!1,Fy.pbkdf2(t,e.salt,FJ.iterations,n)}else return Fy.pbkdf2(t,e.salt,FJ.iterations,n)}function Pye(e,t){return t===Xn?KT(e):t}function QJ(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 Hft(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Rd(e,t,n){return e.subarray(t,n)}function sP(e,t){return e.fromBits(t)}function cP(e,t){return e.toBits(t)}var uP=12,sG=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Lye(this,t)},transform(o,r){let a=this;if(a.password){let s=Rye(a,o.subarray(0,uP));if(a.password=null,s.at(-1)!=a.passwordVerification)throw new Error(cg);o=o.subarray(uP)}i?r.error(new Error(lg)):r.enqueue(Rye(a,o))}})}},cG=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),Lye(this,t)},transform(i,o){let r=this,a,s;if(r.password){r.password=null;let c=iG(new Uint8Array(uP));c[uP-1]=r.passwordVerification,a=new Uint8Array(i.length+c.length),a.set(Mye(r,c),0),s=uP}else a=new Uint8Array(i.length),s=0;a.set(Mye(r,i),s),o.enqueue(a)}})}};function Rye(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Oye(e)^t[i],kJ(e,n[i]);return n}function Mye(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=Oye(e)^t[i],kJ(e,t[i]);return n}function Lye(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new sg(n[0]),crcKey2:new sg(n[2])});for(let i=0;i<t.length;i++)kJ(e,t.charCodeAt(i))}function kJ(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=Nye(Math.imul(Nye(i+Fye(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function Oye(e){let t=e.keys[2]|2;return Fye(Math.imul(t,t^1)>>>8)}function Fye(e){return e&255}function Nye(e){return e&4294967295}var JT="Invalid uncompressed size",Wft="deflate-raw",jft="deflate64-raw",lG=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamZlib:i,CompressionStream:o}){super({});let{compressed:r,encrypted:a,useCompressionStream:s,zipCrypto:c,signed:u,level:f}=t,h=this,p,A,m=super.readable;(!a||c)&&u&&(p=new iP,m=Bp(m,p)),r&&(m=kye(m,s,{level:f,chunkSize:n},o,i,o)),a&&(c?m=Bp(m,new cG(t)):(A=new rG(t),m=Bp(m,A))),Qye(h,m,()=>{let _;a&&!c&&(_=A.signature),(!a||c)&&u&&(_=new DataView(p.value.buffer).getUint32(0)),h.signature=_})}},uG=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamZlib:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:a,signed:s,signature:c,compressed:u,useCompressionStream:f,deflate64:h}=t,p,A,m=super.readable;a&&(r?m=Bp(m,new sG(t)):(A=new oG(t),m=Bp(m,A))),u&&(m=kye(m,f,{chunkSize:n,deflate64:h},o,i,o)),(!a||r)&&s&&(p=new iP,m=Bp(m,p)),Qye(this,m,()=>{if((!a||r)&&s){let _=new DataView(p.value.buffer);if(c!=_.getUint32(0,!1))throw new Error(Qy)}})}};function Qye(e,t,n){t=Bp(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function kye(e,t,n,i,o,r){let a=t&&i?i:o||r,s=n.deflate64?jft:Wft;try{e=Bp(e,new a(s,n))}catch(c){if(t)if(o)e=Bp(e,new o(s,n));else if(r)e=Bp(e,new r(s,n));else throw c;else throw c}return e}function Bp(e,t){return e.pipeThrough(t)}var Uye="message",zye="start",Gye="pull",UJ="data",Vye="ack",zJ="close",hG="deflate",mG="inflate";var fG=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(hG)?r=lG:o.startsWith(mG)&&(r=uG),i.outputSize=0;let a=0,s=new r(t,n),c=super.readable,u=new TransformStream({transform(h,p){h&&h.length&&(a+=h.length,p.enqueue(h))},flush(){Object.assign(i,{inputSize:a})}}),f=new TransformStream({transform(h,p){if(h&&h.length&&(p.enqueue(h),i.outputSize+=h.length,t.outputSize!==Xn&&i.outputSize>t.outputSize))throw new Error(JT)},flush(){let{signature:h}=s;Object.assign(i,{signature:h,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(s).pipeThrough(f)}})}},dG=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 a=new Uint8Array(n.length+o.length);a.set(n),a.set(o,n.length),o=a,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var Wye=typeof Worker!=df;var ZT=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:a,useWebWorkers:s,transferStreams:c,workerURI:u},f){let{signal:h}=a;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new dG(r.chunkSize)).pipeThrough(new VJ(a),{signal:h}),writable:i,options:Object.assign({},o),workerURI:u,transferStreams:c,terminate(){return new Promise(p=>{let{worker:A,busy:m}=t;A?(m?t.resolveTerminated=p:(A.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,f(t)}}),(s&&Wye?Yft:jye)(t,r)}},VJ=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await GJ(t,i)},async transform(a,s){r+=a.length,n&&await GJ(n,r,i),s.enqueue(a)},async flush(){o&&await GJ(o,r)}})}};async function GJ(e,...t){try{await e(...t)}catch{}}function jye(e,t){return{run:()=>qft(e,t)}}function Yft(e,t){let{baseURI:n,chunkSize:i}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Hh&&(o=o());let r;try{r=Jft(e.workerURI,n,e)}catch{return Wye=!1,jye(e,t)}Object.assign(e,{worker:r,interface:{run:()=>Kft(e,{chunkSize:i,wasmURI:o,baseURI:n})}})}return e.interface}async function qft({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(!e.useCompressionStream&&!eG){let{wasmURI:u}=o;typeof u==Hh&&(u=u()),await Eye(u,o)}r=new fG(e,o),await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:a,inputSize:s,outputSize:c}=r;return{signature:a,inputSize:s,outputSize:c}}catch(a){throw r&&(a.outputSize=r.outputSize),a}finally{i()}}async function Kft(e,t){let n,i,o=new Promise((h,p)=>{n=h,i=p});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:a}=e,{writable:s,closed:c}=Xft(e.writable),u=pG({type:zye,options:a,config:t,readable:r,writable:s},e);u||Object.assign(e,{reader:r.getReader(),writer:s.getWriter()});let f=await o;return u||await s.getWriter().close(),await c,f}function Xft(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 Hye=!0;function Jft(e,t,n){let i={type:"module"},o,r;if(typeof e==Hh&&(e=e()),e.startsWith("data:")||e.startsWith("blob:"))try{r=new Worker(e)}catch{r=new Worker(e,i)}else{try{o=new URL(e,t)}catch{o=e}r=new Worker(o,i)}return r.addEventListener(Uye,a=>Zft(a,n)),r}function pG(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:a,writable:s}=e,c=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,c.push(e.value)),o&&Hye?(a&&c.push(a),s&&c.push(s)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Hye=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function Zft({data:e},t){let{type:n,value:i,messageId:o,result:r,error:a}=e,{reader:s,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(a){let{message:A,stack:m,code:_,name:y,outputSize:C}=a,E=new Error(A);Object.assign(E,{stack:m,code:_,name:y,outputSize:C}),p(E)}else{if(n==Gye){let{value:A,done:m}=await s.read();pG({type:UJ,value:A,done:m,messageId:o},t)}n==UJ&&(await c.ready,await c.write(new Uint8Array(i)),pG({type:Vye,messageId:o},t)),n==zJ&&p(null,r)}}catch(A){pG({type:zJ,messageId:o},t),p(A)}function p(A,m){A?f(A):u(m),c&&c.releaseLock(),h()}}var b0=[],HJ=[];var Yye=0;async function AG(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:a,compressed:s,signed:c,encrypted:u}=n,{workerURI:f,maxWorkers:h}=i;t.transferStreams=o||o===Xn;let p=!s&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!p&&(r||r===Xn&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&f?f:Xn,n.useCompressionStream=a||a===Xn&&i.useCompressionStream,(await A()).run();async function A(){let _=b0.find(y=>!y.busy);if(_)return qye(_),new ZT(_,e,t,m);if(b0.length<h){let y={indexWorker:Yye};return Yye++,b0.push(y),new ZT(y,e,t,m)}else return new Promise(y=>HJ.push({resolve:y,stream:e,workerOptions:t}))}function m(_){if(HJ.length){let[{resolve:y,stream:C,workerOptions:E}]=HJ.splice(0,1);y(new ZT(_,C,E,m))}else _.worker?(qye(_),edt(_,t)):b0=b0.filter(y=>y!=_)}}function edt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{b0=b0.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function qye(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Kye="\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(""),tdt=Kye.length==256;function Xye(e){if(tdt){let t="";for(let n=0;n<e.length;n++)t+=Kye[e[n]];return t}else return new TextDecoder().decode(e)}function fP(e,t){return t&&t.trim().toLowerCase()=="cp437"?Xye(e):new TextDecoder(t).decode(e)}var WJ="filename",jJ="rawFilename",dP="comment",YJ="rawComment",hP="uncompressedSize",qJ="compressedSize",KJ="offset",gG="diskNumberStart",$T="lastModDate",_G="rawLastModDate",mP="lastAccessDate",Jye="rawLastAccessDate",pP="creationDate",Zye="rawCreationDate",XJ="internalFileAttributes",JJ="externalFileAttributes",ZJ="msDosCompatible",yG="zip64",$J="encrypted",e7="version",t7="versionMadeBy",n7="zipCrypto",AP="directory",i7="executable",o7="compressionMethod",r7="signature",a7="extraField",ndt=[WJ,jJ,qJ,hP,$T,_G,dP,YJ,mP,pP,KJ,gG,gG,XJ,JJ,ZJ,yG,$J,e7,t7,n7,AP,i7,o7,r7,a7,"bitFlag","filenameUTF8","commentUTF8","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Uy=class{constructor(t){ndt.forEach(n=>this[n]=t[n])}};var $ye="filenameEncoding",eCe="commentEncoding",tCe="decodeText",nCe="extractPrependedData",iCe="extractAppendedData",CG="password",EG="rawPassword",IG="passThrough",bG="signal",oCe="checkPasswordOnly",rCe="checkOverlappingEntryOnly",aCe="checkOverlappingEntry",sCe="checkSignature",xG="useWebWorkers",TG="useCompressionStream",cCe="transferStreams",SG="preventClose",lCe="encryptionStrength",uCe="extendedTimestamp",fCe="keepOrder",dCe="level",hCe="bufferedWrite",mCe="dataDescriptorSignature",pCe="useUnicodeFileNames",ACe="dataDescriptor",s7="supportZip64SplitFile",gCe="encodeText",c7="offset",l7="usdz";var wG="File format is not recognized",ECe="End of central directory not found",ICe="End of Zip64 central directory locator not found",bCe="Central directory header not found",xCe="Local file header not found",TCe="Zip64 extra field not found",SCe="File contains encrypted entry",wCe="Encryption method not supported",f7="Compression method not supported",d7="Split zip file",BCe="Overlapping entry found",_Ce="utf-8",yCe="cp437",sdt=[[hP,4294967295],[qJ,4294967295],[KJ,4294967295],[gG,65535]],cdt={65535:{getValue:Nr,bytes:4},4294967295:{getValue:tS,bytes:8}},x0=class{constructor(t,n={}){Object.assign(this,{reader:new I0(t),options:n,config:Kv(),readRanges:[]})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await Sp(i),(i.size===Xn||!i.readUint8Array)&&(i=new xp(await new Response(i.readable).blob()),await Sp(i)),i.size<22)throw new Error(wG);i.chunkSize=Zz(o);let r=await mdt(i,101010256,i.size,22,65535*16);if(!r){let L=await ic(i,0,4),g=jr(L);throw Nr(g)==134695760?new Error(d7):new Error(ECe)}let a=jr(r),s=Nr(a,12),c=Nr(a,16),u=r.offset,f=oc(a,20),h=u+22+f,p=oc(a,4),A=i.lastDiskNumber||0,m=oc(a,6),_=oc(a,8),y=0,C=0;if(c==4294967295||s==4294967295||_==65535||m==65535){let L=await ic(i,r.offset-20,20),g=jr(L);if(Nr(g,0)==117853008){c=tS(g,8);let b=await ic(i,c,56,-1),T=jr(b),B=r.offset-20-56;if(Nr(T,0)!=101075792&&c!=B){let M=c;c=B,c>M&&(y=c-M),b=await ic(i,c,56,-1),T=jr(b)}if(Nr(T,0)!=101075792)throw new Error(ICe);p==65535&&(p=Nr(T,16)),m==65535&&(m=Nr(T,20)),_==65535&&(_=tS(T,32)),s==4294967295&&(s=tS(T,40)),c-=s}}if(c>=i.size&&(y=i.size-c-s-22,c=i.size-s-22),A!=p)throw new Error(d7);if(c<0)throw new Error(wG);let E=0,I=await ic(i,c,s,m),x=jr(I);if(s){let L=r.offset-s;if(Nr(x,E)!=33639248&&c!=L){let g=c;c=L,c>g&&(y+=c-g),I=await ic(i,c,s,m),x=jr(I)}}let S=r.offset-c-(i.lastDiskOffset||0);if(s!=S&&S>=0&&(s=S,I=await ic(i,c,s,m),x=jr(I)),c<0||c>=i.size)throw new Error(wG);let w=Cc(n,t,$ye),v=Cc(n,t,eCe);for(let L=0;L<_;L++){let g=new h7(i,o,n.options);if(Nr(x,E)!=33639248)throw new Error(bCe);DCe(g,x,E+6);let b=!!g.bitFlag.languageEncodingFlag,T=E+46,B=T+g.filenameLength,M=B+g.extraFieldLength,O=oc(x,E+4),G=O>>8==0,k=O>>8==3,z=I.subarray(T,B),F=oc(x,E+32),H=M+F,Y=I.subarray(M,H),$=b,W=b,K=Nr(x,E+38),Z=G&&(eS(x,E+38)&16)==16||k&&(K>>16&61440)==16384||z.length&&z.at(-1)=="/".charCodeAt(0),pe=k&&(K>>16&73)!=0,ge=Nr(x,E+42)+y;Object.assign(g,{versionMadeBy:O,msDosCompatible:G,compressedSize:0,uncompressedSize:0,commentLength:F,directory:Z,offset:ge,diskNumberStart:oc(x,E+34),internalFileAttributes:oc(x,E+36),externalFileAttributes:K,rawFilename:z,filenameUTF8:$,commentUTF8:W,rawExtraField:I.subarray(B,M),executable:pe}),g.internalFileAttribute=g.internalFileAttributes,g.externalFileAttribute=g.externalFileAttributes;let re=Cc(n,t,tCe)||fP,ye=$?_Ce:w||yCe,Ce=W?_Ce:v||yCe,ve=re(z,ye);ve===Xn&&(ve=fP(z,ye));let Ne=re(Y,Ce);Ne===Xn&&(Ne=fP(Y,Ce)),Object.assign(g,{rawComment:Y,filename:ve,comment:Ne,directory:Z||ve.endsWith("/")}),C=Math.max(ge,C),vCe(g,g,x,E+6),g.zipCrypto=g.encrypted&&!g.extraFieldAES;let Le=new Uy(g);Le.getData=(nt,Fe)=>g.getData(nt,Le,n.readRanges,Fe),Le.arrayBuffer=async nt=>{let Fe=new TransformStream,[_t]=await Promise.all([new Response(Fe.readable).arrayBuffer(),g.getData(Fe,Le,n.readRanges,nt)]);return _t},E=H;let{onprogress:Oe}=t;if(Oe)try{await Oe(L+1,_,new Uy(g))}catch{}yield Le}let R=Cc(n,t,nCe),N=Cc(n,t,iCe);return R&&(n.prependedData=C>0?await ic(i,0,C):new Uint8Array),n.comment=f?await ic(i,u+22,f):new Uint8Array,N&&(n.appendedData=h<i.size?await ic(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var h7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i,o={}){let r=this,{reader:a,offset:s,diskNumberStart:c,extraFieldAES:u,extraFieldZip64:f,compressionMethod:h,config:p,bitFlag:A,signature:m,rawLastModDate:_,uncompressedSize:y,compressedSize:C}=r,{dataDescriptor:E}=A,I=n.localDirectory={},x=await ic(a,s,30,c),S=jr(x),w=Cc(r,o,CG),v=Cc(r,o,EG),R=Cc(r,o,IG);if(w=w&&w.length&&w,v=v&&v.length&&v,u&&u.originalCompressionMethod!=99)throw new Error(f7);if(h!=0&&h!=8&&h!=9&&!R)throw new Error(f7);if(Nr(S,0)!=67324752)throw new Error(xCe);DCe(I,S,4);let{extraFieldLength:N,filenameLength:L,lastAccessDate:g,creationDate:b}=I;I.rawExtraField=N?await ic(a,s+30+L,N,c):new Uint8Array,vCe(r,I,S,4,!0),Object.assign(n,{lastAccessDate:g,creationDate:b});let T=r.encrypted&&I.encrypted&&!R,B=T&&!u;if(R||(n.zipCrypto=B),T){if(!B&&u.strength===Xn)throw new Error(wCe);if(!w&&!v)throw new Error(SCe)}let M=s+30+L+N,O=C,G=a.readable;Object.assign(G,{diskNumberStart:c,offset:M,size:O});let k=Cc(r,o,bG),z=Cc(r,o,oCe),F=Cc(r,o,aCe),H=Cc(r,o,rCe);H&&(F=!0);let{onstart:Y,onprogress:$,onend:W}=o,K=h==9,Z=Cc(r,o,TG);K&&(Z=!1);let pe={options:{codecType:mG,password:w,rawPassword:v,zipCrypto:B,encryptionStrength:u&&u.strength,signed:Cc(r,o,sCe)&&!R,passwordVerification:B&&(E?_>>>8&255:m>>>24&255),outputSize:R?C:y,signature:m,compressed:h!=0&&!R,encrypted:r.encrypted&&!R,useWebWorkers:Cc(r,o,xG),useCompressionStream:Z,transferStreams:Cc(r,o,cCe),deflate64:K,checkPasswordOnly:z},config:p,streamOptions:{signal:k,size:O,onstart:Y,onprogress:$,onend:W}};F&&await hdt({reader:a,fileEntry:n,offset:s,diskNumberStart:c,signature:m,compressedSize:C,uncompressedSize:y,dataOffset:M,dataDescriptor:E||I.bitFlag.dataDescriptor,extraFieldZip64:f||I.extraFieldZip64,readRanges:i});let ge;try{if(!H){z&&(t=new WritableStream),t=new qT(t),await Sp(t,R?C:y),{writable:ge}=t;let{outputSize:re}=await AG({readable:G,writable:ge},pe);if(t.size+=re,re!=(R?C:y))throw new Error(JT)}}catch(re){if(re.outputSize!==Xn&&(t.size+=re.outputSize),!z||re.message!=lg)throw re}finally{!Cc(r,o,SG)&&ge&&!ge.locked&&await ge.getWriter().close()}return z||H?Xn:t.getData?t.getData():ge}};function DCe(e,t,n){let i=e.rawBitFlag=oc(t,n+2),o=(i&1)==1,r=Nr(t,n+6);Object.assign(e,{encrypted:o,version:oc(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:pdt(r),filenameLength:oc(t,n+22),extraFieldLength:oc(t,n+24)})}function vCe(e,t,n,i,o){let{rawExtraField:r}=t,a=t.extraField=new Map,s=jr(new Uint8Array(r)),c=0;try{for(;c<r.length;){let C=oc(s,c),E=oc(s,c+2);a.set(C,{type:C,data:r.slice(c+4,c+4+E)}),c+=4+E}}catch{}let u=oc(n,i+4);Object.assign(t,{signature:Nr(n,i+10),compressedSize:Nr(n,i+14),uncompressedSize:Nr(n,i+18)});let f=a.get(1);f&&(ldt(f,t),t.extraFieldZip64=f);let h=a.get(28789);h&&(CCe(h,WJ,jJ,t,e),t.extraFieldUnicodePath=h);let p=a.get(25461);p&&(CCe(p,dP,YJ,t,e),t.extraFieldUnicodeComment=p);let A=a.get(39169);A?(udt(A,t,u),t.extraFieldAES=A):t.compressionMethod=u;let m=a.get(10);m&&(fdt(m,t),t.extraFieldNTFS=m);let _=a.get(21589);_&&(ddt(_,t,o),t.extraFieldExtendedTimestamp=_);let y=a.get(6534);y&&(t.extraFieldUSDZ=y)}function ldt(e,t){t.zip64=!0;let n=jr(e.data),i=sdt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[a,s]=i[o];if(t[a]==s){let c=cdt[s];t[a]=e[a]=c.getValue(n,r),r+=c.bytes}else if(e[a])throw new Error(TCe)}}function CCe(e,t,n,i,o){let r=jr(e.data),a=new sg;a.append(o[n]);let s=jr(new Uint8Array(4));s.setUint32(0,a.get(),!0);let c=Nr(r,1);Object.assign(e,{version:eS(r,0),[t]:fP(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&c==Nr(s,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function udt(e,t,n){let i=jr(e.data),o=eS(i,4);Object.assign(e,{vendorVersion:eS(i,0),vendorId:eS(i,2),strength:o,originalCompressionMethod:n,compressionMethod:oc(i,5)}),t.compressionMethod=e.compressionMethod}function fdt(e,t){let n=jr(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=oc(n,i),a=oc(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+a)),i+=4+a}}catch{}try{if(o&&o.length==24){let r=jr(o),a=r.getBigUint64(0,!0),s=r.getBigUint64(8,!0),c=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:a,rawLastAccessDate:s,rawCreationDate:c});let u=u7(a),f=u7(s),h=u7(c),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function ddt(e,t,n){let i=jr(e.data),o=eS(i,0),r=[],a=[];n?((o&1)==1&&(r.push($T),a.push(_G)),(o&2)==2&&(r.push(mP),a.push(Jye)),(o&4)==4&&(r.push(pP),a.push(Zye))):e.data.length>=5&&(r.push($T),a.push(_G));let s=1;r.forEach((c,u)=>{if(e.data.length>=s+4){let f=Nr(i,s);t[c]=e[c]=new Date(f*1e3);let h=a[u];e[h]=f}s+=4})}async function hdt({reader:e,fileEntry:t,offset:n,diskNumberStart:i,signature:o,compressedSize:r,uncompressedSize:a,dataOffset:s,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let h=0;if(i)for(let m=0;m<i;m++){let _=e.readers[m];h+=_.size}let p=0;if(c&&(u?p=20:p=12),p){let m=await ic(e,s+r,p+4,i);if(Nr(jr(m),0)==134695760){let y=Nr(jr(m),4),C,E;u?(C=tS(jr(m),8),E=tS(jr(m),16)):(C=Nr(jr(m),8),E=Nr(jr(m),12)),(t.encrypted&&!t.zipCrypto||y==o)&&C==r&&E==a&&(p+=4)}}let A={start:h+n,end:h+s+r+p,fileEntry:t};for(let m of f)if(m.fileEntry!=t&&A.start>=m.start&&A.start<m.end){let _=new Error(BCe);throw _.overlappingEntry=m.fileEntry,_}f.push(A)}async function mdt(e,t,n,i,o){let r=new Uint8Array(4),a=jr(r);Adt(a,0,t);let s=i+o;return await c(i)||await c(Math.min(s,n));async function c(u){let f=n-u,h=await ic(e,f,u);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:f+p,buffer:h.slice(p,p+i).buffer}}}function Cc(e,t,n){return t[n]===Xn?e.options[n]:t[n]}function pdt(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 u7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function eS(e,t){return e.getUint8(t)}function oc(e,t){return e.getUint16(t,!0)}function Nr(e,t){return e.getUint32(t,!0)}function tS(e,t){return Number(e.getBigUint64(t,!0))}function Adt(e,t,n){e.setUint32(t,n,!0)}function jr(e){return new DataView(e.buffer)}var FCe="File already exists",QCe="Zip file comment exceeds 64KB",kCe="File entry comment exceeds 64KB",UCe="File entry name exceeds 64KB",R7="Version exceeds 65535",zCe="The strength must equal 1, 2, or 3",GCe="Extra field type exceeds 65535",VCe="Extra field data exceeds 64KB",kG="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",HCe="Undefined uncompressed size",WCe="Zip file not empty",MCe=new Uint8Array([7,0,2,0,65,69,3,0,0]),v7=0,NCe=[],CP=class{constructor(t,n={}){t=new qT(t);let i=t.availableSize!==Xn&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Xn&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:Kv(),files:new Map,filenames:new Set,offset:n[c7]===Xn?t.size||t.writable.size||0:n[c7],pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async prependZip(t){if(this.filenames.size)throw new Error(WCe);t=new I0(t);let n=new x0(t.readable),i=await n.getEntries();await n.close(),await t.readable.pipeTo(this.writer.writable,{preventClose:!0,preventAbort:!0}),this.writer.size=this.offset=t.size,this.filenames=new Set(i.map(o=>o.filename)),this.files=new Map(i.map(o=>{let{version:r,compressionMethod:a,lastModDate:s,lastAccessDate:c,creationDate:u,rawFilename:f,bitFlag:h,encrypted:p,uncompressedSize:A,compressedSize:m,diskOffset:_,diskNumber:y,zip64:C}=o,{rawExtraFieldZip64:E,rawExtraFieldAES:I,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:S,rawExtraField:w}=o,{level:v,languageEncodingFlag:R,dataDescriptor:N}=h;E=E||new Uint8Array,I=I||new Uint8Array,x=x||new Uint8Array,S=S||new Uint8Array,w=w||new Uint8Array;let L=Gi(E,I,x,S,w),g=C&&A>4294967295,b=C&&m>4294967295,{headerArray:T,headerView:B}=jCe({version:r,bitFlag:YCe(v,R,N,p,a),compressionMethod:a,uncompressedSize:A,compressedSize:m,lastModDate:s,rawFilename:f,zip64CompressedSize:b,zip64UncompressedSize:g,extraFieldLength:L});return Object.assign(o,{zip64UncompressedSize:g,zip64CompressedSize:b,zip64Offset:C&&this.offset-_>4294967295,zip64DiskNumberStart:C&&y>65535,rawExtraFieldZip64:E,rawExtraFieldAES:I,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:S,rawExtraField:w,extendedTimestamp:x.length>0||S.length>0,extraFieldExtendedTimestampFlag:1+(c?2:0)+(u?4:0),headerArray:T,headerView:B}),[o.filename,o]}))}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:a}=o;v7<a.maxWorkers?v7++:await new Promise(c=>NCe.push(c));let s;try{if(t=t.trim(),o.filenames.has(t))throw new Error(FCe);return o.filenames.add(t),s=Idt(o,t,n,i),r.add(s),await s}catch(c){throw o.filenames.delete(t),c}finally{r.delete(s);let c=NCe.shift();c?c():v7--}}remove(t){let{filenames:n,files:i}=this;if(typeof t=="string"&&(t=i.get(t)),t&&t.filename!==Xn){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:a}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await vdt(this,t,n),yo(i,n,SG)||await a.getWriter().close(),r.getData?r.getData():a}};async function Idt(e,t,n,i){t=t.trim();let o=yo(e,i,ZJ),r=yo(e,i,t7,o?20:768),a=yo(e,i,i7);if(r>65535)throw new Error(R7);let s=yo(e,i,JJ,0);!i[AP]&&t.endsWith("/")&&(i[AP]=!0),yo(e,i,AP)?(t.endsWith("/")||(t+="/"),s===0&&(s=16,o||(s|=16877<<16))):!o&&s===0&&(a?s=493<<16:s=420<<16);let u=yo(e,i,gCe,KT),f=u(t);if(f===Xn&&(f=KT(t)),Gi(f)>65535)throw new Error(UCe);let h=i[dP]||"",p=u(h);if(p===Xn&&(p=KT(h)),Gi(p)>65535)throw new Error(kCe);let A=yo(e,i,e7,20);if(A>65535)throw new Error(R7);let m=yo(e,i,$T,new Date),_=yo(e,i,mP),y=yo(e,i,pP),C=yo(e,i,XJ,0),E=yo(e,i,IG),I,x;E||(I=yo(e,i,CG),x=yo(e,i,EG));let S=yo(e,i,lCe,3),w=yo(e,i,n7),v=yo(e,i,uCe,!0),R=yo(e,i,fCe,!0),N=yo(e,i,xG),L=yo(e,i,hCe),g=yo(e,i,mCe,!1),b=yo(e,i,bG),T=yo(e,i,pCe,!0),B=yo(e,i,o7),M=yo(e,i,dCe),O=yo(e,i,TG),G=yo(e,i,ACe);L&&G===Xn&&(G=!1),(G===Xn||w)&&(G=!0),M!==Xn&&M!=6&&(O=!1),!O&&e.config.CompressionStream===Xn&&e.config.CompressionStreamZlib===Xn&&(M=0);let k=yo(e,i,yG);if(!w&&(I!==Xn||x!==Xn)&&!(S>=1&&S<=3))throw new Error(zCe);let z=new Uint8Array,F=i[a7];if(F){let _t=0,rt=0;F.forEach(je=>_t+=4+Gi(je)),z=new Uint8Array(_t),F.forEach((je,st)=>{if(st>65535)throw new Error(GCe);if(Gi(je)>65535)throw new Error(VCe);Ya(z,new Uint16Array([st]),rt),Ya(z,new Uint16Array([Gi(je)]),rt+2),Ya(z,je,rt+4),rt+=4+Gi(je)})}let H=0,Y=0,$=0;if(E&&($=i[hP],$===Xn))throw new Error(HCe);let W=k===!0;n&&(n=new I0(n),await Sp(n),E?(i.uncompressedSize=$,H=OCe($)):n.size===Xn?(G=!0,(k||k===Xn)&&(k=!0,$=H=4294967296)):(i.uncompressedSize=$=n.size,H=OCe($)));let{diskOffset:K,diskNumber:Z,maxSize:pe}=e.writer,ge=W||$>4294967295,re=W||H>4294967295,ye=W||e.offset+e.pendingEntriesSize-K>4294967295,ve=yo(e,i,s7,!0)&&W||Z+Math.ceil(e.pendingEntriesSize/pe)>65535;if(ye||ge||re||ve){if(k===!1||!R)throw new Error(kG);k=!0}k=k||!1;let Ne=yo(e,i,$J);i=Object.assign({},i,{rawFilename:f,rawComment:p,version:A,versionMadeBy:r,lastModDate:m,lastAccessDate:_,creationDate:y,rawExtraField:z,zip64:k,zip64UncompressedSize:ge,zip64CompressedSize:re,zip64Offset:ye,zip64DiskNumberStart:ve,password:I,rawPassword:x,level:M,useWebWorkers:N,encryptionStrength:S,extendedTimestamp:v,zipCrypto:w,bufferedWrite:L,keepOrder:R,useUnicodeFileNames:T,dataDescriptor:G,dataDescriptorSignature:g,signal:b,msDosCompatible:o,internalFileAttribute:C,internalFileAttributes:C,externalFileAttribute:s,externalFileAttributes:s,useCompressionStream:O,passThrough:E,encrypted:!!(I&&Gi(I)||x&&Gi(x))||E&&Ne,signature:i[r7],compressionMethod:B,uncompressedSize:$,offset:e.offset-K,diskNumberStart:Z});let Le=Tdt(i),Oe=wdt(i),nt=Gi(Le.localHeaderArray,Oe.dataDescriptorArray);Y=nt+H,e.options[l7]&&(Y+=Y+64),e.pendingEntriesSize+=Y;let Fe;try{Fe=await bdt(e,t,n,{headerInfo:Le,dataDescriptorInfo:Oe,metadataSize:nt},i)}finally{e.pendingEntriesSize-=Y}return Object.assign(Fe,{name:t,comment:h,extraField:F}),new Uy(Fe)}async function bdt(e,t,n,i,o){let{files:r,writer:a}=e,{keepOrder:s,dataDescriptor:c,signal:u}=o,{headerInfo:f}=i,h=e.options[l7],p=Array.from(r.values()).pop(),A={},m,_,y,C,E,I,x;r.set(t,A);try{let R;s&&(R=p&&p.lock,S()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&s||!c)&&!h?(I=new TransformStream,I.size=0,m=!0,e.bufferedWrites++,await Sp(a)):(I=a,await w()),await Sp(I);let{writable:N,diskOffset:L}=a;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let M=new Uint8Array(4),O=Ec(M);zi(O,0,134695760),await ug(a,M),e.offset+=4}h&&Sdt(i,e.offset-L);let{localHeaderView:g,localHeaderArray:b}=f;m||(await R,await v(N));let{diskNumber:T}=a;E=!0,A.diskNumberStart=T,m?x=new Response(I.readable).blob():await ug(I,b),A=await xdt(n,I,A,i,e.config,o);let{zip64:B}=A;if(E=!1,r.set(t,A),A.filename=t,m){let[M]=await Promise.all([x,I.writable.getWriter().close(),R]);await w(),C=!0,A.diskNumberStart=a.diskNumber,A.offset=e.offset-a.diskOffset,B&&LCe(A),Ddt(A,g,o),await v(N),await ug(a,b),await M.stream().pipeTo(N,{preventClose:!0,preventAbort:!0,signal:u}),a.size+=I.size,C=!1}else A.offset=e.offset-L,B&&LCe(A);if(A.offset>4294967295&&!B)throw new Error(kG);return e.offset+=A.size,A}catch(R){if(m&&C||!m&&E){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=I.size:e.offset=I.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,y&&y(),_&&_()}function S(){A.lock=new Promise(R=>y=R)}async function w(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(N=>_=()=>{e.writerLocked=!1,N()}),await R}async function v(R){Gi(f.localHeaderArray)>a.availableSize&&(a.availableSize=0,await ug(R,new Uint8Array))}}async function xdt(e,t,{diskNumberStart:n,lock:i},o,r,a){let{headerInfo:s,dataDescriptorInfo:c,metadataSize:u}=o,{headerArray:f,headerView:h,lastModDate:p,rawLastModDate:A,encrypted:m,compressed:_,version:y,compressionMethod:C,rawExtraFieldZip64:E,localExtraFieldZip64Length:I,rawExtraFieldExtendedTimestamp:x,extraFieldExtendedTimestampFlag:S,rawExtraFieldNTFS:w,rawExtraFieldAES:v}=s,{dataDescriptorArray:R}=c,{rawFilename:N,lastAccessDate:L,creationDate:g,password:b,rawPassword:T,level:B,zip64:M,zip64UncompressedSize:O,zip64CompressedSize:G,zip64Offset:k,zip64DiskNumberStart:z,zipCrypto:F,dataDescriptor:H,directory:Y,executable:$,versionMadeBy:W,rawComment:K,rawExtraField:Z,useWebWorkers:pe,onstart:ge,onprogress:re,onend:ye,signal:Ce,encryptionStrength:ve,extendedTimestamp:Ne,msDosCompatible:Le,internalFileAttributes:Oe,externalFileAttributes:nt,useCompressionStream:Fe,passThrough:_t}=a,rt={lock:i,versionMadeBy:W,zip64:M,directory:!!Y,executable:!!$,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:K,rawExtraFieldZip64:E,localExtraFieldZip64Length:I,rawExtraFieldExtendedTimestamp:x,rawExtraFieldNTFS:w,rawExtraFieldAES:v,rawExtraField:Z,extendedTimestamp:Ne,msDosCompatible:Le,internalFileAttributes:Oe,externalFileAttributes:nt,diskNumberStart:n},{signature:je,uncompressedSize:st}=a,ft=0;_t||(st=0);let{writable:St}=t;if(e){e.chunkSize=Zz(r);let be=e.readable,Se=e.size,qt={options:{codecType:hG,level:B,rawPassword:T,password:b,encryptionStrength:ve,zipCrypto:m&&F,passwordVerification:m&&F&&A>>8&255,signed:!_t,compressed:_&&!_t,encrypted:m&&!_t,useWebWorkers:pe,useCompressionStream:Fe,transferStreams:!1},config:r,streamOptions:{signal:Ce,size:Se,onstart:ge,onprogress:re,onend:ye}};try{let mt=await AG({readable:be,writable:St},qt);ft=mt.outputSize,t.size+=ft,_t||(st=mt.inputSize,je=mt.signature)}catch(mt){throw mt.outputSize!==Xn&&(t.size+=mt.outputSize),mt}}return Bdt({signature:je,compressedSize:ft,uncompressedSize:st,headerInfo:s,dataDescriptorInfo:c},a),H&&await ug(t,R),Object.assign(rt,{uncompressedSize:st,compressedSize:ft,lastModDate:p,rawLastModDate:A,creationDate:g,lastAccessDate:L,encrypted:m,zipCrypto:F,size:u+ft,compressionMethod:C,version:y,headerArray:f,headerView:h,signature:je,extraFieldExtendedTimestampFlag:S,zip64UncompressedSize:O,zip64CompressedSize:G,zip64Offset:k,zip64DiskNumberStart:z}),rt}function Tdt(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:a,zipCrypto:s,useUnicodeFileNames:c,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:A,passThrough:m,encrypted:_,zip64UncompressedSize:y,zip64CompressedSize:C,zip64Offset:E,zip64DiskNumberStart:I,uncompressedSize:x,offset:S,diskNumberStart:w}=e,{version:v,compressionMethod:R}=e,N=!f&&(r>0||r===Xn&&R!==0),L,g=m||!N,b=a&&(e.bufferedWrite||!y&&!C||g);if(a){let K=4;y&&(K+=8),C&&(K+=8),E&&(K+=8),I&&(K+=4),L=new Uint8Array(K);let Z=Ec(L);if(Co(Z,0,1),Co(Z,2,Gi(L)-4),b){let pe=Ec(L),ge=4;y&&(us(pe,ge,BigInt(x)),ge+=8),C&&g&&(us(pe,ge,BigInt(x)),ge+=8),E&&(us(pe,ge,BigInt(S)),ge+=8),I&&(zi(pe,ge,w),ge+=4)}}else L=new Uint8Array;let T;if(_&&!s){T=new Uint8Array(Gi(MCe)+2);let K=Ec(T);Co(K,0,39169),Ya(T,MCe,2),M7(K,8,p)}else T=new Uint8Array;let B,M,O;if(A){M=new Uint8Array(9+(i?4:0)+(o?4:0));let K=Ec(M);Co(K,0,21589),Co(K,2,Gi(M)-4),O=1+(i?2:0)+(o?4:0),M7(K,4,O);let Z=5;zi(K,Z,Math.floor(n.getTime()/1e3)),Z+=4,i&&(zi(K,Z,Math.floor(i.getTime()/1e3)),Z+=4),o&&zi(K,Z,Math.floor(o.getTime()/1e3));try{B=new Uint8Array(36);let pe=Ec(B),ge=P7(n);Co(pe,0,10),Co(pe,2,32),Co(pe,8,1),Co(pe,10,24),us(pe,12,ge),us(pe,20,P7(i)||ge),us(pe,28,P7(o)||ge)}catch{B=new Uint8Array}}else B=M=new Uint8Array;R===Xn&&(R=N?8:0),a&&(v=v>45?v:45),_&&!s&&(v=v>51?v:51,T[9]=R,R=99);let G=b?Gi(L):0,k=G+Gi(T,M,B,h),{headerArray:z,headerView:F,rawLastModDate:H}=jCe({version:v,bitFlag:YCe(r,c,u,_,R),compressionMethod:R,uncompressedSize:x,lastModDate:n<PJ?PJ:n>vJ?vJ:n,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:y,extraFieldLength:k}),Y=30,$=new Uint8Array(Y+Gi(t)+k),W=Ec($);return zi(W,0,67324752),Ya($,z,4),Ya($,t,Y),Y+=Gi(t),b&&Ya($,L,Y),Y+=G,Ya($,T,Y),Y+=Gi(T),Ya($,M,Y),Y+=Gi(M),Ya($,B,Y),Y+=Gi(B),Ya($,h,Y),u&&(zi(W,18,0),zi(W,22,0)),{localHeaderArray:$,localHeaderView:W,headerArray:z,headerView:F,lastModDate:n,rawLastModDate:H,encrypted:_,compressed:N,version:v,compressionMethod:R,extraFieldExtendedTimestampFlag:O,rawExtraFieldZip64:L,localExtraFieldZip64Length:G,rawExtraFieldExtendedTimestamp:M,rawExtraFieldNTFS:B,rawExtraFieldAES:T,extraFieldLength:k}}function Sdt(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ec(i),a=64-(t+Gi(i))%64;a<4&&(a+=64);let s=new Uint8Array(a),c=Ec(s);Co(c,0,6534),Co(c,2,a-2);let u=i;n.localHeaderArray=i=new Uint8Array(Gi(u)+a),Ya(i,u),Ya(i,s,Gi(u)),r=Ec(i),Co(r,28,o+a),e.metadataSize+=a}function wdt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=new Uint8Array,o,r=0,a=e?20:12;return n&&(a+=4),t&&(i=new Uint8Array(a),o=Ec(i),n&&(r=4,zi(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function Bdt({signature:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:a,dataDescriptor:s}){let{headerView:c,encrypted:u}=i,{dataDescriptorView:f,dataDescriptorOffset:h}=o;(!u||a)&&e!==Xn&&(zi(c,10,e),s&&zi(f,h,e)),r?s&&(us(f,h+4,BigInt(t)),us(f,h+12,BigInt(n))):(zi(c,14,t),zi(c,18,n),s&&(zi(f,h+4,t),zi(f,h+8,n)))}function Ddt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,signature:o,compressedSize:r,uncompressedSize:a,offset:s,diskNumberStart:c,zip64UncompressedSize:u,zip64CompressedSize:f,zip64Offset:h,zip64DiskNumberStart:p},A,{dataDescriptor:m}){if(m||(t||zi(A,14,o),n||(zi(A,18,r),zi(A,22,a))),n&&i){let _=30+Gi(e)+4;u&&(us(A,_,BigInt(a)),_+=8),f&&(us(A,_,BigInt(r)),_+=8),h&&(us(A,_,BigInt(s)),_+=8),p&&zi(A,_,c)}}function LCe({compressedSize:e,uncompressedSize:t,offset:n,diskNumberStart:i,zip64UncompressedSize:o,zip64CompressedSize:r,zip64Offset:a,zip64DiskNumberStart:s,rawExtraFieldZip64:c}){let u=Ec(c),f=4;o&&(us(u,f,BigInt(t)),f+=8),r&&(us(u,f,BigInt(e)),f+=8),a&&(us(u,f,BigInt(n)),f+=8),s&&zi(u,f,i)}async function vdt(e,t,n){let{files:i,writer:o}=e,{diskOffset:r}=o,{diskNumber:a}=o,s=0,c=0,u=e.offset-r,f=i.size;for(let[,x]of i){let{rawFilename:S,rawExtraFieldZip64:w,rawExtraFieldAES:v,rawComment:R,rawExtraFieldNTFS:N,rawExtraField:L,extendedTimestamp:g,extraFieldExtendedTimestampFlag:b,lastModDate:T}=x,B;if(g){B=new Uint8Array(9);let M=Ec(B);Co(M,0,21589),Co(M,2,5),M7(M,4,b),zi(M,5,Math.floor(T.getTime()/1e3))}else B=new Uint8Array;x.rawExtraFieldExtendedTimestamp=B,c+=46+Gi(S,R,w,v,N,B,L)}let h=new Uint8Array(c),p=Ec(h);await Sp(o);let A=0;for(let[x,S]of Array.from(i.values()).entries()){let{offset:w,rawFilename:v,rawExtraFieldZip64:R,rawExtraFieldAES:N,rawExtraFieldExtendedTimestamp:L,rawExtraFieldNTFS:g,rawExtraField:b,rawComment:T,versionMadeBy:B,headerArray:M,headerView:O,zip64:G,zip64UncompressedSize:k,zip64CompressedSize:z,zip64DiskNumberStart:F,zip64Offset:H,internalFileAttributes:Y,externalFileAttributes:$,diskNumberStart:W,uncompressedSize:K,compressedSize:Z}=S,pe=Gi(R,N,L,g,b);zi(p,s,33639248),Co(p,s+4,B),k||zi(O,18,K),z||zi(O,14,Z),Ya(h,M,s+6);let ge=s+30;if(Co(p,ge,pe),ge+=2,Co(p,ge,Gi(T)),ge+=2,Co(p,ge,G&&F?65535:W),ge+=2,Co(p,ge,Y),ge+=2,$&&zi(p,ge,$),ge+=4,zi(p,ge,G&&H?4294967295:w),ge+=4,Ya(h,v,ge),ge+=Gi(v),Ya(h,R,ge),ge+=Gi(R),Ya(h,N,ge),ge+=Gi(N),Ya(h,L,ge),ge+=Gi(L),Ya(h,g,ge),ge+=Gi(g),Ya(h,b,ge),ge+=Gi(b),Ya(h,T,ge),s-A>o.availableSize&&(o.availableSize=0,await ug(o,h.slice(A,s)),A=s),s=ge,n.onprogress)try{await n.onprogress(x+1,i.size,new Uy(S))}catch{}}await ug(o,A?h.slice(A):h);let m=o.diskNumber,{availableSize:_}=o;_<22&&m++;let y=yo(e,n,yG);if(u>4294967295||c>4294967295||f>65535||m>65535){if(y===!1)throw new Error(kG);y=!0}let C=new Uint8Array(y?98:22),E=Ec(C);s=0,y&&(zi(E,0,101075792),us(E,4,BigInt(44)),Co(E,12,45),Co(E,14,45),zi(E,16,m),zi(E,20,a),us(E,24,BigInt(f)),us(E,32,BigInt(f)),us(E,40,BigInt(c)),us(E,48,BigInt(u)),zi(E,56,117853008),us(E,64,BigInt(u)+BigInt(c)),zi(E,72,m+1),yo(e,n,s7,!0)&&(m=65535,a=65535),f=65535,u=4294967295,c=4294967295,s+=76),zi(E,s,101010256),Co(E,s+4,m),Co(E,s+6,a),Co(E,s+8,f),Co(E,s+10,f),zi(E,s+12,c),zi(E,s+16,u);let I=Gi(t);if(I)if(I<=65535)Co(E,s+20,I);else throw new Error(QCe);await ug(o,C),I&&await ug(o,t)}async function ug(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Gi(t),await i.write(t)}finally{i.releaseLock()}}function P7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function yo(e,t,n,i){let o=t[n]===Xn?e.options[n]:t[n];return o===Xn?i:o}function OCe(e){return e+5*(Math.floor(e/16383)+1)}function M7(e,t,n){e.setUint8(t,n)}function Co(e,t,n){e.setUint16(t,n,!0)}function zi(e,t,n){e.setUint32(t,n,!0)}function us(e,t,n){e.setBigUint64(t,n,!0)}function Ya(e,t,n){e.set(t,n)}function Ec(e){return new DataView(e.buffer)}function Gi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function jCe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawFilename:a,zip64CompressedSize:s,zip64UncompressedSize:c,extraFieldLength:u}){let f=new Uint8Array(26),h=Ec(f);Co(h,0,e),Co(h,2,t),Co(h,4,n);let p=new Uint32Array(1),A=Ec(p);Co(A,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),Co(A,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate());let m=p[0];return zi(h,6,m),(s||o!==Xn)&&zi(h,14,s?4294967295:o),(c||i!==Xn)&&zi(h,18,c?4294967295:i),Co(h,22,Gi(a)),Co(h,24,u),{headerArray:f,headerView:h,rawLastModDate:m}}function YCe(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}var qCe;try{qCe=import.meta.url}catch{}WT({baseURI:qCe,CompressionStreamZlib:Xv,DecompressionStreamZlib:Jv});var N7=32,Pdt="http://www.opengis.net/kml/2.2",Yh="http://www.google.com/kml/ext/2.2",Rdt="http://www.w3.org/2000/xmlns/";function UG(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Mdt=/^data:image\/([^,;]+)/;UG.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Mdt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function Ndt(e,t){return function(n){e._files[t]=n}}UG.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ue("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let a=Promise.resolve(i[r]);this._promises.push(a),a.then(Ndt(this,r))}return o};Object.defineProperties(UG.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function zG(e){this._time=e}zG.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};zG.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return B0(n)};zG.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function L7(){this._ids={},this._styles={},this._count=0}L7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};L7.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 JCe(){this._ids={}}JCe.prototype.get=function(e){if(!l(e))return this.get(Jn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function O7(e){e=e??V.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=O7._createState(e),o=t.values.filter(function(u){return!l(u.parent)}),r=i.kmlDoc,a=r.documentElement;a.setAttributeNS(Rdt,"xmlns:gx",Yh);let s=r.createElement("Document");a.appendChild(s),$Ce(i,s,o),i.styleCache.save(s);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Ldt(f,c.files):{kml:f,externalFiles:c.files}})}async function Ldt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");WT({workerURI:n,wasmURI:i});let o=new YT("application/vnd.google-earth.kmz"),r=new CP(o);await r.add("doc.kml",new eP(e));let a=Object.keys(t);return await ZCe(r,a,t,0),await r.close(),{kmz:await o.getData()}}async function ZCe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new xp(n[o])),ZCe(e,t,n,i+1)}O7._createState=function(e){let t=e.entities,n=new L7,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,a=e.sampleDuration??60;r.start===Ze.MINIMUM_VALUE?r.stop===Ze.MAXIMUM_VALUE?r=new Rn:X.addSeconds(r.stop,-10*a,r.start):r.stop===Ze.MAXIMUM_VALUE&&X.addSeconds(r.start,10*a,r.stop);let s=new UG(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Pdt,"kml"),ellipsoid:e.ellipsoid??te.default,idManager:new JCe,styleCache:n,externalFileHandler:s,time:o,valueGetter:new zG(o),sampleDuration:a,defaultAvailability:new Ba([r])}};function $Ce(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,a=e.idManager,s=n.length,c,u,f;for(let h=0;h<s;++h){let p=n[h];c=[],u=[],f=[],Odt(e,p,u,f),Fdt(e,p.polyline,u,f),XCe(e,p.rectangle,u,f,c),XCe(e,p.polygon,u,f,c),zdt(e,p,p.model,u,f);let A,m=p.availability;l(m)&&(A=i.createElement("TimeSpan"),X.equals(m.start,Ze.MINIMUM_VALUE)||A.appendChild(_n(i,"begin",X.toIso8601(m.start))),X.equals(m.stop,Ze.MAXIMUM_VALUE)||A.appendChild(_n(i,"end",X.toIso8601(m.stop))));for(let C=0;C<c.length;++C){let E=c[C];E.setAttribute("id",a.get(p.id)),E.appendChild(_n(i,"name",p.name)),E.appendChild(_n(i,"visibility",p.show)),E.appendChild(_n(i,"description",p.description)),l(A)&&E.appendChild(A),t.appendChild(E)}let _=u.length;if(_>0){let C=i.createElement("Placemark");C.setAttribute("id",a.get(p.id));let E=p.name,I=p.label;if(l(I)){let S=i.createElement("LabelStyle"),w=r.get(I.text);E=l(w)&&w.length>0?w:E;let v=r.getColor(I.fillColor);l(v)&&(S.appendChild(_n(i,"color",v)),S.appendChild(_n(i,"colorMode","normal")));let R=r.get(I.scale);l(R)&&S.appendChild(_n(i,"scale",R)),f.push(S)}C.appendChild(_n(i,"name",E)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),l(A)&&C.appendChild(A),t.appendChild(C);let x=f.length;if(x>0){let S=i.createElement("Style");for(let w=0;w<x;++w)S.appendChild(f[w]);C.appendChild(_n(i,"styleUrl",o.get(S)))}if(u.length===1)C.appendChild(u[0]);else if(u.length>1){let S=i.createElement("MultiGeometry");for(let w=0;w<_;++w)S.appendChild(u[w]);C.appendChild(S)}}let y=p._children;if(y.length>0){let C=i.createElement("Folder");C.setAttribute("id",a.get(p.id)),C.appendChild(_n(i,"name",p.name)),C.appendChild(_n(i,"visibility",p.show)),C.appendChild(_n(i,"description",p.description)),t.appendChild(C),$Ce(e,C,y)}}}var bu=new d,Ol=new me,jh=new X;function Odt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=e.valueGetter,s=t.billboard??t.point;if(!l(s)&&!l(t.path))return;let c=t.position;if(!c.isConstant){eEe(e,t,s,n,i);return}a.get(c,void 0,bu);let u=_n(o,"coordinates",w0(bu,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(D0(e,s.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=s instanceof dl?nEe(e,s):tEe(e,s);i.push(p)}function eEe(e,t,n,i,o){let r=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter,c,u=t.position,f=!0;u instanceof _c?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let h=n instanceof a_,p,A,m,_=[];for(p=0;p<c.length;++p){let C=c.get(p),E=f?u:C.data,I=r.createElement("altitudeMode");E instanceof ag?(E=E._value,I.appendChild(D0(e,ot.CLAMP_TO_GROUND))):l(n)?I.appendChild(D0(e,n.heightReference)):I.appendChild(D0(e,ot.NONE));let x=[],S=[];if(E.isConstant){s.get(E,void 0,bu);let v=_n(r,"coordinates",w0(bu,a));x.push(X.toIso8601(C.start)),S.push(v),x.push(X.toIso8601(C.stop)),S.push(v)}else if(E instanceof yc)for(m=E._property._times,A=0;A<m.length;++A)x.push(X.toIso8601(m[A])),E.getValueInReferenceFrame(m[A],Oi.FIXED,bu),S.push(w0(bu,a));else if(E instanceof wd){m=E._times;let v=E._values;for(A=0;A<m.length;++A)x.push(X.toIso8601(m[A])),d.fromArray(v,A*3,bu),S.push(w0(bu,a))}else{let v=e.sampleDuration;C.start.clone(jh),C.isStartIncluded||X.addSeconds(jh,v,jh);let R=C.stop;for(;X.lessThan(jh,R);)E.getValue(jh,bu),x.push(X.toIso8601(jh)),S.push(w0(bu,a)),X.addSeconds(jh,v,jh);C.isStopIncluded&&X.equals(jh,R)&&(E.getValue(jh,bu),x.push(X.toIso8601(jh)),S.push(w0(bu,a)))}let w=r.createElementNS(Yh,"Track");w.appendChild(I);for(let v=0;v<x.length;++v){let R=_n(r,"when",x[v]),N=_n(r,"coord",S[v],Yh);w.appendChild(R),w.appendChild(N)}h&&w.appendChild(iEe(e,n)),_.push(w)}if(_.length===1)i.push(_[0]);else if(_.length>1){let C=r.createElementNS(Yh,"MultiTrack");for(p=0;p<_.length;++p)C.appendChild(_[p]);i.push(C)}if(l(n)&&!h){let C=n instanceof dl?nEe(e,n):tEe(e,n);o.push(C)}let y=t.path;if(l(y)){let C=s.get(y.width),E=y.material;if(l(E)||l(C)){let I=r.createElement("LineStyle");l(C)&&I.appendChild(_n(r,"width",C)),F7(e,E,I),o.push(I)}}}function tEe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(_n(n,"color",r)),o.appendChild(_n(n,"colorMode","normal")));let a=i.get(t.pixelSize);return l(a)&&o.appendChild(_n(n,"scale",a/N7)),o}function nEe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),a=i.get(t.image);if(l(a)){a=o.texture(a);let p=n.createElement("Icon");p.appendChild(_n(n,"href",a));let A=i.get(t.imageSubRegion);l(A)&&(p.appendChild(_n(n,"x",A.x,Yh)),p.appendChild(_n(n,"y",A.y,Yh)),p.appendChild(_n(n,"w",A.width,Yh)),p.appendChild(_n(n,"h",A.height,Yh))),r.appendChild(p)}let s=i.getColor(t.color);l(s)&&(r.appendChild(_n(n,"color",s)),r.appendChild(_n(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(_n(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,Q.divideByScalar(u,c,u);let p=i.get(t.width,N7),A=i.get(t.height,N7),m=i.get(t.horizontalOrigin,Ni.CENTER);m===Ni.CENTER?u.x-=p*.5:m===Ni.RIGHT&&(u.x-=p);let _=i.get(t.verticalOrigin,Yn.CENTER);_===Yn.TOP?u.y+=A:_===Yn.CENTER&&(u.y+=A*.5);let y=n.createElement("hotSpot");y.setAttribute("x",-u.x),y.setAttribute("y",u.y),y.setAttribute("xunits","pixels"),y.setAttribute("yunits","pixels"),r.appendChild(y)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return l(f)&&d.equals(d.UNIT_Z,h)&&(f=D.toDegrees(-f),f===0&&(f=360),r.appendChild(_n(n,"heading",f))),r}function Fdt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=e.valueGetter;if(!l(t))return;let s=o.createElement("LineString"),c=o.createElement("altitudeMode"),u=a.get(t.clampToGround,!1),f;u?(s.appendChild(_n(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),c.appendChild(f),s.appendChild(c);let h=t.positions,p=a.get(h),A=_n(o,"coordinates",w0(p,r));s.appendChild(A);let m=a.get(t.zIndex);u&&l(m)&&s.appendChild(_n(o,"drawOrder",m,Yh)),n.push(s);let _=o.createElement("LineStyle"),y=a.get(t.width);l(y)&&_.appendChild(_n(o,"width",y)),F7(e,t.material,_),i.push(_)}function Qdt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let a=t.coordinates,s=o.get(a),c=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let A=0;A<4;++A)u[A](s,Ol),c.push(`${D.toDegrees(Ol.longitude)},${D.toDegrees(Ol.latitude)},${r}`);let f=_n(i,"coordinates",c.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function KCe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,a=[],s=t.length;for(let f=0;f<s;++f)me.fromCartesian(t[f],r,Ol),a.push(`${D.toDegrees(Ol.longitude)},${D.toDegrees(Ol.latitude)},${i?Ol.height:n}`);let c=_n(o,"coordinates",a.join(" ")),u=o.createElement("LinearRing");return u.appendChild(c),u}function kdt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),a=o.get(t.perPositionHeight,!1);!a&&n>0&&(r=n);let s=[],c=t.hierarchy,u=o.get(c),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(KCe(e,f,r,a)),s.push(h);let p=u.holes;if(l(p)){let A=p.length;for(let m=0;m<A;++m){let _=i.createElement("innerBoundaryIs");_.appendChild(KCe(e,p[m].positions,r,a)),s.push(_)}}return s}function XCe(e,t,n,i,o){let r=e.kmlDoc,a=e.valueGetter;if(!l(t))return;let s=t instanceof Rm;if(s&&a.getMaterialType(t.material)==="Image"){Udt(e,t,o);return}let c=r.createElement("Polygon"),u=a.get(t.extrudedHeight,0);u>0&&c.appendChild(_n(r,"extrude",!0));let f=s?Qdt(e,t,u):kdt(e,t,u),h=f.length;for(let y=0;y<h;++y)c.appendChild(f[y]);let p=r.createElement("altitudeMode");p.appendChild(D0(e,t.heightReference)),c.appendChild(p),n.push(c);let A=r.createElement("PolyStyle"),m=a.get(t.fill,!1);m&&A.appendChild(_n(r,"fill",m)),F7(e,t.material,A);let _=a.get(t.outline,!1);if(_){A.appendChild(_n(r,"outline",_));let y=r.createElement("LineStyle"),C=a.get(t.outlineWidth,1);y.appendChild(_n(r,"width",C));let E=a.getColor(t.outlineColor,U.BLACK);y.appendChild(_n(r,"color",E)),y.appendChild(_n(r,"colorMode","normal")),i.push(y)}i.push(A)}function Udt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,a=i.createElement("GroundOverlay"),s=i.createElement("altitudeMode");s.appendChild(D0(e,t.heightReference)),a.appendChild(s);let c=o.get(t.height);l(c)&&a.appendChild(_n(i,"altitude",c));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(_n(i,"north",D.toDegrees(u.north))),f.appendChild(_n(i,"south",D.toDegrees(u.south))),f.appendChild(_n(i,"east",D.toDegrees(u.east))),f.appendChild(_n(i,"west",D.toDegrees(u.west))),a.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),A=i.createElement("Icon");A.appendChild(_n(i,"href",p)),a.appendChild(A);let m=h.color;l(m)&&a.appendChild(_n(i,"color",B0(h.color))),n.push(a)}function iEe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),a=i.get(t.scale);if(l(a)){let u=n.createElement("scale");u.appendChild(_n(n,"x",a)),u.appendChild(_n(n,"y",a)),u.appendChild(_n(n,"z",a)),r.appendChild(u)}let s=n.createElement("Link"),c=o.model(t,e.time);return s.appendChild(_n(n,"href",c)),r.appendChild(s),r}function zdt(e,t,n,i,o){let r=e.kmlDoc,a=e.ellipsoid,s=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){eEe(e,t,n,i,o);return}let u=iEe(e,n),f=r.createElement("altitudeMode");f.appendChild(D0(e,n.heightReference)),u.appendChild(f),s.get(c,void 0,bu),me.fromCartesian(bu,a,Ol);let h=r.createElement("Location");h.appendChild(_n(r,"longitude",D.toDegrees(Ol.longitude))),h.appendChild(_n(r,"latitude",D.toDegrees(Ol.latitude))),h.appendChild(_n(r,"altitude",Ol.height)),u.appendChild(h),i.push(u)}function F7(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let a,s=o.getMaterialType(t),c,u;switch(s){case"Image":a=B0(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":a=B0(r.color);break;case"PolylineOutline":a=B0(r.color),c=B0(r.outlineColor),u=r.outlineWidth,n.appendChild(_n(i,"outerColor",c,Yh)),n.appendChild(_n(i,"outerWidth",u,Yh));break;case"Stripe":a=B0(r.oddColor);break}l(a)&&(n.appendChild(_n(i,"color",a)),n.appendChild(_n(i,"colorMode","normal")))}function D0(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,ot.NONE),r;switch(o){case ot.NONE:r=n.createTextNode("absolute");break;case ot.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case ot.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function w0(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)me.fromCartesian(e[o],t,Ol),i.push(`${D.toDegrees(Ol.longitude)},${D.toDegrees(Ol.latitude)},${Ol.height}`);return i.join(" ")}function _n(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function B0(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 oEe=O7;function IP(){this._cache={}}IP.prototype.fromColor=function(e,t){return GG(void 0,void 0,e,t,this._cache)};IP.prototype.fromUrl=function(e,t,n){return GG(e,void 0,t,n,this._cache)};IP.prototype.fromMakiIconId=function(e,t,n){return GG(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};IP.prototype.fromText=function(e,t,n){return GG(void 0,e,t,n,this._cache)};var Gdt=new U;function Vdt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Gdt).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 rEe(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 a=Math.round((n-o)/2),s=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,a-1,s,o,r),e.drawImage(t,a,s-1,o,r),e.drawImage(t,a+1,s,o,r),e.drawImage(t,a,s+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.BLACK.toCssColorString(),e.fillRect(a-1,s-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,a,s,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.WHITE.toCssColorString(),e.fillRect(a-1,s-2,o+2,r+2)}var EP=new Array(4);function GG(e,t,n,i,o){EP[0]=e,EP[1]=t,EP[2]=n,EP[3]=i;let r=JSON.stringify(EP),a=o[r];if(l(a))return a;let s=document.createElement("canvas");s.width=i,s.height=i;let c=s.getContext("2d");if(Vdt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(h){return rEe(c,h,i),o[r]=s,s});return o[r]=f,f}else if(l(t)){let u=Tx(t,{font:`bold ${i}px sans-serif`});rEe(c,u,i)}return o[r]=s,s}var Gy=IP;function Q7(e){return e}function VG(e){if(e==null)return Q7;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],a=e.translate[1];return function(s,c){c||(t=n=0);var u=2,f=s.length,h=new Array(f);for(h[0]=(t+=s[0])*i+r,h[1]=(n+=s[1])*o+a;u<f;)h[u]=s[u],++u;return h}}function aEe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function k7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return sEe(e,n)})}:sEe(e,t)}function sEe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=U7(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 U7(e,t){var n=VG(e.transform),i=e.arcs;function o(f,h){h.length&&h.pop();for(var p=i[f<0?~f:f],A=0,m=p.length;A<m;++A)h.push(n(p[A],A));f<0&&aEe(h,m)}function r(f){return n(f)}function a(f){for(var h=[],p=0,A=f.length;p<A;++p)o(f[p],h);return h.length<2&&h.push(h[0]),h}function s(f){for(var h=a(f);h.length<4;)h.push(h[0]);return h}function c(f){return f.map(s)}function u(f){var h=f.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=a(f.arcs);break;case"MultiLineString":p=f.arcs.map(a);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:h,coordinates:p}}return u(t)}function HG(e){return d.fromDegrees(e[0],e[1],e[2])}var z7={"urn:ogc:def:crs:OGC:1.3:CRS84":HG,"EPSG:4326":HG,"urn:ogc:def:crs:EPSG::4326":HG},cEe={},lEe={},G7=48,V7,H7=U.ROYALBLUE,W7=U.YELLOW,j7=2,Y7=U.fromBytes(255,255,0,100),q7=!1,qdt={small:24,medium:48,large:64},Kdt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function uEe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Kdt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${uEe(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 Xdt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function Jdt(e,t){return new Mm(Xdt(uEe,e,t),!0)}function WG(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Jn();else{let a=2,s=i;for(;l(t.getById(s));)s=`${i}_${a}`,a++;i=s}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let a,s=r.title;if(l(s))o.name=s,a="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,a=f;break}else u>2&&h==="name"?(u=2,a=f):u>3&&/title/i.test(f)?(u=3,a=f):u>4&&/name/i.test(f)&&(u=4,a=f)}l(a)&&(o.name=r[a])}let c=r.description;c!==null&&(o.description=l(c)?new hi(c):n(r,a))}return o}function K7(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var fEe={Feature:hEe,FeatureCollection:Zdt,GeometryCollection:mEe,LineString:yEe,MultiLineString:CEe,MultiPoint:gEe,MultiPolygon:bEe,Point:AEe,Polygon:IEe,Topology:xEe},dEe={GeometryCollection:mEe,LineString:yEe,MultiLineString:CEe,MultiPoint:gEe,MultiPolygon:bEe,Point:AEe,Polygon:IEe,Topology:xEe};function hEe(e,t,n,i,o){if(t.geometry===null){WG(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ue("feature.geometry is required.");let r=t.geometry.type,a=dEe[r];if(!l(a))throw new ue(`Unknown geometry type: ${r}`);a(e,t,t.geometry,i,o)}function Zdt(e,t,n,i,o){let r=t.features;for(let a=0,s=r.length;a<s;a++)hEe(e,r[a],void 0,i,o)}function mEe(e,t,n,i,o){let r=n.geometries;for(let a=0,s=r.length;a<s;a++){let c=r[a],u=c.type,f=dEe[u];if(!l(f))throw new ue(`Unknown geometry type: ${u}`);f(e,t,c,i,o)}}function pEe(e,t,n,i,o){let r=o.markerSymbol,a=o.markerColor,s=o.markerSize,c=t.properties;if(l(c)){let A=c["marker-color"];l(A)&&(a=U.fromCssColorString(A)),s=qdt[c["marker-size"]]??s;let m=c["marker-symbol"];l(m)&&(r=m)}let u;l(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),a,s):u=e._pinBuilder.fromMakiIconId(r,a,s):u=e._pinBuilder.fromColor(a,s);let f=new dl;f.verticalOrigin=new hi(Yn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=ot.CLAMP_TO_GROUND);let h=WG(t,e._entityCollection,o.describe);h.billboard=f,h.position=new eu(n(i));let p=Promise.resolve(u).then(function(A){f.image=new hi(A)}).catch(function(){f.image=new hi(e._pinBuilder.fromColor(a,s))});e._promises.push(p)}function AEe(e,t,n,i,o){pEe(e,t,i,n.coordinates,o)}function gEe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)pEe(e,t,i,r[a],o)}function _Ee(e,t,n,i,o){let r=o.strokeMaterialProperty,a=o.strokeWidthProperty,s=t.properties;if(l(s)){let f=s["stroke-width"];l(f)&&(a=new hi(f));let h,p=s.stroke;l(p)&&(h=U.fromCssColorString(p));let A=s["stroke-opacity"];l(A)&&A!==1&&(l(h)||(h=r.color.getValue().clone()),h.alpha=A),l(h)&&(r=new Kt(h))}let c=WG(t,e._entityCollection,o.describe),u=new pl;c.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=a,u.positions=new hi(K7(i,n)),u.arcType=un.RHUMB}function yEe(e,t,n,i,o){_Ee(e,t,i,n.coordinates,o)}function CEe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)_Ee(e,t,i,r[a],o)}function EEe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,a=o.fillMaterialProperty,s=o.strokeWidthProperty,c=t.properties;if(l(c)){let A=c["stroke-width"];l(A)&&(s=new hi(A));let m,_=c.stroke;l(_)&&(m=U.fromCssColorString(_));let y=c["stroke-opacity"];l(y)&&y!==1&&(l(m)||(m=r.getValue().clone()),m.alpha=y),l(m)&&(r=new hi(m));let C,E=c.fill,I=a.color.getValue();l(E)&&(C=U.fromCssColorString(E),C.alpha=I.alpha),y=c["fill-opacity"],l(y)&&y!==I.alpha&&(l(C)||(C=I.clone()),C.alpha=y),l(C)&&(a=new Kt(C))}let u=new Pm;u.outline=new hi(!0),u.outlineColor=r,u.outlineWidth=s,u.material=a,u.arcType=un.RHUMB;let f=[];for(let A=1,m=i.length;A<m;A++)f.push(new Fc(K7(i[A],n)));let h=i[0];u.hierarchy=new hi(new Fc(K7(h,n),f)),h[0].length>2?u.perPositionHeight=new hi(!0):o.clampToGround||(u.height=0);let p=WG(t,e._entityCollection,o.describe);p.polygon=u}function IEe(e,t,n,i,o){EEe(e,t,i,n.coordinates,o)}function bEe(e,t,n,i,o){let r=n.coordinates;for(let a=0;a<r.length;a++)EEe(e,t,i,r[a],o)}function xEe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let a=k7(n,n.objects[r]),s=fEe[a.type];s(e,a,a,i,o)}}function Vy(e){this._name=e,this._changed=new _e,this._error=new _e,this._isLoading=!1,this._loading=new _e,this._entityCollection=new $s(this),this._promises=[],this._pinBuilder=new Gy,this._entityCluster=new xd,this._credit=void 0,this._resourceCredits=[]}Vy.load=function(e,t){return new Vy().load(e,t)};Object.defineProperties(Vy,{markerSize:{get:function(){return G7},set:function(e){G7=e}},markerSymbol:{get:function(){return V7},set:function(e){V7=e}},markerColor:{get:function(){return H7},set:function(e){H7=e}},stroke:{get:function(){return W7},set:function(e){W7=e}},strokeWidth:{get:function(){return j7},set:function(e){j7=e}},fill:{get:function(){return Y7},set:function(e){Y7=e}},clampToGround:{get:function(){return q7},set:function(e){q7=e}},crsNames:{get:function(){return z7}},crsLinkHrefs:{get:function(){return cEe}},crsLinkTypes:{get:function(){return lEe}}});Object.defineProperties(Vy.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Vy.prototype.load=function(e,t){return TEe(this,e,t,!0)};Vy.prototype.process=function(e,t){return TEe(this,e,t,!1)};function TEe(e,t,n,i){Da.setLoading(e,!0),n=n??V.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Et(o)),e._credit=o;let r=t,a=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),a=a??t.getUrlComponent();let s=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)s.push(c[f])}}return n={describe:n.describe??Jdt,markerSize:n.markerSize??G7,markerSymbol:n.markerSymbol??V7,markerColor:n.markerColor??H7,strokeWidthProperty:new hi(n.strokeWidth??j7),strokeMaterialProperty:new Kt(n.stroke??W7),fillMaterialProperty:new Kt(n.fill??Y7),clampToGround:n.clampToGround??q7},Promise.resolve(r).then(function(s){return $dt(e,s,n,a,i)}).catch(function(s){throw Da.setLoading(e,!1),e._error.raiseEvent(e,s),s})}Vy.prototype.update=function(e){return!0};function $dt(e,t,n,i,o){let r;l(i)&&(r=Cy(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let a=fEe[t.type];if(!l(a))throw new ue(`Unsupported GeoJSON object type: ${t.type}`);let s=t.crs,c=s!==null?HG:null;if(l(s)){if(!l(s.properties))throw new ue("crs.properties is undefined.");let u=s.properties;if(s.type==="name"){if(c=z7[u.name],!l(c))throw new ue(`Unknown crs name: ${u.name}`)}else if(s.type==="link"){let f=cEe[u.href];if(l(f)||(f=lEe[u.type]),!l(f))throw new ue(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(s.type==="EPSG"){if(c=z7[`EPSG:${u.code}`],!l(c))throw new ue(`Unknown crs EPSG code: ${u.code}`)}else throw new ue(`Unknown crs type: ${s.type}`)}return Promise.resolve(c).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&a(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Da.setLoading(e,!1),e})})}var v0=Vy;function eht(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var zn=eht;var SEe="4.0.0";function tht(e){return e===void 0}function hf(e){return typeof e=="boolean"}function wEe(e,t){for(var n in t)t.hasOwnProperty(n)&&tht(e[n])&&(e[n]=t[n]);return e}function BEe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function dr(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function Hy(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Wy(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var jy=/[A-Za-z]/,Rs=/[\d]/;var mf=/\s/,jG=/['"]/,DEe=/[\x00-\x1F\x7F]/,vEe=/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,nht=/\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,iht=/\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,oht=vEe+nht+iht,PEe=/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,JEi=new RegExp("[".concat(vEe+PEe,"]")),X7=oht+PEe,qh=new RegExp("[".concat(X7,"]"));var YG=(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(mf):[],o=t.split(mf),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(mf):[],o=t.split(mf),r;i.length&&(r=o.shift());){var a=i.indexOf(r);a!==-1&&i.splice(a,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})();function REe(e,t,n){var i,o;n==null?(n="…",o=3,i=8):(o=n.length,i=n.length);var r=function(E){var I={},x=E,S=x.match(/^([a-z]+):\/\//i);return S&&(I.scheme=S[1],x=x.substr(S[0].length)),S=x.match(/^(.*?)(?=(\?|#|\/|$))/i),S&&(I.host=S[1],x=x.substr(S[0].length)),S=x.match(/^\/(.*?)(?=(\?|#|$))/i),S&&(I.path=S[1],x=x.substr(S[0].length)),S=x.match(/^\?(.*?)(?=(#|$))/i),S&&(I.query=S[1],x=x.substr(S[0].length)),S=x.match(/^#(.*?)$/i),S&&(I.fragment=S[1]),I},a=function(E){var I="";return E.scheme&&E.host&&(I+=E.scheme+"://"),E.host&&(I+=E.host),E.path&&(I+="/"+E.path),E.query&&(I+="?"+E.query),E.fragment&&(I+="#"+E.fragment),I},s=function(E,I){var x=I/2,S=Math.ceil(x),w=-1*Math.floor(x),v="";return w<0&&(v=E.substr(w)),E.substr(0,S)+n+v};if(e.length<=t)return e;var c=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=a(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=a(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=c)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,c+i):s(h,c).substr(0,c+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=c){if((h+p).length==t)return(h+p).substr(0,t);var A=c-h.length;return(h+s(p,A)).substr(0,c+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=c){if((h+m).length==t)return(h+m).substr(0,t);var _=c-h.length;return(h+s(m,_)).substr(0,c+i)}else h+=m}if(u.scheme&&u.host){var y=u.scheme+"://";if((h+y).length<c)return(y+h).substr(0,t)}if(h.length<=t)return h;var C="";return c>0&&(C=h.substr(-1*Math.floor(c/2))),(h.substr(0,Math.ceil(c/2))+n+C).substr(0,c+i)}function MEe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,a="";return r>0&&(a=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+a).substr(0,r+i)}function NEe(e,t,n){return BEe(e,t,n)}var LEe=(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 YG({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,a=o.length;r<a;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"?REe(t,i):o==="middle"?MEe(t,i):NEe(t,i)},e})();var J7=function(e,t){return J7=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])},J7(e,t)};function Dp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");J7(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ms=function(){return Ms=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},Ms.apply(this,arguments)};var vp=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();var rht="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|northwesternmutual|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--mgbaakc7dvf|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|bananarepublic|cancerresearch|cookingchannel|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--jlq61u9w7b|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|travelchannel|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|foodnetwork|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|volkswagen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|alfaromeo|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|frontdoor|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|passagens|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|cityeats|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|etisalat|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|guardian|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|maserati|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|showtime|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|avianca|banamex|bauhaus|bentley|bestbuy|booking|brother|bugatti|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|comcast|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hoteles|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|oldnavy|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|tiffany|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|xfinity|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u062A\u0635\u0627\u0644\u0627\u062A|\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|abarth|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|kinder|kindle|kosher|lancia|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|mutual|nagoya|natura|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rocher|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|vuelos|walter|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|dabur|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|linde|lipsy|loans|locus|lotte|lotto|macys|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|adac|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|fiat|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|hgtv|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|loft|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shaw|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\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|cbs|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|sca|scb|ses|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|\u8BFA\u57FA\u4E9A|\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)",OEe=new RegExp("^"+rht+"$");var aht=/[\/?#]/,sht=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,FEe=/[?!:,.;^]/,Z7=/https?:\/\//i,QEe=new RegExp("^"+Z7.source,"i"),kEe=new RegExp(FEe.source+"$"),cht=/^(javascript|vbscript):/i,lht=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,uht=/^(?:\/\/)?([^/#?:]+)/;function qG(e){return jy.test(e)}function $7(e){return jy.test(e)||Rs.test(e)||e==="+"||e==="-"||e==="."}function fg(e){return qh.test(e)}function KG(e){return e==="_"||fg(e)}function eZ(e){return qh.test(e)||sht.test(e)||FEe.test(e)}function XG(e){return aht.test(e)}function tZ(e){return OEe.test(e.toLowerCase())}function UEe(e){if(cht.test(e))return!1;var t=e.match(lht);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!jy.test(i))}function zEe(e){var t=e.match(uht);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!tZ(o)}var fht=/^(?:(?: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]?)$/,dht=/[:/?#]/;function GEe(e){var t=e.split(dht,1)[0];return fht.test(t)}var hht=/^(https?:\/\/)?(www\.)?/i,mht=/^\/\//,VEe=(function(e){Dp(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(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=ght(n)),this.stripPrefix.scheme&&(n=pht(n)),this.stripPrefix.www&&(n=Aht(n)),this.stripTrailingSlash&&(n=_ht(n)),this.decodePercentEncoding&&(n=yht(n)),n},t})(vp);function pht(e){return e.replace(QEe,"")}function Aht(e){return e.replace(hht,"$1")}function ght(e){return e.replace(mht,"")}function _ht(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function yht(e){var t=e.replace(/%22/gi,""").replace(/%26/gi,"&").replace(/%27/gi,"'").replace(/%3C/gi,"<").replace(/%3E/gi,">");try{return decodeURIComponent(t)}catch{return t}}var HEe=/^mailto:/i,Cht=new RegExp("[".concat(X7,"!#$%&'*+/=?^_`{|}~-]"));function WEe(e){return qh.test(e)}function JG(e){return Cht.test(e)}function jEe(e){var t=e.split(".").pop()||"";return tZ(t)}var YEe=(function(e){Dp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(vp);function nZ(e){return e==="_"||qh.test(e)}function qEe(e){return e.length<=140}var KEe=["twitter","facebook","instagram","tiktok"];var XEe=(function(e){Dp(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;default:throw Wy(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})(vp);var Eht={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/},Iht=/[-\w.]/;function iZ(e){return Iht.test(e)}function JEe(e,t){var n=Eht[t];return n.test(e)}var ZEe=["twitter","instagram","soundcloud","tiktok"];var $Ee=(function(e){Dp(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;default:throw new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(vp);var bht=/[-. ]/,xht=/[-. ()]/,Tht=/[,;]/,Sht=/(?:(?:(?:(\+)?\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]+#?)*/,wht=/(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})/,Bht=new RegExp("^".concat(Sht.source,"|").concat(wht.source,"$"));function oZ(e){return bht.test(e)}function ZG(e){return Tht.test(e)}function e0e(e){var t=e.charAt(0)==="+"||xht.test(e);return t&&Bht.test(e)}var t0e=(function(e){Dp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(vp);function o0e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,a=t.hashtagServiceName,s=t.mentionServiceName,c=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)y(p);else for(var A=f.length-1;A>=0;A--){var m=f[A];switch(m.state){case 11:w(m,p);break;case 12:v(m,p);break;case 0:C(m,p);break;case 1:E(m,p);break;case 2:I(m,p);break;case 3:x(m,p);break;case 4:S(m,p);break;case 5:R(m,p);break;case 6:N(m,p);break;case 7:L(m,p);break;case 13:g(m,p);break;case 14:b(m,p);break;case 8:T(m,p);break;case 9:B(m,p);break;case 10:M(m,p);break;case 15:O(m,p);break;case 16:G(m,p);break;case 17:k(m,p);break;case 18:z(m,p);break;case 19:F(m,p);break;case 20:H(m,p);break;case 21:Y(m,p);break;case 22:$(m,p);break;case 23:W(m,p);break;case 24:K(m,p);break;case 25:Z(m,p);break;case 26:pe(m,p);break;case 27:ge(m,p);break;case 28:re(m,p);break;case 29:ye(m,p);break;case 30:Ce(m,p);break;case 31:ve(m,p);break;case 32:Le(m,p);break;case 33:Oe(m,p);break;case 34:nt(m,p);break;case 35:Fe(m,p);break;case 36:_t(m,p);break;case 37:Ne(m,p);break;case 38:rt(m,p);break;case 39:je(m,p);break;case 40:st(m,p);break;case 41:ft(m,p);break;default:Wy(m.state)}}}for(var _=f.length-1;_>=0;_--)f.forEach(function(be){return St(be)});return c;function y(be){if(be==="#")f.push(Mht(h,28));else if(be==="@")f.push(Nht(h,30));else if(be==="/")f.push(aZ(h,11));else if(be==="+")f.push(sZ(h,37));else if(be==="(")f.push(sZ(h,32));else{if(Rs.test(be)&&(f.push(sZ(h,38)),f.push(Pht(h,13))),WEe(be)){var Se=be.toLowerCase()==="m"?15:22;f.push(Rht(h,Se))}qG(be)&&f.push(rZ(h,0)),qh.test(be)&&f.push(aZ(h,5))}}function C(be,Se){Se===":"?be.state=2:Se==="-"?be.state=1:$7(Se)||dr(f,be)}function E(be,Se){Se==="-"||(Se==="/"?(dr(f,be),f.push(aZ(h,11))):$7(Se)?be.state=0:dr(f,be))}function I(be,Se){Se==="/"?be.state=3:Se==="."?dr(f,be):fg(Se)?(be.state=5,qG(Se)&&f.push(rZ(h,0))):dr(f,be)}function x(be,Se){Se==="/"?be.state=4:eZ(Se)?(be.state=10,be.acceptStateReached=!0):St(be)}function S(be,Se){Se==="/"?be.state=10:fg(Se)?(be.state=5,be.acceptStateReached=!0):dr(f,be)}function w(be,Se){Se==="/"?be.state=12:dr(f,be)}function v(be,Se){fg(Se)?be.state=5:dr(f,be)}function R(be,Se){Se==="."?be.state=7:Se==="-"?be.state=6:Se===":"?be.state=8:XG(Se)?be.state=10:KG(Se)||St(be)}function N(be,Se){Se==="-"||(Se==="."?St(be):fg(Se)?be.state=5:St(be))}function L(be,Se){Se==="."?St(be):fg(Se)?(be.state=5,be.acceptStateReached=!0):St(be)}function g(be,Se){Se==="."?be.state=14:Se===":"?be.state=8:Rs.test(Se)||(XG(Se)?be.state=10:qh.test(Se)?dr(f,be):St(be))}function b(be,Se){Rs.test(Se)?(be.octetsEncountered++,be.octetsEncountered===4&&(be.acceptStateReached=!0),be.state=13):St(be)}function T(be,Se){Rs.test(Se)?be.state=9:St(be)}function B(be,Se){Rs.test(Se)||(XG(Se)?be.state=10:St(be))}function M(be,Se){eZ(Se)||St(be)}function O(be,Se){Se.toLowerCase()==="a"?be.state=16:$(be,Se)}function G(be,Se){Se.toLowerCase()==="i"?be.state=17:$(be,Se)}function k(be,Se){Se.toLowerCase()==="l"?be.state=18:$(be,Se)}function z(be,Se){Se.toLowerCase()==="t"?be.state=19:$(be,Se)}function F(be,Se){Se.toLowerCase()==="o"?be.state=20:$(be,Se)}function H(be,Se){Se.toLowerCase()===":"?be.state=21:$(be,Se)}function Y(be,Se){JG(Se)?be.state=22:dr(f,be)}function $(be,Se){Se==="."?be.state=23:Se==="@"?be.state=24:JG(Se)?be.state=22:dr(f,be)}function W(be,Se){Se==="."?dr(f,be):Se==="@"?dr(f,be):JG(Se)?be.state=22:dr(f,be)}function K(be,Se){fg(Se)?be.state=25:dr(f,be)}function Z(be,Se){Se==="."?be.state=27:Se==="-"?be.state=26:KG(Se)||St(be)}function pe(be,Se){Se==="-"||Se==="."?St(be):KG(Se)?be.state=25:St(be)}function ge(be,Se){Se==="."||Se==="-"?St(be):fg(Se)?(be.state=25,be.acceptStateReached=!0):St(be)}function re(be,Se){nZ(Se)?(be.state=29,be.acceptStateReached=!0):dr(f,be)}function ye(be,Se){nZ(Se)||St(be)}function Ce(be,Se){iZ(Se)?(be.state=31,be.acceptStateReached=!0):dr(f,be)}function ve(be,Se){iZ(Se)||(qh.test(Se)?dr(f,be):St(be))}function Ne(be,Se){Rs.test(Se)?be.state=38:(dr(f,be),y(Se))}function Le(be,Se){Rs.test(Se)?be.state=33:dr(f,be),y(Se)}function Oe(be,Se){Rs.test(Se)?be.state=34:dr(f,be)}function nt(be,Se){Rs.test(Se)?be.state=35:dr(f,be)}function Fe(be,Se){Se===")"?be.state=36:dr(f,be)}function _t(be,Se){Rs.test(Se)?be.state=38:oZ(Se)?be.state=39:dr(f,be)}function rt(be,Se){be.acceptStateReached=!0,ZG(Se)?be.state=40:Se==="#"?be.state=41:Rs.test(Se)||(Se==="("?be.state=32:oZ(Se)?be.state=39:(St(be),qG(Se)&&f.push(rZ(h,0))))}function je(be,Se){Rs.test(Se)?be.state=38:Se==="("?be.state=32:(St(be),y(Se))}function st(be,Se){ZG(Se)||(Se==="#"?be.state=41:Rs.test(Se)?be.state=38:St(be))}function ft(be,Se){ZG(Se)?be.state=40:Rs.test(Se)?dr(f,be):St(be)}function St(be){if(dr(f,be),!!be.acceptStateReached){var Se=be.startIdx,qt=e.slice(be.startIdx,h);if(qt=vht(qt),be.type==="url"){var mt=e.charAt(be.startIdx-1);if(mt==="@")return;var Ut=be.matchType;if(Ut==="scheme"){var Gn=Z7.exec(qt);if(Gn&&(Se=Se+Gn.index,qt=qt.slice(Gn.index)),!UEe(qt))return}else if(Ut==="tld"){if(!zEe(qt))return}else if(Ut==="ipV4"){if(!GEe(qt))return}else Wy(Ut);c.push(new VEe({tagBuilder:n,matchedText:qt,offset:Se,urlMatchType:Ut,url:qt,protocolRelativeMatch:qt.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(be.type==="email")jEe(qt)&&c.push(new YEe({tagBuilder:n,matchedText:qt,offset:Se,email:qt.replace(HEe,"")}));else if(be.type==="hashtag")qEe(qt)&&c.push(new XEe({tagBuilder:n,matchedText:qt,offset:Se,serviceName:a,hashtag:qt.slice(1)}));else if(be.type==="mention")JEe(qt,s)&&c.push(new $Ee({tagBuilder:n,matchedText:qt,offset:Se,serviceName:s,mention:qt.slice(1)}));else if(be.type==="phone"){if(qt=qt.replace(/ +$/g,""),e0e(qt)){var Xe=qt.replace(/[^0-9,;#]/g,"");c.push(new t0e({tagBuilder:n,matchedText:qt,offset:Se,number:Xe,plusSign:qt.charAt(0)==="+"}))}}else Wy(be)}}}var Dht=/[\(\{\[]/,n0e=/[\)\}\]]/,i0e={")":"(","}":"{","]":"["};function vht(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);Dht.test(i)?t[i]++:n0e.test(i)&&t[i0e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),n0e.test(r)){var a=i0e[r];if(t[a]<0)t[a]++,o--;else break}else if(kEe.test(r))o--;else break;return e.slice(0,o+1)}function rZ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function aZ(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Pht(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Rht(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Mht(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Nht(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function sZ(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function r0e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,a=t.onDoctype,s=new Pp,c=0,u=e.length,f=0,h=0,p=s;c<u;){var A=e.charAt(c);switch(f){case 0:m(A);break;case 1:_(A);break;case 2:C(A);break;case 3:y(A);break;case 4:E(A);break;case 5:I(A);break;case 6:x(A);break;case 7:S(A);break;case 8:w(A);break;case 9:v(A);break;case 10:R(A);break;case 11:N(A);break;case 12:L(A);break;case 13:g(A);break;case 14:b(A);break;case 15:T(A);break;case 16:B(A);break;case 17:M(A);break;case 18:O(A);break;case 19:G(A);break;case 20:k(A);break;default:Wy(f)}c++}h<c&&Y();function m(K){K==="<"&&F()}function _(K){K==="!"?f=13:K==="/"?(f=2,p=new Pp(Ms(Ms({},p),{isClosing:!0}))):K==="<"?F():jy.test(K)?(f=3,p=new Pp(Ms(Ms({},p),{isOpening:!0}))):(f=0,p=s)}function y(K){mf.test(K)?(p=new Pp(Ms(Ms({},p),{name:$()})),f=4):K==="<"?F():K==="/"?(p=new Pp(Ms(Ms({},p),{name:$()})),f=12):K===">"?(p=new Pp(Ms(Ms({},p),{name:$()})),H()):!jy.test(K)&&!Rs.test(K)&&K!==":"&&z()}function C(K){K===">"?z():jy.test(K)?f=3:z()}function E(K){mf.test(K)||(K==="/"?f=12:K===">"?H():K==="<"?F():K==="="||jG.test(K)||DEe.test(K)?z():f=5)}function I(K){mf.test(K)?f=6:K==="/"?f=12:K==="="?f=7:K===">"?H():K==="<"?F():jG.test(K)&&z()}function x(K){mf.test(K)||(K==="/"?f=12:K==="="?f=7:K===">"?H():K==="<"?F():jG.test(K)?z():f=5)}function S(K){mf.test(K)||(K==='"'?f=8:K==="'"?f=9:/[>=`]/.test(K)?z():K==="<"?F():f=10)}function w(K){K==='"'&&(f=11)}function v(K){K==="'"&&(f=11)}function R(K){mf.test(K)?f=4:K===">"?H():K==="<"&&F()}function N(K){mf.test(K)?f=4:K==="/"?f=12:K===">"?H():K==="<"?F():(f=4,W())}function L(K){K===">"?(p=new Pp(Ms(Ms({},p),{isClosing:!0})),H()):f=4}function g(K){e.substr(c,2)==="--"?(c+=2,p=new Pp(Ms(Ms({},p),{type:"comment"})),f=14):e.substr(c,7).toUpperCase()==="DOCTYPE"?(c+=7,p=new Pp(Ms(Ms({},p),{type:"doctype"})),f=20):z()}function b(K){K==="-"?f=15:K===">"?z():f=16}function T(K){K==="-"?f=18:K===">"?z():f=16}function B(K){K==="-"&&(f=17)}function M(K){K==="-"?f=18:f=16}function O(K){K===">"?H():K==="!"?f=19:K==="-"||(f=16)}function G(K){K==="-"?f=17:K===">"?H():f=16}function k(K){K===">"?H():K==="<"&&F()}function z(){f=0,p=s}function F(){f=1,p=new Pp({idx:c})}function H(){var K=e.slice(h,p.idx);K&&o(K,h),p.type==="comment"?r(p.idx):p.type==="doctype"?a(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),z(),h=c+1}function Y(){var K=e.slice(h,c);o(K,h),h=c+1}function $(){var K=p.idx+(p.isClosing?2:1);return e.slice(K,c).toLowerCase()}function W(){c--}}var Pp=(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 Lht=(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=Oht(t.urls),this.email=hf(t.email)?t.email:this.email,this.phone=hf(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=hf(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Fht(t.stripPrefix),this.stripTrailingSlash=hf(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=hf(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&ZEe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&KEe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Qht(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 r0e(t,{onOpenTag:function(a){i.indexOf(a)>=0&&o++},onText:function(a,s){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,u=a.split(c),f=s;u.forEach(function(h,p){if(p%2===0){var A=n.parseText(h,f);r.push.apply(r,A)}f+=h.length})}},onCloseTag:function(a){i.indexOf(a)>=0&&(o=Math.max(o-1,0))},onComment:function(a){},onDoctype:function(a){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(c,u){return c.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,a=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}if(t[n+1].getOffset()<a){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||Hy(t,function(n){return n.getType()==="hashtag"}),this.email||Hy(t,function(n){return n.getType()==="email"}),this.phone||Hy(t,function(n){return n.getType()==="phone"}),this.mention||Hy(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||Hy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||Hy(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||Hy(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=o0e(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,"<").replace(/>/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,a=n.length;r<a;r++){var s=n[r];i.push(t.substring(o,s.getOffset())),i.push(this.createMatchReturnVal(s)),o=s.getOffset()+s.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 YG)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new LEe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=SEe,e})(),a0e=Lht;function Oht(e){return e==null&&(e=!0),hf(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:hf(e.schemeMatches)?e.schemeMatches:!0,tldMatches:hf(e.tldMatches)?e.tldMatches:!0,ipV4Matches:hf(e.ipV4Matches)?e.ipV4Matches:!0}}function Fht(e){return e==null&&(e=!0),hf(e)?{scheme:e,www:e}:{scheme:hf(e.scheme)?e.scheme:!0,www:hf(e.www)?e.www:!0}}function Qht(e){return typeof e=="number"?{length:e,location:"end"}:wEe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var $G=a0e;var p0e;typeof DOMParser<"u"&&(p0e=new DOMParser);var kht=new $G({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),eV=32,s0e=2414016,c0e=1,l0e=16093e3,u0e=.1,Uht=[null,void 0,"http://www.topografix.com/GPX/1/1"],qo={gpx:Uht};function zht(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 cZ(e,t){let n=TP(e,"id");return n=l(n)?n:Jn(),t.getOrCreateEntity(n)}function lZ(e){let t=f0e(e,"lon"),n=f0e(e,"lat"),i=bP(e,"ele",qo.gpx);return d.fromDegrees(t,n,i)}function f0e(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function TP(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Yy(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let a=i[r];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function uZ(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function bP(e,t,n){let i=Yy(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function xu(e,t,n){let i=Yy(e,t,n);if(l(i))return i.textContent.trim()}function A0e(e){let t=new dl;return t.width=eV,t.height=eV,t.scaleByDistance=new Ht(s0e,c0e,l0e,u0e),t.pixelOffsetScaleByDistance=new Ht(s0e,c0e,l0e,u0e),t.verticalOrigin=new hi(Yn.BOTTOM),t.image=e,t}function Ght(){let e=new vm;return e.translucencyByDistance=new Ht(3e6,1,5e6,0),e.pixelOffset=new Q(17,0),e.horizontalOrigin=Ni.LEFT,e.font="16px sans-serif",e.style=Ir.FILL_AND_OUTLINE,e}function g0e(e){let t=new pl;return t.width=4,t.material=new s0,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var d0e={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"}},xP;typeof document<"u"&&(xP=document.createElement("div"));function fZ(e,t){let n,i="",o=Object.keys(d0e),r=o.length;for(n=0;n<r;n++){let f=o[n],h=d0e[f];h.value=xu(e,h.tag,qo.gpx)??"",l(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!l(i)||i==="")return;i=kht.link(i),xP.innerHTML=i;let a=xP.querySelectorAll("a");for(n=0;n<a.length;n++)a[n].setAttribute("target","_blank");let s=U.WHITE,c=U.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${s.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${xP.innerHTML}</div>`,xP.innerHTML="",u}function _0e(e,t,n,i){let o=lZ(t),r=cZ(t,n);r.position=o;let a=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,eV);r.billboard=A0e(a);let s=xu(t,"name",qo.gpx);r.name=s,r.label=Ght(),r.label.text=s,r.description=fZ(t,r),i.clampToGround&&(r.billboard.heightReference=ot.CLAMP_TO_GROUND,r.label.heightReference=ot.CLAMP_TO_GROUND)}function Vht(e,t,n,i){let o=cZ(t,n);o.description=fZ(t,o);let r=uZ(t,"rtept",qo.gpx),a=new Array(r.length);for(let s=0;s<r.length;s++)_0e(e,r[s],n,i),a[s]=lZ(r[s]);o.polyline=g0e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=a}function Hht(e,t,n,i){let o=cZ(t,n);o.description=fZ(t,o);let r=uZ(t,"trkseg",qo.gpx),a=[],s=[],c,u=!0,f=new yc;for(let h=0;h<r.length;h++)c=Wht(r[h]),a=a.concat(c.positions),c.times.length>0?(s=s.concat(c.times),f.addSamples(s,a),u=u&&!0):u=!1;if(u){let h=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,eV);o.billboard=A0e(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=ot.CLAMP_TO_GROUND),o.availability=new Ba,o.availability.addInterval(new Rn({start:s[0],stop:s[s.length-1]}))}o.polyline=g0e(i.trackColor),o.polyline.positions=a,i.clampToGround&&(o.polyline.clampToGround=!0)}function Wht(e){let t={positions:[],times:[]},n=uZ(e,"trkpt",qo.gpx),i;for(let o=0;o<n.length;o++){let r=lZ(n[o]);t.positions.push(r),i=xu(n[o],"time",qo.gpx),l(i)&&t.times.push(X.fromIso8601(i))}return t}function jht(e){let t=Yy(e,"metadata",qo.gpx);if(l(t)){let n={name:xu(t,"name",qo.gpx),desc:xu(t,"desc",qo.gpx),author:Yht(t),copyright:Kht(t),link:y0e(t),time:xu(t,"time",qo.gpx),keywords:xu(t,"keywords",qo.gpx),bounds:Xht(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function Yht(e){let t=Yy(e,"author",qo.gpx);if(l(t)){let n={name:xu(t,"name",qo.gpx),email:qht(t),link:y0e(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function qht(e){let t=Yy(e,"email",qo.gpx);if(l(t)){let n=xu(t,"id",qo.gpx),i=xu(t,"domain",qo.gpx);return`${n}@${i}`}}function y0e(e){let t=Yy(e,"link",qo.gpx);if(l(t)){let n={href:TP(t,"href"),text:xu(t,"text",qo.gpx),mimeType:xu(t,"type",qo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function Kht(e){let t=Yy(e,"copyright",qo.gpx);if(l(t)){let n={author:TP(t,"author"),year:xu(t,"year",qo.gpx),license:xu(t,"license",qo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function Xht(e){let t=Yy(e,"bounds",qo.gpx);if(l(t)){let n={minLat:bP(t,"minlat",qo.gpx),maxLat:bP(t,"maxlat",qo.gpx),minLon:bP(t,"minlon",qo.gpx),maxLon:bP(t,"maxlon",qo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var h0e={wpt:_0e,rte:Vht,trk:Hht};function Jht(e,t,n,i){let o=Object.keys(h0e),r=o.length;for(let a=0;a<r;a++){let s=o[a],c=h0e[s],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===s&&qo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function m0e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=TP(o,"version"),a=TP(o,"creator"),s,c=jht(o);l(c)&&(s=c.name),o.localName==="gpx"?Jht(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,A=X.equals(h,Ze.MINIMUM_VALUE),m=X.equals(p,Ze.MAXIMUM_VALUE);if(!A||!m){let y;A&&(y=new Date,y.setHours(0,0,0,0),h=X.fromDate(y)),m&&(y=new Date,y.setHours(24,0,0,0),p=X.fromDate(y)),u=new mp,u.startTime=h,u.stopTime=p,u.currentTime=X.clone(h),u.clockRange=va.LOOP_STOP,u.clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(X.secondsDifference(p,h)/60,1),31556900))}let _=!1;return e._name!==s&&(e._name=s,_=!0),e._creator!==a&&(e._creator=a,_=!0),Zht(e._metadata,c)&&(e._metadata=c,_=!0),e._version!==r&&(e._version=r,_=!0),u!==e._clock&&(_=!0,e._clock=u),_&&e._changed.raiseEvent(e),Da.setLoading(e,!1),e}function Zht(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function $ht(e,t,n,i){i=i??V.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,a=n.credits;if(l(a)){let s=a.length;for(let c=0;c<s;c++)r.push(a[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?zht(r).then(function(a){let s,c;try{s=p0e.parseFromString(a,"application/xml")}catch(u){c=u.toString()}if(l(c)||s.body||s.documentElement.tagName==="parsererror"){let u=l(c)?c:s.documentElement.firstChild.nodeValue;throw u||(u=s.body.innerText),new ue(u)}return m0e(e,s,i)}):m0e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function iS(){this._changed=new _e,this._error=new _e,this._loading=new _e,this._clock=void 0,this._entityCollection=new $s(this),this._entityCluster=new xd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Gy}iS.load=function(e,t){return new iS().load(e,t)};Object.defineProperties(iS.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});iS.prototype.update=function(e){return!0};iS.prototype.load=function(e,t){if(!l(e))throw new de("data is required.");t=t??V.EMPTY_OBJECT,Da.setLoading(this,!0);let n=this._name,i=this;return $ht(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),a=r.start,s=r.stop,c=X.equals(a,Ze.MINIMUM_VALUE),u=X.equals(s,Ze.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),a=X.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),s=X.fromDate(h)),o=new mp,o.startTime=a,o.stopTime=s,o.currentTime=X.clone(a),o.clockRange=va.LOOP_STOP,o.clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(X.secondsDifference(s,a)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Da.setLoading(i,!1),i}).catch(function(o){return Da.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var tV=iS;function emt(e,t){this.position=e,this.headingPitchRoll=t}var nV=emt;var wP=Na(Fu(),1);function tmt(e,t){this.position=e,this.headingPitchRange=t}var iV=tmt;function oV(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new _e,this.tourEnd=new _e,this.entryStart=new _e,this.entryEnd=new _e,this._activeEntries=[]}oV.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};oV.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;E0e.call(this,e,t,function(i){n.playlistIndex=0,i||C0e(n._activeEntries),n.tourEnd.raiseEvent(i)})};oV.prototype.stop=function(){C0e(this._activeEntries)};function C0e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function E0e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=nmt.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 a=r._activeEntries.indexOf(i);a>=0&&r._activeEntries.splice(a,1)}),o(e,t,n)}}else l(n)&&n(!1)}function nmt(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++,E0e.call(this,e,t,n)}}var rV=oV;var Vi=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-Vi.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?Vi.Bounce.In(e*2)*.5:Vi.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}}}}),SP=function(){return performance.now()},imt=(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 a=r[o];(t=a._group)===null||t===void 0||t.remove(a),a._group=this,this._tweens[a.getId()]=a,this._tweensAddedDuringUpdate[a.getId()]=a}},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=SP()),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]],a=!n;r&&r.update(t,a)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),oS={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=oS.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=oS.Utils.Bernstein,a=0;a<=i;a++)n+=o(1-t,i-a)*o(t,a)*e[a]*r(i,a);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=oS.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=oS.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,a=(i-t)*.5,s=o*o,c=o*s;return(2*t-2*n+r+a)*c+(-3*t+3*n-2*r-a)*s+r*o+t}}},I0e=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),dZ=new imt,b0e=(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=Vi.Linear.None,this._interpolationFunction=oS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=I0e.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=dZ,dZ.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=SP()),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 a in i){var s=t[a],c=Array.isArray(s),u=c?"array":typeof s,f=!c&&Array.isArray(i[a]);if(!(u==="undefined"||u==="function")){if(f){var h=i[a];if(h.length===0)continue;for(var p=[s],A=0,m=h.length;A<m;A+=1){var _=this._handleRelativeValue(s,h[A]);if(isNaN(_)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(_)}f&&(i[a]=p)}if((u==="object"||c)&&s&&!f){n[a]=c?[]:{};var y=s;for(var C in y)n[a][C]=y[C];o[a]=c?[]:{};var h=i[a];if(!this._isDynamic){var E={};for(var C in h)E[C]=h[C];i[a]=h=E}this._setupProperties(y,n[a],h,o[a],r)}else(typeof n[a]>"u"||r)&&(n[a]=s),c||(n[a]*=1),f?o[a]=i[a].slice().reverse():o[a]=n[a]||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=SP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=SP()),!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=Vi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=oS.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=SP()),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 a=t-this._startTime,s=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*s,u=function(){if(i._duration===0||a>c)return 1;var _=Math.trunc(a/s),y=a-_*s,C=Math.min(y/i._duration,1);return C===0&&a===i._duration?1:C},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||a>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((a-this._duration)/s)+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+=s*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var A=0,m=this._chainedTweens.length;A<m;A++)this._chainedTweens[A].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 a=n[r]||0,s=i[r],c=Array.isArray(t[r]),u=Array.isArray(s),f=!c&&u;f?t[r]=this._interpolationFunction(s,o):typeof s=="object"&&s?this._updateProperties(t[r],a,s,o):(s=this._handleRelativeValue(a,s),typeof s=="number"&&(t[r]=a+(s-a)*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 mbi=I0e.nextId,Rp=dZ,pbi=Rp.getAll.bind(Rp),Abi=Rp.removeAll.bind(Rp),gbi=Rp.add.bind(Rp),_bi=Rp.remove.bind(Rp),ybi=Rp.update.bind(Rp);var omt={LINEAR_NONE:Vi.Linear.None,QUADRATIC_IN:Vi.Quadratic.In,QUADRATIC_OUT:Vi.Quadratic.Out,QUADRATIC_IN_OUT:Vi.Quadratic.InOut,CUBIC_IN:Vi.Cubic.In,CUBIC_OUT:Vi.Cubic.Out,CUBIC_IN_OUT:Vi.Cubic.InOut,QUARTIC_IN:Vi.Quartic.In,QUARTIC_OUT:Vi.Quartic.Out,QUARTIC_IN_OUT:Vi.Quartic.InOut,QUINTIC_IN:Vi.Quintic.In,QUINTIC_OUT:Vi.Quintic.Out,QUINTIC_IN_OUT:Vi.Quintic.InOut,SINUSOIDAL_IN:Vi.Sinusoidal.In,SINUSOIDAL_OUT:Vi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Vi.Sinusoidal.InOut,EXPONENTIAL_IN:Vi.Exponential.In,EXPONENTIAL_OUT:Vi.Exponential.Out,EXPONENTIAL_IN_OUT:Vi.Exponential.InOut,CIRCULAR_IN:Vi.Circular.In,CIRCULAR_OUT:Vi.Circular.Out,CIRCULAR_IN_OUT:Vi.Circular.InOut,ELASTIC_IN:Vi.Elastic.In,ELASTIC_OUT:Vi.Elastic.Out,ELASTIC_IN_OUT:Vi.Elastic.InOut,BACK_IN:Vi.Back.In,BACK_OUT:Vi.Back.Out,BACK_IN_OUT:Vi.Back.InOut,BOUNCE_IN:Vi.Bounce.In,BOUNCE_OUT:Vi.Bounce.Out,BOUNCE_IN_OUT:Vi.Bounce.InOut},Pa=Object.freeze(omt);function aV(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}aV.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new le(this.view.position);t.flyToBoundingSphere(o,i)}};aV.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};aV.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Pa.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Pt(t,e)),t};var sV=aV;function hZ(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}hZ.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};hZ.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var cV=hZ;var M0e={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=Ug(t),M0e[t]}},CZ;typeof DOMParser<"u"&&(CZ=new DOMParser);var rmt=new $G({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),qy=32,x0e=2414016,T0e=1,S0e=16093e3,w0e=.1,B0e=[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"],D0e=["http://www.google.com/kml/ext/2.2"],amt=["http://www.w3.org/2005/Atom"],Ge={kml:B0e,gx:D0e,atom:amt,kmlgx:B0e.concat(D0e)},EZ={Document:V0e,Folder:Tmt,Placemark:Smt,NetworkLink:Lmt,GroundOverlay:Rmt,PhotoOverlay:j0e,ScreenOverlay:Pmt,Tour:Bmt};function Mp(e){this._dataSource=e,this._deferred=Qu(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Mp.prototype,{dataSource:{get:function(){return this._dataSource}}});Mp.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Mp.prototype.addPromise=function(e){this._promises.push(e)};Mp.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Mp.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=gf._getTimestamp()),this._process(e)};Mp.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=gf._getTimestamp(),e._process(!0)},0)};Mp.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]};Mp.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Mp.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;l(i);){let o=EZ[i.localName];if(l(o)&&(Ge.kml.indexOf(i.namespaceURI)!==-1||Ge.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||gf._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function smt(e){let t=e.slice(0,Math.min(4,e.size)),n=Qu(),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 cmt(e){let t=Qu(),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 N0e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let a in t)t.hasOwnProperty(a)&&(o=RegExp(`[< ]${a}:`),r=`xmlns:${a}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[a]}"`));return l(n)&&(e=n+i),e}function L0e(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}async function lmt(e,t){let n=await e.getData(new tP);n=N0e(n),n=L0e(n),t.kml=CZ.parseFromString(n,"application/xml")}async function mZ(e,t){let n=M0e.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new $v(n));t[e.filename]=i}function pf(e,t,n,i){let o=i.keys,r=new wP.default("."),a=e.querySelectorAll(t);for(let s=0;s<a.length;s++){let c=a[s],u=c.getAttribute(n);if(l(u)){let h=new wP.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let A=o[p];c.setAttribute(n,i[A]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",A)}}}}function Af(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(n),c=IZ(s,i);l(c)&&a.setAttribute(n,c.url)}}function O0e(e,t,n){let i=fs(e,"id");i=l(i)&&i.length!==0?i:Jn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Jn(),l(n)&&(i=n+i)),o=t.add(new $o({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new kmt),o}function BP(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function dV(e,t){if(!l(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return d.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,d.fromDegrees(i,o,r,t)}function lV(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let a=0;a<i;a++)o[r++]=dV(n[a],t);return o}function Ky(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function fs(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Hi(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let a=i[r];if(a.localName===t&&n.indexOf(a.namespaceURI)!==-1)return a}}function v0e(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function Kh(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let a=0;a<r;a++){let s=o[a];s.localName===t&&n.indexOf(s.namespaceURI)!==-1&&i.push(s)}return i}function gi(e,t,n){let i=Hi(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function kn(e,t,n){let i=Hi(e,t,n);if(l(i))return i.textContent.trim()}function Xh(e,t,n){let i=Hi(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function IZ(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new De({url:o});else{let r=new wP.default(t.getUrlComponent()),a=new wP.default(e);o=n[a.absoluteTo(r)],l(o)&&(i=new De({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Tu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function _Z(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(Tu.maximumRed=r,Tu.red=void 0):(Tu.maximumRed=void 0,Tu.red=0),o>0?(Tu.maximumGreen=o,Tu.green=void 0):(Tu.maximumGreen=void 0,Tu.green=0),i>0?(Tu.maximumBlue=i,Tu.blue=void 0):(Tu.maximumBlue=void 0,Tu.blue=0),Tu.alpha=n,U.fromRandom(Tu)):new U(r,o,i,n)}function P0(e,t,n){let i=kn(e,t,n);if(l(i))return _Z(i,kn(e,"colorMode",n)==="random")}function umt(e){let t=Hi(e,"TimeStamp",Ge.kmlgx),n=kn(t,"when",Ge.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=X.fromIso8601(n),o=new Ba;return o.addInterval(new Rn({start:i,stop:Ze.MAXIMUM_VALUE})),o}function fmt(e){let t=Hi(e,"TimeSpan",Ge.kmlgx);if(!l(t))return;let n,i=Hi(t,"begin",Ge.kmlgx),o=l(i)?X.fromIso8601(i.textContent):void 0,r=Hi(t,"end",Ge.kmlgx),a=l(r)?X.fromIso8601(r.textContent):void 0;if(l(o)&&l(a)){if(X.lessThan(a,o)){let s=o;o=a,a=s}n=new Ba,n.addInterval(new Rn({start:o,stop:a}))}else l(o)?(n=new Ba,n.addInterval(new Rn({start:o,stop:Ze.MAXIMUM_VALUE}))):l(a)&&(n=new Ba,n.addInterval(new Rn({start:Ze.MINIMUM_VALUE,stop:a})));return n}function F0e(){let e=new dl;return e.width=qy,e.height=qy,e.scaleByDistance=new Ht(x0e,T0e,S0e,w0e),e.pixelOffsetScaleByDistance=new Ht(x0e,T0e,S0e,w0e),e}function bZ(){let e=new Pm;return e.outline=!0,e.outlineColor=U.WHITE,e}function Q0e(){let e=new vm;return e.translucencyByDistance=new Ht(3e6,1,5e6,0),e.pixelOffset=new Q(17,0),e.horizontalOrigin=Ni.LEFT,e.font="16px sans-serif",e.style=Ir.FILL_AND_OUTLINE,e}function xZ(e,t,n,i,o){let r=kn(e,"href",Ge.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let s=r.charAt(21),c=gi(e,"x",Ge.gx)??0,u=gi(e,"y",Ge.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;r=`https://maps.google.com/mapfiles/kml/pal${s}/icon${f}.png`}let a=IZ(r,n,i);if(o){let s=kn(e,"refreshMode",Ge.kml),c=kn(e,"viewRefreshMode",Ge.kml);s==="onInterval"||s==="onExpire"?bt(`kml-refreshMode-${s}`,`KML - Unsupported Icon refreshMode: ${s}`):(c==="onStop"||c==="onRegion")&&bt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=kn(e,"viewBoundScale",Ge.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=kn(e,"viewFormat",Ge.kml)??f,p=kn(e,"httpQuery",Ge.kml);l(h)&&a.setQueryParameters(Ff(fV(h))),l(p)&&a.setQueryParameters(Ff(fV(p)));let A=t._ellipsoid;return SZ(a,t.camera,t.canvas,u,t._lastCameraView.bbox,A),a}return a}function dmt(e,t,n,i,o){let r=gi(t,"scale",Ge.kml),a=gi(t,"heading",Ge.kml),s=P0(t,"color",Ge.kml),c=Hi(t,"Icon",Ge.kml),u=xZ(c,e,i,o,!1);l(c)&&!l(u)&&(u=!1);let f=gi(c,"x",Ge.gx),h=gi(c,"y",Ge.gx),p=gi(c,"w",Ge.gx),A=gi(c,"h",Ge.gx),m=Hi(t,"hotSpot",Ge.kml),_=Ky(m,"x"),y=Ky(m,"y"),C=fs(m,"xunits"),E=fs(m,"yunits"),I=n.billboard;l(I)||(I=F0e(),n.billboard=I),I.image=u,I.scale=r,I.color=s,(l(f)||l(h)||l(p)||l(A))&&(I.imageSubRegion=new et(f,h,p,A)),l(a)&&a!==0&&(I.rotation=D.toRadians(-a),I.alignedAxis=d.UNIT_Z),r=r??1;let x,S;l(_)&&(C==="pixels"?x=-_*r:C==="insetPixels"?x=(_-qy)*r:C==="fraction"&&(x=-_*qy*r),x+=qy*.5*r),l(y)&&(E==="pixels"?S=y*r:E==="insetPixels"?S=(-y+qy)*r:E==="fraction"&&(S=y*qy*r),S-=qy*.5*r),(l(x)||l(S))&&(I.pixelOffset=new Q(x,S))}function uV(e,t,n,i,o){for(let r=0,a=t.childNodes.length;r<a;r++){let s=t.childNodes.item(r);if(s.localName==="IconStyle")dmt(e,s,n,i,o);else if(s.localName==="LabelStyle"){let c=n.label;l(c)||(c=Q0e(),n.label=c),c.scale=gi(s,"scale",Ge.kml)??c.scale,c.fillColor=P0(s,"color",Ge.kml)??c.fillColor,c.text=n.name}else if(s.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new pl,n.polyline=c),c.width=gi(s,"width",Ge.kml),c.material=P0(s,"color",Ge.kml),l(P0(s,"outerColor",Ge.gx))&&bt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(gi(s,"outerWidth",Ge.gx))&&bt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(gi(s,"physicalWidth",Ge.gx))&&bt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Xh(s,"labelVisibility",Ge.gx))&&bt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(s.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=bZ(),n.polygon=c),c.material=P0(s,"color",Ge.kml)??c.material,c.fill=Xh(s,"fill",Ge.kml)??c.fill,c.outline=Xh(s,"outline",Ge.kml)??c.outline}else if(s.localName==="BalloonStyle"){let c=_Z(kn(s,"bgColor",Ge.kml))??U.WHITE,u=_Z(kn(s,"textColor",Ge.kml))??U.BLACK,f=kn(s,"text",Ge.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(s.localName==="ListStyle"){let c=kn(s,"listItemType",Ge.kml);(c==="radioFolder"||c==="checkOffOnly")&&bt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function hmt(e,t,n,i,o){let r=new $o,a,s=-1,c=t.childNodes,u=c.length;for(let h=0;h<u;h++){let p=c[h];(p.localName==="Style"||p.localName==="StyleMap")&&(s=h)}if(s!==-1){let h=c[s];if(h.localName==="Style")uV(e,h,r,i,o);else{let p=Kh(h,"Pair",Ge.kml);for(let A=0;A<p.length;A++){let m=p[A],_=kn(m,"key",Ge.kml);if(_==="normal"){let y=kn(m,"styleUrl",Ge.kml);if(l(y))a=n.getById(y),l(a)||(a=n.getById(`#${y}`)),l(a)&&r.merge(a);else{let C=Hi(m,"Style",Ge.kml);uV(e,C,r,i,o)}}else bt(`kml-styleMap-${_}`,`KML - Unsupported StyleMap key: ${_}`)}}}let f=kn(t,"styleUrl",Ge.kml);if(l(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),A=p[0];h=`${i.getDerivedResource({url:A}).getUrlComponent()}#${p[1]}`}a=n.getById(h),l(a)||(a=n.getById(`#${h}`)),l(a)&&r.merge(a)}return r}function mmt(e,t,n){return t.fetchXML().then(function(i){return k0e(e,i,n,t,!0)})}function k0e(e,t,n,i,o,r){let a,s,c,u,f=v0e(t,"Style",Ge.kml);if(l(f)){let _=f.length;for(a=0;a<_;a++)u=f[a],s=fs(u,"id"),l(s)&&(s=`#${s}`,o&&l(i)&&(s=i.getUrlComponent()+s),l(n.getById(s))||(c=new $o({id:s}),n.add(c),uV(e,u,c,i,r)))}let h=v0e(t,"StyleMap",Ge.kml);if(l(h)){let _=h.length;for(a=0;a<_;a++){let y=h[a];if(s=fs(y,"id"),l(s)){let C=Kh(y,"Pair",Ge.kml);for(let E=0;E<C.length;E++){let I=C[E],x=kn(I,"key",Ge.kml);if(x==="normal"){if(s=`#${s}`,o&&l(i)&&(s=i.getUrlComponent()+s),!l(n.getById(s))){c=n.getOrCreateEntity(s);let S=kn(I,"styleUrl",Ge.kml);if(l(S)){S[0]!=="#"&&(S=`#${S}`),o&&l(i)&&(S=i.getUrlComponent()+S);let w=n.getById(S);l(w)&&c.merge(w)}else u=Hi(I,"Style",Ge.kml),uV(e,u,c,i,r)}}else bt(`kml-styleMap-${x}`,`KML - Unsupported StyleMap key: ${x}`)}}}}let p=[],A=t.getElementsByTagName("styleUrl"),m=A.length;for(a=0;a<m;a++){let _=A[a].textContent;if(_[0]!=="#"){let y=_.split("#");if(y.length===2){let C=y[0],E=i.getDerivedResource({url:C});p.push(mmt(e,E,n))}}}return p}function TZ(e,t,n){let i=new by(e,t.id,["position"]),o=new ag(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new pl,t.polyline.positions=new Ey([i,o])}function U0e(e,t){return!l(e)&&!l(t)||e==="clampToGround"?ot.CLAMP_TO_GROUND:e==="relativeToGround"?ot.RELATIVE_TO_GROUND:e==="absolute"?ot.NONE:t==="clampToSeaFloor"?(bt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),ot.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(bt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),ot.RELATIVE_TO_GROUND):(l(e)?bt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):bt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),ot.CLAMP_TO_GROUND)}function pmt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new ag(e))}function Amt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let a=e[r];i.scaleToGeodeticSurface(a,a)}return e}function hV(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():Q0e(),t.label=o),o.text=t.name;let r=t.billboard;l(r)||(r=l(n.billboard)?n.billboard.clone():F0e(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(U.YELLOW,64);let a=1;l(r.scale)&&(a=r.scale.getValue(),a!==0?o.pixelOffset=new Q(a*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function z0e(e,t){let n=e.path;l(n)||(n=new s_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function gmt(e,t,n,i,o){let r=kn(n,"coordinates",Ge.kml),a=kn(n,"altitudeMode",Ge.kml),s=kn(n,"altitudeMode",Ge.gx),c=Xh(n,"extrude",Ge.kml),u=e._ellipsoid,f=dV(r,u);return i.position=f,hV(e,i,o,U0e(a,s)),c&&BP(a,s)&&TZ(t,i,o),!0}function P0e(e,t,n,i,o){let r=Hi(n,"coordinates",Ge.kml),a=kn(n,"altitudeMode",Ge.kml),s=kn(n,"altitudeMode",Ge.gx),c=Xh(n,"extrude",Ge.kml),u=Xh(n,"tessellate",Ge.kml),f=BP(a,s),h=gi(n,"drawOrder",Ge.gx),p=e._ellipsoid,A=lV(r,p),m=o.polyline;if(f&&c){let _=new c_;i.wall=_,_.positions=A;let y=o.polygon;l(y)&&(_.fill=y.fill,_.material=y.material),_.outline=!0,l(m)?(_.outlineColor=l(m.material)?m.material.color:U.WHITE,_.outlineWidth=m.width):l(y)&&(_.outlineColor=l(y.material)?y.material.color:U.WHITE)}else if(e._clampToGround&&!f&&u){let _=new pl;_.clampToGround=!0,i.polyline=_,_.positions=A,l(m)?(_.material=l(m.material)?m.material.color.getValue(Ze.MINIMUM_VALUE):U.WHITE,_.width=m.width??1):(_.material=U.WHITE,_.width=1),_.zIndex=h}else l(h)&&bt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&bt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new pl,i.polyline=m,m.positions=Amt(A,a,s,p),(!u||f)&&(m.arcType=un.NONE);return!0}function _mt(e,t,n,i,o){let r=Hi(n,"outerBoundaryIs",Ge.kml),a=Hi(r,"LinearRing",Ge.kml),s=Hi(a,"coordinates",Ge.kml),c=e._ellipsoid,u=lV(s,c),f=Xh(n,"extrude",Ge.kml),h=kn(n,"altitudeMode",Ge.kml),p=kn(n,"altitudeMode",Ge.gx),A=BP(h,p),m=l(o.polygon)?o.polygon.clone():bZ(),_=o.polyline;if(l(_)&&(m.outlineColor=l(_.material)?_.material.color:U.WHITE,m.outlineWidth=_.width),i.polygon=m,A?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let y=new Fc(u),C=Kh(n,"innerBoundaryIs",Ge.kml);for(let E=0;E<C.length;E++){a=Kh(C[E],"LinearRing",Ge.kml);for(let I=0;I<a.length;I++)s=Hi(a[I],"coordinates",Ge.kml),u=lV(s,c),l(u)&&y.holes.push(new Fc(u))}m.hierarchy=y}return!0}function ymt(e,t,n,i,o){let r=kn(n,"altitudeMode",Ge.kml),a=kn(n,"altitudeMode",Ge.gx),s=Kh(n,"coord",Ge.gx),c=Kh(n,"angles",Ge.gx),u=Kh(n,"when",Ge.kml),f=Xh(n,"extrude",Ge.kml),h=BP(r,a),p=e._ellipsoid;c.length>0&&bt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let A=Math.min(s.length,u.length),m=[],_=[];for(let C=0;C<A;C++){let E=dV(s[C].textContent,p);m.push(E),_.push(X.fromIso8601(u[C].textContent))}let y=new yc;return y.addSamples(_,m),i.position=y,hV(e,i,o,U0e(r,a)),z0e(i,o),i.availability=new Ba,u.length>0&&i.availability.addInterval(new Rn({start:_[0],stop:_[_.length-1]})),h&&f&&TZ(t,i,o),!0}function R0e(e,t,n,i,o,r,a,s,c){let u=e[0],f=e[e.length-1],h=new yc;h.addSamples(e,t),n.intervals.addInterval(new Rn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:pmt(h,a,s)})),i.addInterval(new Rn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Rn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:r}))}function Cmt(e,t,n,i,o){let r=Xh(n,"interpolate",Ge.gx),a=Kh(n,"Track",Ge.gx),s,c,u,f=!1,h=new Sy,p=new Ba,A=new _c,m=e._ellipsoid;for(let _=0,y=a.length;_<y;_++){let C=a[_],E=Kh(C,"when",Ge.kml),I=Kh(C,"coord",Ge.gx),x=kn(C,"altitudeMode",Ge.kml),S=kn(C,"altitudeMode",Ge.gx),w=BP(x,S),v=Xh(C,"extrude",Ge.kml),R=Math.min(I.length,E.length),N=[];s=[];for(let L=0;L<R;L++){let g=dV(I[L].textContent,m);N.push(g),s.push(X.fromIso8601(E[L].textContent))}r&&(l(c)&&R0e([c,s[0]],[u,N[0]],A,p,h,!1,"absolute",void 0,!1),c=s[R-1],u=N[N.length-1]),R0e(s,N,A,p,h,w&&v,x,S,!0),f=f||w&&v}return i.availability=p,i.position=A,hV(e,i,o),z0e(i,o),f&&(TZ(t,i,o),i.polyline.show=h),!0}var G0e={Point:gmt,LineString:P0e,LinearRing:P0e,Polygon:_mt,Track:ymt,MultiTrack:Cmt,MultiGeometry:Emt,Model:Imt};function Emt(e,t,n,i,o,r){let a=n.childNodes,s=!1;for(let c=0,u=a.length;c<u;c++){let f=a.item(c),h=G0e[f.localName];if(l(h)){let p=O0e(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(s=!0)}}return s}function Imt(e,t,n,i,o){return bt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function bmt(e,t){let n=Hi(e,"ExtendedData",Ge.kml);if(!l(n))return;l(Hi(n,"SchemaData",Ge.kml))&&bt("kml-schemaData","KML - SchemaData is unsupported"),l(fs(n,"xmlns:prefix"))&&bt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Kh(n,"Data",Ge.kml);if(l(o)){let r=o.length;for(let a=0;a<r;a++){let s=o[a],c=fs(s,"name");l(c)&&(i[c]={displayName:kn(s,"displayName",Ge.kml),value:kn(s,"value",Ge.kml)})}}t.kml.extendedData=i}var No;typeof document<"u"&&(No=document.createElement("div"));function xmt(e,t,n,i,o){let r,a,s,c=t.kml,u=c.extendedData,f=kn(e,"description",Ge.kml),h=t.balloonStyle??n.balloonStyle,p=U.WHITE,A=U.BLACK,m=f;l(h)&&(p=h.bgColor??U.WHITE,A=h.textColor??U.BLACK,m=h.text??f);let _;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let E=m.match(/\$\[.+?\]/g);if(E!==null)for(r=0;r<E.length;r++){let I=E[r],x=I.substr(2,I.length-3),S=/\/displayName$/.test(x);x=x.replace(/\/displayName$/,""),_=u[x],l(_)&&(_=S?_.displayName:_.value),l(_)&&(m=m.replace(I,_??""))}}}else if(l(u)&&(s=Object.keys(u),s.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<s.length;r++)a=s[r],_=u[a],m+=`<tr><th>${_.displayName??a}</th><td>${_.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=rmt.link(m),No.innerHTML=m;let y=No.querySelectorAll("a");for(r=0;r<y.length;r++)y[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(pf(No,"a","href",i),pf(No,"link","href",i),pf(No,"area","href",i),pf(No,"img","src",i),pf(No,"iframe","src",i),pf(No,"video","src",i),pf(No,"audio","src",i),pf(No,"source","src",i),pf(No,"track","src",i),pf(No,"input","src",i),pf(No,"embed","src",i),pf(No,"script","src",i),pf(No,"video","poster",i)),Af(No,"a","href",o),Af(No,"link","href",o),Af(No,"area","href",o),Af(No,"img","src",o),Af(No,"iframe","src",o),Af(No,"video","src",o),Af(No,"audio","src",o),Af(No,"source","src",o),Af(No,"track","src",o),Af(No,"input","src",o),Af(No,"embed","src",o),Af(No,"script","src",o),Af(No,"video","poster",o);let C='<div class="cesium-infoBox-description-lighter" style="';C+="overflow:auto;",C+="word-wrap:break-word;",C+=`background-color:${p.toCssColorString()};`,C+=`color:${A.toCssColorString()};`,C+='">',C+=`${No.innerHTML}</div>`,No.innerHTML="",t.description=C}function mV(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,a=n.uriResolver,s=O0e(t,i,n.context),c=s.kml,u=hmt(e,t,n.styleCollection,r,a),f=kn(t,"name",Ge.kml);s.name=f,s.parent=o;let h=fmt(t);l(h)||(h=umt(t)),s.availability=h,BZ(s);function p(I){return I?I.show&&p(I.parent):!0}let A=Xh(t,"visibility",Ge.kml);s.show=p(o)&&(A??!0);let m=Hi(t,"author",Ge.atom),_=c.author;_.name=kn(m,"name",Ge.atom),_.uri=kn(m,"uri",Ge.atom),_.email=kn(m,"email",Ge.atom);let y=Hi(t,"link",Ge.atom),C=c.link;C.href=fs(y,"href"),C.hreflang=fs(y,"hreflang"),C.rel=fs(y,"rel"),C.type=fs(y,"type"),C.title=fs(y,"title"),C.length=fs(y,"length"),c.address=kn(t,"address",Ge.kml),c.phoneNumber=kn(t,"phoneNumber",Ge.kml),c.snippet=kn(t,"Snippet",Ge.kml),bmt(t,s),xmt(t,s,u,a,r);let E=e._ellipsoid;return W0e(t,s,E),H0e(t,s,E),l(Hi(t,"Region",Ge.kml))&&bt("kml-region","KML - Placemark Regions are unsupported"),{entity:s,styleEntity:u}}function V0e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Tmt(e,t,n,i){let o=mV(e,t,n),r=Ye(n);r.parentEntity=o.entity,V0e(e,t,r,i)}function Smt(e,t,n,i){let o=mV(e,t,n),r=o.entity,a=o.styleEntity,s=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!s;u++){let h=c.item(u),p=G0e[h.localName];l(p)&&(p(e,n.entityCollection,h,r,a,r.id),s=!0)}s||(r.merge(a),hV(e,r,a))}var wmt={FlyTo:vmt,Wait:Dmt,SoundCue:pZ,AnimatedUpdate:pZ,TourControl:pZ};function Bmt(e,t,n,i){let o=kn(t,"name",Ge.kml),r=fs(t,"id"),a=new rV(o,r),s=Hi(t,"Playlist",Ge.gx);if(s){let c=e._ellipsoid,u=s.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=wmt[h.localName];p?p(a,h,c):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(a)}function pZ(e,t){bt(`KML Tour unsupported node ${t.localName}`)}function Dmt(e,t){let n=gi(t,"duration",Ge.gx);e.addPlaylistEntry(new cV(n))}function vmt(e,t,n){let i=gi(t,"duration",Ge.gx),o=kn(t,"flyToMode",Ge.gx),r={kml:{}};W0e(t,r,n),H0e(t,r,n);let a=r.kml.lookAt||r.kml.camera,s=new sV(i,o,a);e.addPlaylistEntry(s)}function H0e(e,t,n){let i=Hi(e,"Camera",Ge.kml);if(l(i)){let o=gi(i,"longitude",Ge.kml)??0,r=gi(i,"latitude",Ge.kml)??0,a=gi(i,"altitude",Ge.kml)??0,s=gi(i,"heading",Ge.kml)??0,c=gi(i,"tilt",Ge.kml)??0,u=gi(i,"roll",Ge.kml)??0,f=d.fromDegrees(o,r,a,n),h=Rc.fromDegrees(s,c-90,u);t.kml.camera=new nV(f,h)}}function W0e(e,t,n){let i=Hi(e,"LookAt",Ge.kml);if(l(i)){let o=gi(i,"longitude",Ge.kml)??0,r=gi(i,"latitude",Ge.kml)??0,a=gi(i,"altitude",Ge.kml)??0,s=gi(i,"heading",Ge.kml),c=gi(i,"tilt",Ge.kml),u=gi(i,"range",Ge.kml)??0;c=D.toRadians(c??0),s=D.toRadians(s??0);let f=new Vh(s,c-D.PI_OVER_TWO,u),h=d.fromDegrees(o,r,a,n);t.kml.lookAt=new iV(h,f)}}function Pmt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,a=n.uriResolver,s=Hi(t,"Icon",Ge.kml),c=xZ(s,e,r,a,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],h=Hi(t,"screenXY",Ge.kml),p=Hi(t,"overlayXY",Ge.kml),A=Hi(t,"size",Ge.kml),m,_,y,C,E,I;l(A)&&(m=Ky(A,"x"),_=Ky(A,"y"),y=fs(A,"xunits"),C=fs(A,"yunits"),l(m)&&m!==-1&&m!==0&&(y==="fraction"?E=`width: ${Math.floor(m*100)}%`:y==="pixels"&&(E=`width: ${m}px`),f.push(E)),l(_)&&_!==-1&&_!==0&&(C==="fraction"?I=`height: ${Math.floor(_*100)}%`:C==="pixels"&&(I=`height: ${_}px`),f.push(I))),u.style=f.join(";");let x=0,S=u.height;l(p)&&(m=Ky(p,"x"),_=Ky(p,"y"),y=fs(p,"xunits"),C=fs(p,"yunits"),l(m)&&(y==="fraction"?x=m*u.width:(y==="pixels"||y==="insetPixels")&&(x=m)),l(_)&&(C==="fraction"?S=_*u.height:(C==="pixels"||C==="insetPixels")&&(S=_))),l(h)&&(m=Ky(h,"x"),_=Ky(h,"y"),y=fs(h,"xunits"),C=fs(h,"yunits"),l(m)&&(y==="fraction"?E=`left: calc(${Math.floor(m*100)}% - ${x}px)`:y==="pixels"?E=`left: ${m-x}px`:y==="insetPixels"&&(E=`right: ${m-x}px`),f.push(E)),l(_)&&(C==="fraction"?I=`bottom: calc(${Math.floor(_*100)}% - ${S}px)`:C==="pixels"?I=`bottom: ${_-S}px`:C==="insetPixels"&&(I=`top: ${_-S}px`),f.push(I))),u.style=f.join(";")},o.appendChild(u)}function Rmt(e,t,n,i){let r=mV(e,t,n).entity,a,s=!1,c=e._ellipsoid,u=lV(Hi(t,"LatLonQuad",Ge.gx),c),f=gi(t,"drawOrder",Ge.kml);if(l(u))a=bZ(),a.hierarchy=new Fc(u),a.zIndex=f,r.polygon=a,s=!0;else{a=new Rm,a.zIndex=f,r.rectangle=a;let m=Hi(t,"LatLonBox",Ge.kml);if(l(m)){let _=gi(m,"west",Ge.kml),y=gi(m,"south",Ge.kml),C=gi(m,"east",Ge.kml),E=gi(m,"north",Ge.kml);l(_)&&(_=D.negativePiToPi(D.toRadians(_))),l(y)&&(y=D.clampToLatitudeRange(D.toRadians(y))),l(C)&&(C=D.negativePiToPi(D.toRadians(C))),l(E)&&(E=D.clampToLatitudeRange(D.toRadians(E))),a.coordinates=new ce(_,y,C,E);let I=gi(m,"rotation",Ge.kml);if(l(I)){let x=D.toRadians(I);a.rotation=x,a.stRotation=x}}}let h=Hi(t,"Icon",Ge.kml),p=xZ(h,e,n.sourceResource,n.uriResolver,!0);if(l(p)){s&&bt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=gi(h,"x",Ge.gx),_=gi(h,"y",Ge.gx),y=gi(h,"w",Ge.gx),C=gi(h,"h",Ge.gx);(l(m)||l(_)||l(y)||l(C))&&bt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),a.material=p,a.material.color=P0(t,"color",Ge.kml),a.material.transparent=!0}else a.material=P0(t,"color",Ge.kml);let A=kn(t,"altitudeMode",Ge.kml);l(A)?A==="absolute"?(a.height=gi(t,"altitude",Ge.kml),a.zIndex=void 0):A!=="clampToGround"&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${A}`):(A=kn(t,"altitudeMode",Ge.gx),A==="relativeToSeaFloor"?(bt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),a.height=gi(t,"altitude",Ge.kml),a.zIndex=void 0):A==="clampToSeaFloor"?bt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(A)&&bt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${A}`))}function j0e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),bt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Xy={INTERVAL:0,EXPIRE:1,STOP:2};function fV(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Mmt=new ce,rS=new me,AZ=new Q,Nmt=new d;function SZ(e,t,n,i,o,r){function a(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function s(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=DI(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??Mmt,l(n)&&(AZ.x=n.clientWidth*.5,AZ.y=n.clientHeight*.5,u=t.pickEllipsoid(AZ,r,Nmt)),l(u)?f=r.cartesianToCartographic(u,rS):(f=ce.center(o,rS),u=r.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let C=o.width*i*.5,E=o.height*i*.5;o=new ce(s(f.longitude-C),a(f.latitude-E),s(f.longitude+C),a(f.latitude+E))}c=c.replace("[bboxWest]",D.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(o.north).toString());let h=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",h),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",d.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",h),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,rS),c=c.replace("[cameraLon]",D.toDegrees(rS.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(rS.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(rS.height).toString());let A=t.frustum,m=A.aspectRatio,_="",y="";if(l(m)){let C=D.toDegrees(A.fov);m>1?(_=C,y=C/m):(y=C,_=C*m)}c=c.replace("[horizFov]",_.toString()),c=c.replace("[vertFov]",y.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Ff(c))}function Lmt(e,t,n,i){let r=mV(e,t,n).entity,a=n.sourceResource,s=n.uriResolver,c=Hi(t,"Link",Ge.kml);if(l(c)||(c=Hi(t,"Url",Ge.kml)),l(c)){let u=kn(c,"href",Ge.kml),f,h;if(l(u)){let p=u;if(u=IZ(u,a,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(a.getUrlComponent())||(p=a.getDerivedResource({url:p}));else{if(p=u.clone(),f=kn(c,"viewRefreshMode",Ge.kml),f==="onRegion"){bt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=kn(c,"viewBoundScale",Ge.kml)??1;let y=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",C=kn(c,"viewFormat",Ge.kml)??y,E=kn(c,"httpQuery",Ge.kml);l(C)&&u.setQueryParameters(Ff(fV(C))),l(E)&&u.setQueryParameters(Ff(fV(E)));let I=e._ellipsoid;SZ(u,e.camera,e.canvas,h,e._lastCameraView.bbox,I)}let A={sourceUri:p,uriResolver:s,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new $s,_=wZ(e,m,u,A).then(function(y){let C=e._entityCollection,E=m.values;C.suspendEvents();for(let S=0;S<E.length;S++){let w=E[S];l(w.parent)||(w.parent=r,BZ(w)),C.add(w)}C.resumeEvents();let I=kn(c,"refreshMode",Ge.kml),x=gi(c,"refreshInterval",Ge.kml)??0;if(I==="onInterval"&&x>0||I==="onExpire"||f==="onStop"){let S=Hi(y,"NetworkLinkControl",Ge.kml),w=l(S),v=X.now(),R={id:Jn(),href:u,cookie:{},lastUpdated:v,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:v},N=0;if(w&&(R.cookie=Ff(kn(S,"cookie",Ge.kml)??""),N=gi(S,"minRefreshPeriod",Ge.kml)??0),I==="onInterval")w&&(x=Math.max(N,x)),R.refreshMode=Xy.INTERVAL,R.time=x;else if(I==="onExpire"){let L;if(w&&(L=kn(S,"expires",Ge.kml)),l(L))try{let g=X.fromIso8601(L),b=X.secondsDifference(g,v);b>0&&b<N&&X.addSeconds(v,N,g),R.refreshMode=Xy.EXPIRE,R.time=g}catch{bt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else bt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=Xy.STOP,R.time=gi(c,"viewRefreshTime",Ge.kml)??0):bt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(y){bt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,y)});i.addPromise(_)}}}function Omt(e,t,n,i){let o=EZ[t.localName];return l(o)?o(e,t,n,i):j0e(e,t,n,i)}function yZ(e,t,n,i,o,r,a){t.removeAll();let s=n.documentElement,c=s.localName==="Document"?s:Hi(s,"Document",Ge.kml),u=kn(c,"name",Ge.kml);l(u)||(u=Cy(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new gf._DeferredLoading(e),h=new $s(e);return Promise.all(k0e(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let _=0;_<m.length;_++){let y=m[_];if(l(EZ[y.localName])){p=y;break}}}let A={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:a,screenOverlayContainer:r};return t.suspendEvents(),Omt(e,p,A,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function Fmt(e,t,n,i,o){let r=Zt("ThirdParty/Workers/zip-web-worker.js"),a=Zt("ThirdParty/zip-module.wasm");WT({workerURI:r,wasmURI:a});let s=new x0(new xp(n)),c=await s.getEntries(),u=[],f={},h;for(let p=0;p<c.length;p++){let A=c[p];A.directory||(/\.kml$/i.test(A.filename)&&(!l(h)||!/\//i.test(A.filename))?(l(h)&&u.push(mZ(h,f)),h=A):u.push(mZ(A,f)))}if(l(h)&&u.push(lmt(h,f)),await Promise.all(u),s.close(),!l(f.kml))throw new ue("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),yZ(e,t,f.kml,i,f,o)}function wZ(e,t,n,i){i=i??V.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,a=i.context,s=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=o??De.DEFAULT.clone();return o=De.createIfNeeded(o),l(s)&&(s=zn(s)),Promise.resolve(c).then(function(u){return u instanceof Blob?smt(u).then(function(f){return f?Fmt(e,t,u,o,s):cmt(u).then(function(h){h=N0e(h),h=L0e(h);let p,A;try{p=CZ.parseFromString(h,"application/xml")}catch(m){A=m.toString()}if(l(A)||p.body||p.documentElement.tagName==="parsererror"){let m=l(A)?A:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new ue(m)}return yZ(e,t,p,o,r,s,a)})}):yZ(e,t,u,o,r,s,a)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function gf(e){e=e??V.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new _e,this._error=new _e,this._loading=new _e,this._refresh=new _e,this._unsupportedNode=new _e,this._clock=void 0,this._entityCollection=new $s(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Gy,this._networkLinks=new Ft,this._entityCluster=new xd,this.canvas=n,this.camera=t,this._lastCameraView={position:l(t)?d.clone(t.positionWC):void 0,direction:l(t)?d.clone(t.directionWC):void 0,up:l(t)?d.clone(t.upWC):void 0,bbox:l(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=e.ellipsoid??te.default;let i=e.credit;typeof i=="string"&&(i=new Et(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}gf.load=function(e,t){return t=t??V.EMPTY_OBJECT,new gf(t).load(e,t)};Object.defineProperties(gf.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});gf.prototype.load=function(e,t){t=t??V.EMPTY_OBJECT,Da.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return wZ(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),a=r.start,s=r.stop,c=X.equals(a,Ze.MINIMUM_VALUE),u=X.equals(s,Ze.MAXIMUM_VALUE);if(!c||!u){let h;c&&(h=new Date,h.setHours(0,0,0,0),a=X.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),s=X.fromDate(h)),o=new mp,o.startTime=a,o.stopTime=s,o.currentTime=X.clone(a),o.clockRange=va.LOOP_STOP,o.clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(X.secondsDifference(s,a)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Da.setLoading(i,!1),i}).catch(function(o){return Da.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};gf.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function BZ(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function Qmt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let a=!1,s=Hi(r,"NetworkLinkControl",Ge.kml),c=l(s),u=0;if(c){if(l(Hi(s,"Update",Ge.kml))){bt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ff(kn(s,"cookie",Ge.kml)??""),u=gi(s,"minRefreshPeriod",Ge.kml)??0}let f=X.now(),h=t.refreshMode;if(h===Xy.INTERVAL)l(s)&&(t.time=Math.max(u,t.time));else if(h===Xy.EXPIRE){let v;if(l(s)&&(v=kn(s,"expires",Ge.kml)),l(v))try{let R=X.fromIso8601(v),N=X.secondsDifference(R,f);N>0&&N<u&&X.addSeconds(f,u,R),t.time=R}catch{bt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),a=!0}else bt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),a=!0}let p=t.entity,A=e._entityCollection,m=n.values;function _(v){A.remove(v);let R=v._children,N=R.length;for(let L=0;L<N;++L)_(R[L])}A.suspendEvents();let y=A.values.slice(),C;for(C=0;C<y.length;++C){let v=y[C];v.parent===p&&(v.parent=void 0,_(v))}for(A.resumeEvents(),A.suspendEvents(),C=0;C<m.length;C++){let v=m[C];l(v.parent)||(v.parent=p,BZ(v)),A.add(v)}A.resumeEvents(),a?i.remove(t.id):t.lastUpdated=f;let E=A.computeAvailability(),I=E.start,x=E.stop,S=X.equals(I,Ze.MINIMUM_VALUE),w=X.equals(x,Ze.MAXIMUM_VALUE);if(!S||!w){let v=e._clock;(v.startTime!==I||v.stopTime!==x)&&(v.startTime=I,v.stopTime=x,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var gZ=new Ft;gf.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=X.now(),i=this;gZ.removeAll();function o(f){let h=f._children,p=h.length;for(let A=0;A<p;++A){let m=h[A];gZ.set(m.id,m),o(m)}}let r=!1,a=this._lastCameraView,s=this.camera;l(s)&&!(s.positionWC.equalsEpsilon(a.position,D.EPSILON7)&&s.directionWC.equalsEpsilon(a.direction,D.EPSILON7)&&s.upWC.equalsEpsilon(a.up,D.EPSILON7))&&(a.position=d.clone(s.positionWC),a.direction=d.clone(s.directionWC),a.up=d.clone(s.upWC),a.bbox=s.computeViewRectangle(),r=!0);let c=new Ft,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!gZ.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===Xy.INTERVAL?X.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===Xy.EXPIRE?X.greaterThan(n,f.time)&&(p=!0):f.refreshMode===Xy.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&X.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let A=new $s,m=f.href.clone();m.setQueryParameters(f.cookie);let _=i._ellipsoid??te.default;SZ(m,i.camera,i.canvas,f.viewBoundScale,a.bbox,_),wZ(i,A,m,{context:h.id}).then(Qmt(i,f,A,c,m)).catch(function(y){let C=`NetworkLink ${f.href} refresh failed: ${y}`;console.log(C),i._error.raiseEvent(i,C)}),u=!0}}c.set(f.id,f)}}),u&&(this._networkLinks=c,this._changed.raiseEvent(this)),!0};function kmt(){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}gf._DeferredLoading=Mp;gf._getTimestamp=ki;var aS=gf;function DP(){de.throwInstantiationError()}DP.prototype.update=de.throwInstantiationError;DP.prototype.getBoundingSphere=de.throwInstantiationError;DP.prototype.isDestroyed=de.throwInstantiationError;DP.prototype.destroy=de.throwInstantiationError;var Y0e=DP;var Umt={NONE:0,LERC:1},Jh=Object.freeze(Umt);var zmt={NONE:0,BITS12:1},rc=Object.freeze(zmt);var vP=new d,Gmt=new d,Md=new Q,Vmt=new P,Hmt=new P,Wmt=Math.pow(2,12);function Ic(e,t,n,i,o,r,a,s,c,u){let f=rc.NONE,h,p;if(l(t)&&l(n)&&l(i)&&l(o)){let A=t.minimum,m=t.maximum,_=d.subtract(m,A,Gmt),y=i-n;Math.max(d.maximumComponent(_),y)<Wmt-1?f=rc.BITS12:f=rc.NONE;let E=P.fromScale(_,Vmt);E=P.setTranslation(E,A,E);let I=P.fromScale(d.fromElements(1/_.x,1/_.y,1/_.z,vP),Hmt);I=P.multiplyByTranslation(I,d.negate(A,vP),I),p=P.clone(o,new P);let x=P.getTranslation(o,vP);x=d.subtract(x,e,vP),p=P.setTranslation(p,x,p),p=P.multiply(p,E,p),h=P.inverseTransformation(o,new P),h=P.multiply(I,h,h),o=P.multiply(o,E,new P)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=a??!1,this.hasGeodeticSurfaceNormals=s??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Ic.prototype.encode=function(e,t,n,i,o,r,a,s){let c=i.x,u=i.y;if(this.quantization===rc.BITS12){n=P.multiplyByPoint(this.toScaledENU,n,vP),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=D.clamp((o-this.minimumHeight)/f,0,1);Q.fromElements(n.x,n.y,Md);let p=tn.compressTextureCoordinates(Md);Q.fromElements(n.z,h,Md);let A=tn.compressTextureCoordinates(Md);Q.fromElements(c,u,Md);let m=tn.compressTextureCoordinates(Md);if(e[t++]=p,e[t++]=A,e[t++]=m,this.hasWebMercatorT){Q.fromElements(a,0,Md);let _=tn.compressTextureCoordinates(Md);e[t++]=_}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=a);return this.hasVertexNormals&&(e[t++]=tn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=s.x,e[t++]=s.y,e[t++]=s.z),t};var jmt=new d,q0e=new d;Ic.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 a=0;a<o;a++){for(let f=0;f<i;f++){let h=a*i+f,p=a*r+f;t[p]=e[h]}let s=this.decodePosition(t,a,jmt),c=n.geodeticSurfaceNormal(s,q0e),u=a*r+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Ic.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 a=0;a<o;a++){let s=r*n+a,c=r*o+a;t[c]=e[s]}};Ic.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new d),t*=this.stride,this.quantization===rc.BITS12){let i=tn.decompressTextureCoordinates(e[t],Md);n.x=i.x,n.y=i.y;let o=tn.decompressTextureCoordinates(e[t+1],Md);return n.z=o.x,P.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};Ic.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 a=this.decodeGeodeticSurfaceNormal(e,t,q0e),s=this.decodeHeight(e,t),c=To.getHeight(s,i,o)-s;n.x+=a.x*c,n.y+=a.y*c,n.z+=a.z*c}return n};Ic.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new Q),t*=this.stride,this.quantization===rc.BITS12?tn.decompressTextureCoordinates(e[t+2],n):Q.fromElements(e[t+4],e[t+5],n)};Ic.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===rc.BITS12?tn.decompressTextureCoordinates(e[t+1],Md).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Ic.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===rc.BITS12?tn.decompressTextureCoordinates(e[t+3],Md).x:e[t+6]};Ic.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 Q.fromElements(o,r,n)};Ic.prototype.decodeNormal=function(e,t,n){let i=t=t*this.stride+this._offsetVertexNormal;return tn.octDecodeFloat(e[i],n)};Ic.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};Ic.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===rc.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var pV={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},AV={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Ic.prototype.getAttributes=function(e){let t=j.FLOAT,n=j.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function a(s,c){r.push({index:s,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===rc.NONE){a(pV.position3DAndHeight,4);let s=2;s+=this.hasWebMercatorT?1:0,s+=this.hasVertexNormals?1:0,a(pV.textureCoordAndEncodedNormals,s),this.hasGeodeticSurfaceNormals&&a(pV.geodeticSurfaceNormal,3)}else{let s=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;a(AV.compressed0,s?4:3),c&&a(AV.compressed1,1),this.hasGeodeticSurfaceNormals&&a(AV.geodeticSurfaceNormal,3)}return r};Ic.prototype.getAttributeLocations=function(){return this.quantization===rc.NONE?pV:AV};Ic.clone=function(e,t){if(l(e))return l(t)||(t=new Ic),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=P.clone(e.toScaledENU),t.fromScaledENU=P.clone(e.fromScaledENU),t.matrix=P.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 Tr=Ic;var Np={};Np.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var DZ=new d,Ymt=new P,qmt=new d,Kmt=new d;Np.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,a=D.PI_OVER_TWO,s=D.toRadians,c=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,A=e.isGeographic??!0,m=e.ellipsoid??te.default,_=1/m.maximumRadius,y=ce.clone(e.nativeRectangle),C=ce.clone(e.rectangle),E,I,x,S;l(C)?(E=C.west,I=C.south,x=C.east,S=C.north):A?(E=s(y.west),I=s(y.south),x=s(y.east),S=s(y.north)):(E=y.west*_,I=a-2*o(r(-y.south*_)),x=y.east*_,S=a-2*o(r(-y.north*_)));let w=e.relativeToCenter,v=l(w);w=v?w:d.ZERO;let R=e.includeWebMercatorT??!1,N=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,b=N!==1,T=e.structure??Np.DEFAULT_STRUCTURE,B=T.heightScale??Np.DEFAULT_STRUCTURE.heightScale,M=T.heightOffset??Np.DEFAULT_STRUCTURE.heightOffset,O=T.elementsPerHeight??Np.DEFAULT_STRUCTURE.elementsPerHeight,G=T.stride??Np.DEFAULT_STRUCTURE.stride,k=T.elementMultiplier??Np.DEFAULT_STRUCTURE.elementMultiplier,z=T.isBigEndian??Np.DEFAULT_STRUCTURE.isBigEndian,F=ce.computeWidth(y),H=ce.computeHeight(y),Y=F/(u-1),$=H/(f-1);A||(F*=_,H*=_);let W=m.radiiSquared,K=W.x,Z=W.y,pe=W.z,ge=65536,re=-65536,ye=At.eastNorthUpToFixedFrame(w,m),Ce=P.inverseTransformation(ye,Ymt),ve,Ne;R&&(ve=mi.geodeticLatitudeToMercatorAngle(I),Ne=1/(mi.geodeticLatitudeToMercatorAngle(S)-ve));let Le=qmt;Le.x=Number.POSITIVE_INFINITY,Le.y=Number.POSITIVE_INFINITY,Le.z=Number.POSITIVE_INFINITY;let Oe=Kmt;Oe.x=Number.NEGATIVE_INFINITY,Oe.y=Number.NEGATIVE_INFINITY,Oe.z=Number.NEGATIVE_INFINITY;let nt=Number.POSITIVE_INFINITY,Fe=u*f,_t=h>0?u*2+f*2:0,rt=Fe+_t,je=new Array(rt),st=new Array(rt),ft=new Array(rt),St=R?new Array(rt):[],be=b?new Array(rt):[],Se=0,qt=f,mt=0,Ut=u;p&&(--Se,++qt,--mt,++Ut);let Gn=1e-5;for(let ii=Se;ii<qt;++ii){let qn=ii;qn<0&&(qn=0),qn>=f&&(qn=f-1);let Yi=y.north-$*qn;A?Yi=s(Yi):Yi=a-2*o(r(-Yi*_));let vo=(Yi-I)/(S-I);vo=D.clamp(vo,0,1);let mo=ii===Se,Xo=ii===qt-1;h>0&&(mo?Yi+=Gn*H:Xo&&(Yi-=Gn*H));let Go=t(Yi),yn=n(Yi),Ei=pe*yn,Nn;R&&(Nn=(mi.geodeticLatitudeToMercatorAngle(Yi)-ve)*Ne);for(let Vo=mt;Vo<Ut;++Vo){let Ho=Vo;Ho<0&&(Ho=0),Ho>=u&&(Ho=u-1);let Xa=qn*(u*G)+Ho*G,Ui;if(O===1)Ui=c[Xa];else{Ui=0;let Ja;if(z)for(Ja=0;Ja<O;++Ja)Ui=Ui*k+c[Xa+Ja];else for(Ja=O-1;Ja>=0;--Ja)Ui=Ui*k+c[Xa+Ja]}Ui=Ui*B+M,re=Math.max(re,Ui),ge=Math.min(ge,Ui);let Eo=y.west+Y*Ho;A?Eo=s(Eo):Eo=Eo*_;let ps=(Eo-E)/(x-E);ps=D.clamp(ps,0,1);let da=qn*u+Ho;if(h>0){let Ja=Vo===mt,Za=Vo===Ut-1,on=mo||Xo||Ja||Za;if((mo||Xo)&&(Ja||Za))continue;on&&(Ui-=h,Ja?(da=Fe+(f-qn-1),Eo-=Gn*F):Xo?da=Fe+f+(u-Ho-1):Za?(da=Fe+f+u+qn,Eo+=Gn*F):mo&&(da=Fe+f+u+f+Ho))}let wr=Go*t(Eo),As=Go*n(Eo),Ru=K*wr,Mu=Z*As,Kd=1/i(Ru*wr+Mu*As+Ei*yn),Fs=Ru*Kd,Pg=Mu*Kd,dm=Ei*Kd,pr=new d;pr.x=Fs+wr*Ui,pr.y=Pg+As*Ui,pr.z=dm+yn*Ui,P.multiplyByPoint(Ce,pr,DZ),d.minimumByComponent(DZ,Le,Le),d.maximumByComponent(DZ,Oe,Oe),nt=Math.min(nt,Ui),je[da]=pr,ft[da]=new Q(ps,vo),st[da]=Ui,R&&(St[da]=Nn),b&&(be[da]=m.geodeticSurfaceNormal(pr))}}let Xe=le.fromPoints(je),ro;l(C)&&(ro=en.fromRectangle(C,ge,re,m));let Vt;v&&(Vt=new dp(m).computeHorizonCullingPointPossiblyUnderEllipsoid(w,je,ge));let Do=new Wf(Le,Oe,w),ji=new Tr(w,Do,nt,re,ye,!1,R,b,N,L),Mi=new Float32Array(rt*ji.stride),zo=0;for(let ii=0;ii<rt;++ii)zo=ji.encode(Mi,zo,je[ii],ft[ii],st[ii],void 0,St[ii],be[ii]);return{vertices:Mi,maximumHeight:re,minimumHeight:ge,encoding:ji,boundingSphere3D:Xe,orientedBoundingBox:ro,occludeePointInScaledSpace:Vt}};var PP=Np;function Jy(){de.throwInstantiationError()}Object.defineProperties(Jy.prototype,{credits:{get:de.throwInstantiationError},waterMask:{get:de.throwInstantiationError}});Jy.prototype.interpolateHeight=de.throwInstantiationError;Jy.prototype.isChildAvailable=de.throwInstantiationError;Jy.prototype.createMesh=de.throwInstantiationError;Jy.prototype.upsample=de.throwInstantiationError;Jy.prototype.wasCreatedByUpsampling=de.throwInstantiationError;Jy.maximumAsynchronousTasks=5;var _f=Jy;var Xmt=3;function RZ(e,t,n){this._vertices=e,this._indices=t,this._encoding=n,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new PZ}var Jmt=new Zn("incrementallyBuildTerrainPicker");Object.defineProperties(RZ.prototype,{needsRebuild:{get:function(){return this._needsRebuild},set:function(e){this._needsRebuild=e}}});function PZ(){this.x=0,this.y=0,this.level=0,this.aabb=K0e(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}PZ.prototype.addChild=function(e){let t=new PZ;t.x=this.x*2+(e&1),t.y=this.y*2+(e>>1&1),t.level=this.level+1,t.aabb=K0e(t.x,t.y,t.level),this.children[e]=t};var Zmt=new In,gV=[new d,new d,new d];RZ.prototype.rayIntersect=function(e,t,n,i,o){this._needsRebuild&&$mt(this,t);let r=this._inverseTransform,a=Zmt;a.origin=P.multiplyByPoint(r,e.origin,a.origin),a.direction=P.multiplyByPointAsVector(r,e.direction,a.direction);let s=[];return X0e(this._rootNode,a,s),opt(this,s,e,n,i,o)};function $mt(e,t){P.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var ept=new d,tpt=new d;function K0e(e,t,n){let i=1/Math.pow(2,n),o=d.fromElements(e*i-.5,t*i-.5,-.5,ept),r=d.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,tpt);return Wf.fromCorners(o,r)}function npt(e,t,n,i,o){d.pack(n[0],e,9*o),d.pack(n[1],e,9*o+3),d.pack(n[2],e,9*o+6),t[o]=i}var ipt=new ea;function X0e(e,t,n){let i=di.rayAxisAlignedBoundingBox(t,e.aabb,ipt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new ea(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)X0e(e.children[r],t,n)}function opt(e,t,n,i,o,r){let a=t.sort(function(c,u){return c.interval.start-u.interval.start}),s=Number.MAX_VALUE;for(let c=0;c<a.length;c++){let u=a[c],f=rpt(e,n,u.node,i,o,r);if(s=Math.min(f,s),s!==Number.MAX_VALUE)break}if(s!==Number.MAX_VALUE)return In.getPoint(n,s)}function rpt(e,t,n,i,o,r){let a=Number.MAX_VALUE,s=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=Xmt)&&!n.buildingChildren,A,m;p&&(A=new Float64Array(f*9),m=new Uint32Array(f));for(let _=0;_<f;_++){let y=n.intersectingTriangles[_],C=vZ(s,o,r,t,u,c[3*y],gV[0]),E=vZ(s,o,r,t,u,c[3*y+1],gV[1]),I=vZ(s,o,r,t,u,c[3*y+2],gV[2]),x=di.rayTriangleParametric(t,C,E,I,i);l(x)&&x<a&&x>=0&&(a=x),p&&npt(A,m,gV,y,_)}if(p){for(let _=0;_<4;_++)n.addChild(_);spt(e._inverseTransform,n,m,A)}return a}var apt=new me;function vZ(e,t,n,i,o,r,a){let s=e.getExaggeratedPosition(o,r,a);if(t===oe.SCENE3D)return s;let u=n.ellipsoid.cartesianToCartographic(s,apt);s=n.project(u,a),s=d.fromElements(s.z,s.x,s.y,a);let f=D.TWO_PI*n.ellipsoid.maximumRadius,h=Math.round((i.origin.y-s.y)/f);return s.y+=h*f,s}async function spt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);P.pack(e,o,0);let r=new Float64Array(24);for(let f=0;f<4;f++)d.pack(t.children[f].aabb.minimum,r,f*6),d.pack(t.children[f].aabb.maximum,r,f*6+3);let a={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},s=[r.buffer,o.buffer,n.buffer,i.buffer],c=Jmt.scheduleTask(a,s);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,h)=>{l(t.children[h])&&(t.children[h].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var _V=RZ;function RP(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m,_,y){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=a,this.rectangle=s,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=h,this.encoding=p,this.westIndicesSouthToNorth=A,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=_,this.northIndicesWestToEast=y,this._transform=new P,this._lastPickSceneMode=void 0,this._terrainPicker=new _V(t,n,p)}RP.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===oe.SCENE3D?cpt(this,this._transform):ppt(this,t,this._transform))};function cpt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=To.getHeight(e.minimumHeight,n,i),r=To.getHeight(e.maximumHeight,n,i),a=en.fromRectangle(e.rectangle,o,r,te.default,e.orientedBoundingBox);return en.computeTransformation(a,t),P.getScale(t,MZ).z<=D.EPSILON16&&(MZ.z=1,P.setScale(t,MZ,t)),t}var lpt=new d,upt=new d,fpt=new me,dpt=new me,hpt=new d,mpt=new d,MZ=new d;function ppt(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=To.getHeight(e.minimumHeight,i,o),a=To.getHeight(e.maximumHeight,i,o),s=t.project(me.fromRadians(e.rectangle.west,e.rectangle.south,0,fpt),lpt),c=t.project(me.fromRadians(e.rectangle.east,e.rectangle.north,0,dpt),upt),u=a-r,f=d.fromElements(c.x-s.x,c.y-s.y,u>0?u:1,hpt),h=d.fromElements(s.x+f.x*.5,s.y+f.y*.5,r+f.z*.5,mpt);return P.fromTranslation(h,n),P.setScale(n,f,n),P.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}RP.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};RP.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};RP.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var bc=RP;function dg(e){e=e??V.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??Jh.NONE;let t=PP.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===Jh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(dg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var J0e="createVerticesFromHeightmap",Apt=new Zn(J0e),gpt=new Zn(J0e,_f.maximumAsynchronousTasks);dg.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=c.cartographicToCartesian(ce.center(f)),p=this._structure,m=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let y=(s?gpt:Apt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof qi,exaggeration:r,exaggerationRelativeHeight:a,encoding:this._encoding});if(!l(y))return;let C=this;return Promise.resolve(y).then(function(E){let I;C._skirtHeight>0?I=Yo.getRegularGridAndSkirtIndicesAndEdgeIndices(E.gridWidth,E.gridHeight):I=Yo.getRegularGridIndicesAndEdgeIndices(E.gridWidth,E.gridHeight);let x=E.gridWidth*E.gridHeight;return C._mesh=new bc(h,new Float32Array(E.vertices),I.indices,I.indexCountWithoutSkirts,x,E.minimumHeight,E.maximumHeight,f,le.clone(E.boundingSphere3D),d.clone(E.occludeePointInScaledSpace),E.numberOfAttributes,en.clone(E.orientedBoundingBox),Tr.clone(E.encoding),I.westIndicesSouthToNorth,I.southIndicesEastToWest,I.eastIndicesNorthToSouth,I.northIndicesWestToEast),C._buffer=void 0,C._mesh})};dg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=s.cartographicToCartesian(ce.center(u)),h=this._structure,A=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(s,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(A*4,1e3);let m=PP.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:s,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof qi,exaggeration:r,exaggerationRelativeHeight:a});this._buffer=void 0;let _;this._skirtHeight>0?_=Yo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):_=Yo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let y=m.gridWidth*m.gridHeight;return this._mesh=new bc(f,m.vertices,_.indices,_.indexCountWithoutSkirts,y,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),this._mesh};dg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,a=r.stride,s=r.elementsPerHeight,c=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=l(this._mesh),A=this._encoding===Jh.LERC;if(!p&&A)return;let _;if(p){let y=this._mesh.vertices,C=this._mesh.encoding;_=Z0e(y,C,f,h,e,i,o,t,n)}else _=_pt(this._buffer,s,c,a,u,e,i,o,t,n),_=_*h+f;return _};dg.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(s))return;let c=this._width,u=this._height,f=this._structure,h=f.stride,p=new this._bufferType(c*u*h),A=s.vertices,m=s.encoding,_=e.tileXYToRectangle(t,n,i),y=e.tileXYToRectangle(o,r,a),C=f.heightOffset,E=f.heightScale,I=f.elementsPerHeight,x=f.elementMultiplier,S=f.isBigEndian,w=Math.pow(x,I-1);for(let v=0;v<u;++v){let R=D.lerp(y.north,y.south,v/(u-1));for(let N=0;N<c;++N){let L=D.lerp(y.west,y.east,N/(c-1)),g=Z0e(A,m,C,E,_,c,u,L,R);g=g<f.lowestEncodedHeight?f.lowestEncodedHeight:g,g=g>f.highestEncodedHeight?f.highestEncodedHeight:g,ypt(p,I,x,w,h,S,v*c+N,g)}}return Promise.resolve(new dg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};dg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};dg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function _pt(e,t,n,i,o,r,a,s,c,u){let f=(c-r.west)*(a-1)/(r.east-r.west),h=(u-r.south)*(s-1)/(r.north-r.south),p=f|0,A=p+1;A>=a&&(A=a-1,p=a-2);let m=h|0,_=m+1;_>=s&&(_=s-1,m=s-2);let y=f-p,C=h-m;m=s-1-m,_=s-1-_;let E=yV(e,t,n,i,o,m*a+p),I=yV(e,t,n,i,o,m*a+A),x=yV(e,t,n,i,o,_*a+p),S=yV(e,t,n,i,o,_*a+A);return $0e(y,C,E,I,x,S)}function Z0e(e,t,n,i,o,r,a,s,c){let u=(s-o.west)*(r-1)/(o.east-o.west),f=(c-o.south)*(a-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let A=f|0,m=A+1;m>=a&&(m=a-1,A=a-2);let _=u-h,y=f-A;A=a-1-A,m=a-1-m;let C=(t.decodeHeight(e,A*r+h)-n)/i,E=(t.decodeHeight(e,A*r+p)-n)/i,I=(t.decodeHeight(e,m*r+h)-n)/i,x=(t.decodeHeight(e,m*r+p)-n)/i;return $0e(_,y,C,E,I,x)}function $0e(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function yV(e,t,n,i,o,r){r*=i;let a=0,s;if(o)for(s=0;s<t;++s)a=a*n+e[r+s];else for(s=t-1;s>=0;--s)a=a*n+e[r+s];return a}function ypt(e,t,n,i,o,r,a,s){a*=o;let c;if(r)for(c=0;c<t-1;++c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;else for(c=t-1;c>0;--c)e[a+c]=s/i|0,s-=e[a+c]*i,i/=n;e[a+c]=s}var Xc=dg;function lS(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var R0=new ce;function Cpt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let a=i[r];if(a.x===t&&a.y===n&&a.level===e)return!0}return!1}lS.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,a=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let A=t;A<=i;++A)Cpt(e,A,p,a)||a.push(new sS(r,void 0,0,A,p));r.tileXYToRectangle(t,n,e,R0);let s=R0.west,c=R0.north;r.tileXYToRectangle(i,o,e,R0);let u=R0.east,f=R0.south,h=new Tpt(e,s,f,u,c);for(let p=0;p<a.length;++p){let A=a[p];NZ(A.extent,h)&&Spt(this._maximumLevel,A,h)}};lS.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(cS(i.extent,e)){t=i;break}}return l(t)?MP(void 0,t,e):-1};var Ept=[],Ipt=[],bpt=new ce,xpt=new ce;lS.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Ept;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,bpt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,xpt))):t.push(e);let n=Ipt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)NP(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var eIe=new me;lS.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,R0);return ce.center(i,eIe),this.computeMaximumLevelAtPosition(eIe)>=e};lS.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 sS(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(sS.prototype,{nw:{get:function(){return this._nw||(this._nw=new sS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new sS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new sS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new sS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Tpt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function NZ(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 Spt(e,t,n){for(;t.level<e;)if(CV(t.nw.extent,n))t=t.nw;else if(CV(t.ne.extent,n))t=t.ne;else if(CV(t.sw.extent,n))t=t.sw;else if(CV(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=Io(t.rectangles,n.level,wpt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function wpt(e,t){return e.level-t}function CV(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function cS(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function MP(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&cS(t._nw.extent,n),a=t._ne&&cS(t._ne.extent,n),s=t._sw&&cS(t._sw.extent,n),c=t._se&&cS(t._se.extent,n);if(r+a+s+c>1){r&&(i=Math.max(i,MP(t,t._nw,n))),a&&(i=Math.max(i,MP(t,t._ne,n))),s&&(i=Math.max(i,MP(t,t._sw,n))),c&&(i=Math.max(i,MP(t,t._se,n)));break}else r?t=t._nw:a?t=t._ne:s?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let a=r.length-1;a>=0&&r[a].level>i;--a){let s=r[a];cS(s,n)&&(i=s.level)}t=t.parent}return i}function NP(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||NZ(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let a=r[i];e[a.level]||(e[a.level]=n),e[a.level]=Bpt(e[a.level],a)}NP(e,t._nw,n),NP(e,t._ne,n),NP(e,t._sw,n),NP(e,t._se,n)}function Bpt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];NZ(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var Lp=lS;var Dpt=15;function tIe(e){this.ellipsoid=e.ellipsoid??te.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}tIe.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 vpt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Et(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,a={ellipsoid:e.ellipsoid};if(o===4326)a.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ji(a);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),a.rectangleSouthwestInMeters=new Q(r.xmin,r.ymin),a.rectangleNortheastInMeters=new Q(r.xmax,r.ymax),e.tilingScheme=new za(a)}else throw new ue("Invalid spatial reference");let s=t.tileInfo;if(!l(s))throw new ue("tileInfo is required");e.width=s.rows+1,e.height=s.cols+1,e.encoding=s.format==="LERC"?Jh.LERC:Jh.NONE,e.lodCount=s.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new Lp(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new Lp(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Ppt(e,t,n){try{let i=await t.fetchJson();vpt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function Zy(e){e=e??V.EMPTY_OBJECT,this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new _e}Object.defineProperties(Zy.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});Zy.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new tIe(t);await Ppt(o,i);let r=new Zy(t);return o.build(r),r._resource=n,r};Zy.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,a=Promise.resolve(!0),s;if(r&&!l(LZ(this,n+1,e*2,t*2))){let h=nIe(this,n+1,e*2,t*2);a=h.promise,s=h.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(a))return;let u=this,f=this._tilesAvailable;return Promise.all([c,a]).then(function(h){return new Xc({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):Dpt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(l(s)&&s.state===yi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=yi.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function LZ(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}Zy.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Zy.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=LZ(this,n,e,t);if(l(i))return i;nIe(this,n,e,t)};Zy.prototype.loadTileDataAvailability=function(e,t,n){};function Rpt(e,t,n,i){let o=t-1,r=n-1,a=i[e.y*t+e.x],s=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new Q(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,A=h?u.y+1:u.y;if(!f){for(let m=e.y;m<A;++m)if(i[m*t+u.x]!==a){f=!0;break}f?(s.push(new Q(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===o?(c.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let _=e.x;_<=p;++_)if(i[m+_]!==a){h=!0;break}h?(s.push(new Q(e.x,u.y)),--u.y,c.endY=u.y):u.y===r?(c.endY=u.y,h=!0):++u.y}}return{endingIndices:s,range:c,value:a}}function Mpt(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let s=[new Q(0,0)];for(;s.length>0;){let c=s.pop(),u=Rpt(c,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(s=s.concat(f))}return r}function nIe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,a=Math.min(1<<t,128),s=`tilemap/${t}/${r}/${o}/${a}/${a}`,c=e._availableCache;if(l(c[s]))return c[s];let u=new Br({throttle:!1,throttleByServer:!0,type:es.TERRAIN}),h=e._resource.getDerivedResource({url:s,request:u}).fetchJson();return l(h)?(h=h.then(function(p){let A=Mpt(o,r,a,a,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+a,r+a);let m=e._tilesAvailable;for(let _=0;_<A.length;++_){let y=A[_];m.addAvailableTileRange(t,y.startX,y.startY,y.endX,y.endY)}return LZ(e,t,n,i)}),c[s]={promise:h,request:u},h=h.finally(function(p){return delete c[s],p}),{promise:h,request:u}):{}}var iIe=Zy;var oIe="https://dev.virtualearth.net/REST/v1/Locations";function OZ(e){e=e??V.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:oIe,queryParameters:n}),this._credit=new Et('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(OZ.prototype,{url:{get:function(){return oIe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});OZ.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,a=r[0],s=r[1],c=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(s,a,u,c)}})})};var rIe=OZ;function FZ(){}Object.defineProperties(FZ.prototype,{credit:{get:function(){}}});FZ.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let a=0;a<t.length;++a){let s=t[a].match(r);r.test(t[a])&&s.length===3&&(/^[ns]/i.test(s[2])?i=/^[n]/i.test(s[2])?+s[1]:-s[1]:/^[ew]/i.test(s[2])&&(n=/^[e]/i.test(s[2])?+s[1]:-s[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var aIe=FZ;var Npt=new ie,sIe=new d,uS=new d;function Lpt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],a=t[1];return function(s,c){l(c)||(c=new d);let u=(s-i)*o;return d.lerp(r,a,u,c)}}return function(i,o){l(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),a=(i-n[r])/(n[r+1]-n[r]),s=Npt;s.z=a,s.y=a*a,s.x=s.y*a,s.w=1;let c,u,f,h,p;return r===0?(c=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],c,sIe),d.multiplyByScalar(h,.5,h),p=P.multiplyByVector(IE.hermiteCoefficientMatrix,s,s)):r===t.length-2?(c=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],sIe),d.multiplyByScalar(f,.5,f),p=P.multiplyByVector(IE.hermiteCoefficientMatrix,s,s)):(c=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=P.multiplyByVector($y.catmullRomCoefficientMatrix,s,s)),o=d.multiplyByScalar(c,p.x,o),d.multiplyByScalar(u,p.y,uS),d.add(o,uS,o),d.multiplyByScalar(f,p.z,uS),d.add(o,uS,o),d.multiplyByScalar(h,p.w,uS),d.add(o,uS,o)}}var Opt=new d,Fpt=new d;function $y(e){e=e??V.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=Opt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=Fpt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=Lpt(this),this._lastTimeIndex=0}Object.defineProperties($y.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}}});$y.catmullRomCoefficientMatrix=new P(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);$y.prototype.findTimeInterval=So.prototype.findTimeInterval;$y.prototype.wrapTime=So.prototype.wrapTime;$y.prototype.clampTime=So.prototype.clampTime;$y.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var cIe=$y;var QZ={},Qpt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},kpt=new me,Upt=new d,zpt=new P,Gpt=new P,Vpt=new P,Hpt=new d,Wpt=new d,jpt=new d,Ypt=new d,qpt=new me,Kpt=new Q,LP=new d,Xpt=new Q,Jpt=new d,Zpt=new d,EV=function(e,t){return e-t};QZ.createMesh=async function(e){e=e??V.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:a,maximumHeight:s,skirtHeight:c}=e,f=t!==1,h=le.clone(e.boundingSphere,new le),p=en.clone(e.orientedBoundingBox,new en),A=d.clone(e.horizonOcclusionPoint,new d),m=te.clone(e.ellipsoid,new te),_=ce.clone(e.rectangle,new ce);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?y_.ready:Promise.resolve(void 0));let E=_.west,I=_.south,x=_.north,S=_.width,w=_.height,v=ce.center(_,kpt);v.height=.5*(a+s);let R=me.toCartesian(v,m,Upt),N=At.eastNorthUpToFixedFrame(R,m,zpt),L=P.inverseTransformation(N,Gpt),g=P.unpack(r.nodes[0].matrix,0,Vpt);g=P.multiply(so.Y_UP_TO_Z_UP,g,g);let b=PAt(r,i,Qpt),T=Yo.getSkirtVertexCount(b.edgeIndicesWest,b.edgeIndicesSouth,b.edgeIndicesEast,b.edgeIndicesNorth),B=b.positions,M=b.normals,O=b.indices,G=B.length/3,k=G+T,z=O.length,F=Yo.getSkirtIndexCountWithFilledCorners(T),H=k<=65535?Uint16Array:Uint32Array,Y=new H(z+F);Y.set(O);let $=new H(b.edgeIndicesWest),W=new H(b.edgeIndicesSouth),K=new H(b.edgeIndicesEast),Z=new H(b.edgeIndicesNorth),pe=new H($).sort(),ge=new H(W).sort(),re=new H(K).sort(),ye=new H(Z).sort(),Ce=mi.geodeticLatitudeToMercatorAngle(I),Ne=1/(mi.geodeticLatitudeToMercatorAngle(x)-Ce),Le=d.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Hpt),Oe=d.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Wpt),nt=new Tr(h.center,void 0,void 0,void 0,void 0,i,o,f,t,n),Fe=nt.stride,_t=new Float32Array(k*Fe),rt=0;for(let st=0;st<G;st++){let ft=d.unpack(B,st*3,jpt),St=P.multiplyByPoint(g,ft,Ypt),be=me.fromCartesian(St,m,qpt),{longitude:Se,latitude:qt,height:mt}=be,Ut=(Se-E)/S,Gn=(qt-I)/w;Ut=D.clamp(Ut,0,1),Gn=D.clamp(Gn,0,1),Io(pe,st,EV)>=0?Ut=0:Io(re,st,EV)>=0&&(Ut=1),Io(ge,st,EV)>=0?Gn=0:Io(ye,st,EV)>=0&&(Gn=1);let Xe=Q.fromElements(Ut,Gn,Kpt),ro;if(i){let Mi=d.unpack(M,st*3,LP);Mi=P.multiplyByPointAsVector(g,Mi,LP),Mi=d.normalize(Mi,LP),ro=tn.octEncode(Mi,Xpt)}let Vt;o&&(Vt=(mi.geodeticLatitudeToMercatorAngle(qt)-Ce)*Ne);let Do;f&&(Do=m.geodeticSurfaceNormal(St,Jpt)),rt=nt.encode(_t,rt,St,Xe,mt,ro,Vt,Do);let ji=P.multiplyByPoint(L,St,Zpt);Le=d.minimumByComponent(ji,Le,Le),Oe=d.maximumByComponent(ji,Oe,Oe)}let je=new bc(d.clone(nt.center,new d),_t,Y,z,G,a,s,_,le.clone(h,new le),d.clone(A,new d),Fe,en.clone(p,new en),nt,$,W,K,Z);return pIe(je,_,m,Le,Oe,N,L,c),Promise.resolve(je)};var $pt=new Q,eAt=new Q,tAt=new Array(6),nAt=new Q,iAt=new Q,oAt=new Q,rAt=new d,aAt=new d,sAt=new d,cAt=new me,lAt=new d,uAt=new me,fAt=new me,lIe=new d,dAt=new d,hAt=new d,mAt=new d,pAt=new d,AAt=new d,gAt=new d,_At=new d,yAt=new P,CAt=new P,uIe=new Q,EAt=new Q,IAt=new d,bAt=new le,xAt=new en,TAt=new Wf,fIe=new d,dIe=new Q,SAt=new Q,hIe=new d,wAt=new d;function BAt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let A=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(A.buffer,A.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let a=e.buffers[r.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(o*4);y_.decodeVertexBuffer(new Uint8Array(f.buffer),o,c,s);let h=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let A=0;A<o;A++)p[A*3+0]=f[A*4+0]/h,p[A*3+1]=f[A*4+1]/h,p[A*3+2]=f[A*4+2]/h;return p}function DAt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let h=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(h.buffer,h.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let a=e.buffers[r.buffer].extras._pipeline.source,s=new Uint8Array(a.buffer,a.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,u=new Int8Array(o*c);y_.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,s);let f=new Float32Array(o*3);for(let h=0;h<o;h++){let p=Math.max(u[h*4+0]/127,-1),A=Math.max(u[h*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(A));if(m<0){let y=p,C=A;p=(1-Math.abs(C))*D.signNotZero(y),A=(1-Math.abs(y))*D.signNotZero(C)}let _=LP;_.x=p,_.y=A,_.z=m,_=d.normalize(_,LP),f[h*3+0]=_.x,f[h*3+1]=_.y,f[h*3+2]=_.z}return f}function vAt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===j.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new r(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let s=e.buffers[a.buffer].extras._pipeline.source,c=new Uint8Array(s.buffer,s.byteOffset+(a.byteOffset??0)+(n.byteOffset??0),a.byteLength),u=new r(o);return y_.decodeIndexBuffer(new Uint8Array(u.buffer),o,a.byteStride,c),u}function IV(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,a=i.componentType===j.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new a(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[s.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(s.byteOffset??0)+(i.byteOffset??0),s.byteLength),f=new a(r),h=s.byteStride;return y_.decodeIndexSequence(new Uint8Array(f.buffer),r,h,u),f}function PAt(e,t,n){return n.positions=BAt(e),n.normals=t?DAt(e):void 0,n.indices=vAt(e),n.edgeIndicesWest=IV(e,"left"),n.edgeIndicesSouth=IV(e,"bottom"),n.edgeIndicesEast=IV(e,"right"),n.edgeIndicesNorth=IV(e,"top"),n}QZ.upsampleMesh=function(e){e=e??V.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,a=e.parentIndexCountWithoutSkirts,s=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Tr.clone(e.parentEncoding,new Tr),h=f.hasVertexNormals,p=f.hasWebMercatorT,A=f.exaggeration,m=f.exaggerationRelativeHeight,y=A!==1,C=ce.clone(e.rectangle,new ce),E=te.clone(e.ellipsoid),I=[],x=[],S=[],w=[],v=[],R=[],N=[],L=[];HAt(t,n,a,s,c,u,f,w,v,R,N,L,I,S,x);let g=ce.center(C,cAt);g.height=.5*(i+o);let b=me.toCartesian(g,E,lAt),T=I.length,B=new Tr(b,void 0,void 0,void 0,void 0,h,p,y,A,m),M=B.stride,O=Yo.getSkirtVertexCount(v,R,N,L),G=T+O,k=w.length,z=Yo.getSkirtIndexCountWithFilledCorners(O),F=k+z,H=G<=65535?Uint16Array:Uint32Array,Y=new H(F);Y.set(w);let $=new H(v),W=new H(R),K=new H(N),Z=new H(L),pe=new Float32Array(G*M),ge=0,re=At.eastNorthUpToFixedFrame(b,E,yAt),ye=P.inverseTransformation(re,CAt),Ce=C.west,ve=C.east,Ne=C.south,Le=C.north,Oe=mi.geodeticLatitudeToMercatorAngle(Ne),Fe=1/(mi.geodeticLatitudeToMercatorAngle(Le)-Oe),_t=Number.POSITIVE_INFINITY,rt=Number.NEGATIVE_INFINITY,je=d.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,gAt),st=d.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,_At);for(let mt=0;mt<T;mt++){let Ut=I[mt],Gn=s[Ut*3+0],Xe=s[Ut*3+1],ro=s[Ut*3+2],Vt=EAt;Vt.x=x[mt*2+0],Vt.y=x[mt*2+1];let Do=Vt.x,ji=Vt.y,Mi=S[mt*2+0],zo=S[mt*2+1],ii=1-Mi-zo,qn=f.decodeHeight(u,Gn),Yi=f.decodeHeight(u,Xe),vo=f.decodeHeight(u,ro),mo=qn*Mi+Yi*zo+vo*ii;_t=Math.min(mo,_t),rt=Math.max(mo,rt);let Xo=D.lerp(Ce,ve,Do),Go=D.lerp(Ne,Le,ji),yn=me.fromRadians(Xo,Go,mo,fAt),Ei=me.toCartesian(yn,E,dAt),Nn=P.multiplyByPoint(ye,Ei,mAt);je=d.minimumByComponent(Nn,je,je),st=d.maximumByComponent(Nn,st,st);let Vo;if(h){let Ui=f.decodeNormal(u,Gn,rAt),Eo=f.decodeNormal(u,Xe,aAt),ps=f.decodeNormal(u,ro,sAt),da=d.fromElements(Ui.x*Mi+Eo.x*zo+ps.x*ii,Ui.y*Mi+Eo.y*zo+ps.y*ii,Ui.z*Mi+Eo.z*zo+ps.z*ii,fIe);da=d.normalize(da,fIe),Vo=tn.octEncode(da,SAt)}let Ho;p&&(Ho=(mi.geodeticLatitudeToMercatorAngle(Go)-Oe)*Fe);let Xa;y&&(Xa=E.geodeticSurfaceNormal(Ei,wAt)),ge=B.encode(pe,ge,Ei,Vt,mo,Vo,Ho,Xa)}let ft=en.fromRectangle(C,_t,rt,E,xAt),St=le.fromVertices(pe,B.center,M,bAt),Se=new dp(E).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(B.center,pe,M,B.center,_t,IAt),qt=new bc(d.clone(B.center,new d),pe,Y,k,T,_t,rt,C,le.clone(St),d.clone(Se),M,en.clone(ft),B,$,W,K,Z);return pIe(qt,C,E,je,st,re,ye,r),qt};function pIe(e,t,n,i,o,r,a,s){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:h,hasWebMercatorT:p,exaggeration:A,exaggerationRelativeHeight:m}=c,y=A!==1,C=e.vertexCountWithoutSkirts,E=C*u,I=f.length/u,x=I-C,S=e.indices,w=e.indexCountWithoutSkirts,v=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,N=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;Yo.addSkirtIndicesWithFilledCorners(v,R,N,L,C,S,w);let g=0,b=g+v.length,T=b+R.length,B=T+N.length,M=[v,R,N,L],O=[g,b,T,B],G=[-1,0,1,0],k=[0,-1,0,1],z=d.clone(i,pAt),F=d.clone(o,AAt),H=e.maximumHeight,Y=e.minimumHeight-s;for(let K=0;K<x;K++){let Z=0;for(Z=0;Z<3&&!(K<O[Z+1]);Z++);let pe=M[Z][K-O[Z]],ge=c.decodeTextureCoordinates(f,pe,uIe),re=1e-4,ye=ge.x+G[Z]*re,Ce=ge.y+k[Z]*re,ve=D.lerp(t.west,t.east,ye),Ne=D.clamp(D.lerp(t.south,t.north,Ce),-D.PI_OVER_TWO,+D.PI_OVER_TWO),Oe=c.decodeHeight(f,pe)-s,nt=me.fromRadians(ve,Ne,Oe,uAt),Fe=me.toCartesian(nt,n,lIe),_t;h&&(_t=c.getOctEncodedNormal(f,pe,dIe));let rt;p&&(rt=c.decodeWebMercatorT(f,pe));let je;y&&(je=n.geodeticSurfaceNormal(Fe,hIe)),E=c.encode(f,E,Fe,ge,Oe,_t,rt,je);let st=P.multiplyByPoint(a,Fe,hAt);d.minimumByComponent(st,z,z),d.maximumByComponent(st,F,F)}let $=Wf.fromCorners(z,F,TAt),W=new Tr(c.center,$,Y,H,r,c.hasVertexNormals,c.hasWebMercatorT,y,A,m);if(c.quantization!==W.quantization){let K=W,Z=K.stride,pe=new Float32Array(I*Z),ge=0;for(let re=0;re<I;re++)ge=K.encode(pe,ge,c.decodePosition(f,re,lIe),c.decodeTextureCoordinates(f,re,uIe),c.decodeHeight(f,re),c.hasVertexNormals?c.getOctEncodedNormal(f,re,dIe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,re):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,re,hIe):void 0);e.vertices=pe,e.stride=Z,e.encoding=K}return e}var kZ=0,RAt=1,UZ=2,zZ=3,MAt=4,NAt=new d,LAt=[new d,new d,new d,new d,new d,new d],OAt=[new Q,new Q,new Q,new Q,new Q,new Q],FAt=[new d,new d,new d,new d,new d,new d],QAt=[new Q,new Q,new Q,new Q,new Q,new Q];function mIe(e,t,n,i){switch(n){case kZ:return D.sign(i.x-e.x);case UZ:return D.sign(t.x-i.x);case zZ:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function kAt(e,t,n,i,o,r){let a,s,c;switch(n){case kZ:a=(e.x-i.x)/(o.x-i.x),s=e.x,c=i.y+(o.y-i.y)*a;break;case UZ:a=(t.x-i.x)/(o.x-i.x),s=t.x,c=i.y+(o.y-i.y)*a;break;case zZ:a=(e.y-i.y)/(o.y-i.y),s=i.x+(o.x-i.x)*a,c=e.y;break;default:a=(t.y-i.y)/(o.y-i.y),s=i.x+(o.x-i.x)*a,c=t.y;break}return d.fromElements(s,c,a,r)}var UAt={length:0,coordinates:[new Q,new Q,new Q,new Q,new Q,new Q],barycentricCoordinates:[new d,new d,new d,new d,new d,new d]};function zAt(e,t,n,i,o,r,a,s){let c=0,u=OAt,f=LAt,h=3,p=QAt;Q.clone(o,p[0]),Q.clone(r,p[1]),Q.clone(a,p[2]);let A=FAt;d.fromElements(1,0,0,A[0]),d.fromElements(0,1,0,A[1]),d.fromElements(0,0,1,A[2]);for(let m=0;m<t;m++){let _=(e+m)%MAt,y=u,C=f;u=p,f=A,c=h,p=y,A=C,h=0;let E=c-1,I=u[E],x=f[E],S=mIe(n,i,_,I);for(let w=0;w<c;w++){let v=u[w],R=f[w],N=mIe(n,i,_,v);if(S*N===-1){let L=kAt(n,i,_,I,v,NAt),{x:g,y:b,z:T}=L,B=1-T,M=x.x*B+R.x*T,O=x.y*B+R.y*T,G=x.z*B+R.z*T;Q.fromElements(g,b,p[h]),d.fromElements(M,O,G,A[h]),h++}N>=0&&(Q.clone(v,p[h]),d.clone(R,A[h]),h++),E=w,I=v,x=R,S=N}if(h===0)break}s.length=h;for(let m=0;m<h;m++)Q.clone(p[m],s.coordinates[m]),d.clone(A[m],s.barycentricCoordinates[m]);return s}function GAt(e,t,n,i,o,r,a,s){return zAt(e?t?zZ:kZ:t?UZ:RAt,2,n,i,o,r,a,s)}var VAt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function HAt(e,t,n,i,o,r,a,s,c,u,f,h,p,A,m){let _={},y=e?.5:0,C=e?1:.5,E=t?.5:0,I=t?1:.5,x=$pt;x.x=y,x.y=E;let S=eAt;S.x=C,S.y=I;let w=0;for(let v=0;v<n;v+=3){let R=i[v+0],N=i[v+1],L=i[v+2],g=a.decodeTextureCoordinates(r,R,nAt),b=a.decodeTextureCoordinates(r,N,iAt),T=a.decodeTextureCoordinates(r,L,oAt),B=GAt(e,t,x,S,g,b,T,UAt),M=B.length;if(M<3)continue;let O=tAt;for(let F=0;F<M;F++){let H=B.barycentricCoordinates[F],Y=H.x,$=H.y,W=H.z,K=Math.ceil(Y)|Math.ceil($)<<1|Math.ceil(W)<<2,Z=VAt[K],pe,ge=!1;if(Z.length===1){let re=Z[0],Ce=i[v+re];pe=_[Ce],pe===void 0&&(ge=!0,pe=w++,_[Ce]=pe)}else if(Z.length===2){let re=Z[0],ye=Z[1],Ce=i[v+re],ve=i[v+ye],Ne=B.barycentricCoordinates[(F+M-1)%M],Le=Math.ceil(Ne.x)|Math.ceil(Ne.y)<<1|Math.ceil(Ne.z)<<2,Oe=K===Le,nt=Math.min(Ce,ve),Fe=Math.max(Ce,ve),_t=o+2*(nt*o+Fe),rt=_t+0,je=_t+1,st=_[rt],ft=_[je],St=!Oe==(st===void 0||ft===void 0);if(pe=St?st:ft,pe===void 0){ge=!0,pe=w++;let be=St?rt:je;_[be]=pe}}else ge=!0,pe=w++;if(O[F]=pe,ge){let re=v/3;p.push(re);let ye=B.coordinates[F],Ce=(ye.x-y)/(C-y),ve=(ye.y-E)/(I-E);m.push(Ce,ve),A.push(Y,$),Ce===0?c.push(pe):Ce===1&&f.push(pe),ve===0?u.push(pe):ve===1&&h.push(pe)}}let G=O[0],k=O[1],z=O[2];s.push(G,k,z);for(let F=3;F<M;F++)k=z,z=O[F],s.push(G,k,z)}c.sort(function(v,R){return m[v*2+1]-m[R*2+1]}),u.sort(function(v,R){return m[R*2+0]-m[v*2+0]}),f.sort(function(v,R){return m[R*2+1]-m[v*2+1]}),h.sort(function(v,R){return m[v*2+0]-m[R*2+0]})}var OP=QZ;var bV={};bV.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let a,s,c;t?(a=n<e,s=i<e,c=o<e):(a=n>e,s=i>e,c=o>e);let u=a+s+c,f,h,p,A,m,_;return u===1?a?(f=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):s?(p=(e-i)/(o-i),A=(e-i)/(n-i),r.push(2),r.push(0),A!==1&&(r.push(-1),r.push(1),r.push(0),r.push(A)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(m=(e-o)/(n-o),_=(e-o)/(i-o),r.push(0),r.push(1),_!==1&&(r.push(-1),r.push(2),r.push(1),r.push(_)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!a&&n!==e?(A=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(A),r.push(-1),r.push(2),r.push(0),r.push(m)):!s&&i!==e?(_=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(_),r.push(-1),r.push(0),r.push(1),r.push(f)):!c&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};bV.computeBarycentricCoordinates=function(e,t,n,i,o,r,a,s,c){let u=n-a,f=a-o,h=r-s,p=i-s,A=1/(h*u+f*p),m=t-s,_=e-a,y=(h*_+f*m)*A,C=(-p*_+u*m)*A,E=1-y-C;return l(c)?(c.x=y,c.y=C,c.z=E,c):new d(y,C,E)};bV.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,a,s,c){let u=(a-o)*(t-r)-(s-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(s-r)*(n-e)-(a-o)*(i-t);if(h===0)return;let p=u/h,A=f/h;if(p>=0&&p<=1&&A>=0&&A<=1)return l(c)||(c=new Q),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var Op=bV;function mg(e){e=e??V.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=le.clone(e.boundingSphere,new le),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=d.clone(e.horizonOcclusionPoint,new d),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(mg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});mg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:gIe(i,e,t,n)};mg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};var AIe="createVerticesFromCesium3DTilesTerrain",WAt=new Zn(AIe),jAt=new Zn(AIe,_f.maximumAsynchronousTasks);mg.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let n=e.throttle??!0?jAt:WAt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,a=e.y,s=e.level,c=i.tileXYToRectangle(r,a,s,new ce),u=this._gltf,f=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let h=this;return Promise.resolve(f).then(function(p){let A=p,m=Tr.clone(A.encoding,new Tr),_=new Float32Array(A.verticesBuffer),y=_.length/m.stride,C=A.vertexCountWithoutSkirts,E=y<=65535?Uint16Array:Uint32Array,I=new E(A.indicesBuffer),x=new E(A.westIndicesBuffer),S=new E(A.eastIndicesBuffer),w=new E(A.southIndicesBuffer),v=new E(A.northIndicesBuffer),R=A.indexCountWithoutSkirts,N=h._minimumHeight,L=h._maximumHeight,g=d.clone(m.center,new d),b=le.clone(h._boundingSphere,new le),T=d.clone(h._horizonOcclusionPoint,new d),B=en.clone(h._orientedBoundingBox,new en),M=new bc(g,_,I,R,C,N,L,c,b,T,m.stride,B,m,x,w,S,v);return h._mesh=M,Promise.resolve(M)})};mg.prototype._createMeshSync=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,a=t.tileXYToRectangle(i,o,r,new ce),s=OP.createMesh({ellipsoid:n,rectangle:a,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(s).then(function(u){return c._mesh=u,Promise.resolve(u)})};mg.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;return s===void 0?void 0:xV(!1,s,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};mg.prototype._upsampleSync=function(e,t,n,i,o,r,a){let s=this._mesh;return s===void 0?void 0:xV(!0,s,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};mg.prototype.wasCreatedByUpsampling=function(){return!1};function hg(e){e=e??V.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}hg.prototype.createMesh=function(e){return e=e??V.EMPTY_OBJECT,Promise.resolve(this._mesh)};hg.prototype.upsample=function(e,t,n,i,o,r,a){return xV(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};hg.prototype._upsampleSync=function(e,t,n,i,o,r,a){return xV(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,a)};hg.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return gIe(i,e,t,n)};hg.prototype.wasCreatedByUpsampling=function(){return!0};hg.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(hg.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var YAt=new Zn("upsampleVerticesFromCesium3DTilesTerrain",_f.maximumAsynchronousTasks);function xV(e,t,n,i,o,r,a,s,c,u,f){if(f-s>1)throw new de("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,A=r*2!==c,m=a*2===u,_=o.tileXYToRectangle(c,u,f,new ce),y=o.ellipsoid,C={isEastChild:A,isNorthChild:m,rectangle:_,ellipsoid:y,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let I=OP.upsampleMesh(C),x=new hg({terrainMesh:I,skirtHeight:p,credits:i});return Promise.resolve(x)}let E=YAt.scheduleTask(C);if(E!==void 0)return E.then(function(I){let x=Tr.clone(I.encoding,new Tr),S=x.stride,w=new Float32Array(I.verticesBuffer),v=w.length/S,R=I.vertexCountWithoutSkirts,N=v<=65535?Uint16Array:Uint32Array,L=new N(I.indicesBuffer),g=new N(I.westIndicesBuffer),b=new N(I.eastIndicesBuffer),T=new N(I.southIndicesBuffer),B=new N(I.northIndicesBuffer),M=I.indexCountWithoutSkirts,O=I.minimumHeight,G=I.maximumHeight,k=d.clone(x.center,new d),z=le.clone(I.boundingSphere,new le),F=d.clone(I.horizonOcclusionPoint,new d),H=en.clone(I.orientedBoundingBox,new en),Y=new bc(k,w,L,M,R,O,G,_,z,F,S,H,x,g,T,b,B),$=new hg({terrainMesh:Y,skirtHeight:p,credits:i});return Promise.resolve($)})}var qAt=new Q,KAt=new Q,XAt=new Q,JAt=new d;function gIe(e,t,n,i){let o=D.clamp((n-t.west)/t.width,0,1),r=D.clamp((i-t.south)/t.height,0,1),{vertices:a,encoding:s,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],h=c[u+1],p=c[u+2],A=s.decodeTextureCoordinates(a,f,qAt),m=s.decodeTextureCoordinates(a,h,KAt),_=s.decodeTextureCoordinates(a,p,XAt),y=Math.min(A.x,m.x,_.x),C=Math.max(A.x,m.x,_.x),E=Math.min(A.y,m.y,_.y),I=Math.max(A.y,m.y,_.y);if(o>=y&&o<=C&&r>=E&&r<=I){let x=Op.computeBarycentricCoordinates(o,r,A.x,A.y,m.x,m.y,_.x,_.y,JAt);if(x.x>=0&&x.y>=0&&x.z>=0){let S=s.decodeHeight(a,f),w=s.decodeHeight(a,h),v=s.decodeHeight(a,p);return x.x*S+x.y*w+x.z*v}}}return 0}var TV=mg;function Zh(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Zh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Zh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Zh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Zh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Zh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)_Ie(this,t)};Zh.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,_Ie(this,i),t};Zh.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],yIe(this,0)),this._array[e-1]=void 0,t};Zh.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=GZ(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&yIe(this,n)}return this._array[e-1]=void 0,t};Zh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Zh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[GZ(this,1,2)?1:2]};function SV(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function FP(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function GZ(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function _Ie(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=FP(e,t,i);for(o!==n&&(SV(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(FP(e,t,r)!==o)break;SV(e,t,r),t=r}}function yIe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,a=o+1;if(a<n){FP(e,a,r)===i&&(r=a);let s=2*o+1,c=Math.max(Math.min(n-s,4),0);for(let u=0;u<c;u++){let f=s+u;FP(e,f,r)===i&&(r=f)}}if(FP(e,r,t)===i&&(SV(e,r,t),r!==o&&r!==a)){let s=Math.floor((r-1)/2);GZ(e,r,s)===i&&SV(e,r,s)}t=r}}var eC=Zh;function Fp(e){e=e??V.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new _e,this._ellipsoid=e.ellipsoid??te.WGS84,this._tilingScheme=new Ji({ellipsoid:this._ellipsoid}),this._subtreeCache=new M0({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}Fp.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new ue("Could not load tileset JSON",f)}let o=new Fp(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,a=r[0],s=r[1],c=i.schema,u=au.fromJson(c);return o._tileset0=new jA(n,a,u),o._tileset1=new jA(n,s,u),o};Fp.fromIonAssetId=async function(e,t){let n=await _a.fromAssetId(e);return Fp.fromUrl(n,t)};var ZAt=new Array(3);Fp.prototype.requestTileGeometry=async function(e,t,n,i){let o=EIe(n,e),r=o===0?this._tileset0:this._tileset1,a=IIe(r,n,e,t),s=a.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(o,s),f=this._requestWaterMask,h=this,p;if(u===void 0){let E=r.subtreeUriTemplate.getDerivedResource({templateValues:s.getTemplateValues()});p=r.baseResource.getDerivedResource({url:E.url}).fetchArrayBuffer().then(async function(x){if(u=c.find(o,s),u===void 0){let S=new Uint8Array(x);u=await T_.fromSubtreeJson(h._resource,void 0,S,r,s),c.addSubtree(o,u)}return u})}else p=Promise.resolve(u);let A=r.contentUriTemplates[0].getDerivedResource({templateValues:a.getTemplateValues()}),m=r.baseResource.getDerivedResource({url:A.url}),_=m.fetchArrayBuffer();if(_===void 0)return;let y=_.then(E=>Pb(new Uint8Array(E))),C=ZAt;C[0]=p,C[1]=y,C[2]=f?y.then(E=>$At(E,m)):void 0;try{let E=await Promise.all(C),I=E[0],x=E[1],S=E[2],w=I.getTileMetadataView(a),v=w.getPropertyBySemantic(mh.TILE_MINIMUM_HEIGHT),R=w.getPropertyBySemantic(mh.TILE_MAXIMUM_HEIGHT),N=w.getPropertyBySemantic(mh.TILE_BOUNDING_SPHERE),L=le.unpack(N,0,new le),g=w.getPropertyBySemantic(mh.TILE_HORIZON_OCCLUSION_POINT),T=h._tilingScheme.tileXYToRectangle(e,t,n,new ce),B=h._ellipsoid,M=en.fromRectangle(T,v,R,B,new en),O=h.getLevelMaximumGeometricError(n)*5,G=wV(r,I,a,0,0),k=wV(r,I,a,1,0),z=wV(r,I,a,0,1),F=wV(r,I,a,1,1),H=(G?1:0)|(k?2:0)|(z?4:0)|(F?8:0),Y=new TV({gltf:x,minimumHeight:v,maximumHeight:R,boundingSphere:L,orientedBoundingBox:M,horizonOcclusionPoint:g,skirtHeight:O,requestVertexNormals:h._requestVertexNormals,childTileMask:H,credits:h._tileCredits,waterMask:S});return Promise.resolve(Y)}catch(E){console.log(`Could not load subtree: ${o} ${s.level} ${s.x} ${s.y}: ${E}`),console.log(`Could not load tile: ${o} ${a.level} ${a.x} ${a.y}: ${E}`);return}};Fp.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=EIe(n,e),r=o===0?this._tileset0:this._tileset1,a=IIe(r,n,e,t),s=a.getSubtreeCoordinates(),c=i.find(o,s);if(c!==void 0)return c.tileIsAvailableAtCoordinates(a);if(s.isImplicitTilesetRoot())return a.isSubtreeRoot()?!0:void 0;let u=s.getParentSubtreeCoordinates(),f=i.find(o,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(s)?a.isSubtreeRoot()?!0:void 0:!1};function EIe(e,t){let n=1<<e;return t/n|0}function IIe(e,t,n,i){let o=1<<t,r=t,a=n%o,s=o-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new YA({subdivisionScheme:c,subtreeLevels:u,level:r,x:a,y:s})}async function $At(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new hE({schema:n.schema});await i.load();let o=i.schema,r,a;if(l(o.classes)){for(let A in o.classes)if(o.classes.hasOwnProperty(A)&&(r=o.classes[A],a=r.propertiesBySemantic.WATERMASK,l(a)))break}if(!l(a))return;let s=n.propertyTextures.find(A=>A.class===r.id);if(!l(s))throw new de(`Expected a propertyTexture with a class ${r.id}`);let c=s.properties[a.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,h=Pi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await h.load(),await E_({uint8Array:new Uint8Array(h.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function wV(e,t,n,i,o){let r=n.isBottomOfSubtree(),s=VZ(e,1,i,o),c=n.getDescendantCoordinates(s);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function VZ(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new YA({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}Fp.prototype.loadTileDataAvailability=function(e,t,n){};Fp.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(Fp.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function egt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function M0(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new eC({comparator:M0.comparator}),this._provider=e.provider}M0.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};M0.prototype.addSubtree=function(e,t){let n=new egt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};M0.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:a}=t;for(let s=0;s<n.length;s++){let c=i[s],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===o&&f.x===r&&f.y===a)return c.subtree}};M0.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,a=r.subtreeLevels,s=VZ(r,0,0,0),c=this.find(o,s);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,h=u.y,p=u.level,A=-D.PI,m=+D.PI,_=D.lerp(A,m,o/2),y=D.lerp(A,m,(o+1)/2),C=-D.PI*.5,E=+D.PI*.5,I=0,x=0,S=!0;for(;S;){let v=1/(1<<p),R=(y-_)*v,N=_+f*R,L=(E-C)*v,g=C+h*L;I=(t-N)/R,x=(n-g)/L;let b=CIe(r,u,I,x,a);if(c.childSubtreeIsAvailableAtCoordinates(b)){let T=this.find(o,b);if(T!==void 0)c=T,u=c.implicitCoordinates,f=u.x,h=u.y,p=u.level;else return b}else S=!1}let w;for(let v=0;v<a;v++){let R=CIe(r,u,I,x,v);if(c.tileIsAvailableAtCoordinates(R))w=R;else break}return w};function CIe(e,t,n,i,o){let r=1<<o,a=D.clamp(n*r|0,0,r-1),s=D.clamp(i*r|0,0,r-1),c=VZ(e,o,a,s);return t.getDescendantCoordinates(c)}M0.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var bIe=Fp;function tC(e){e=e??V.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(a,s){return i[a]-i[s]}function r(a,s){return n[a]-n[s]}this._westIndices=DV(e.westIndices,o,t),this._southIndices=DV(e.southIndices,r,t),this._eastIndices=DV(e.eastIndices,o,t),this._northIndices=DV(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(tC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var BV=[];function DV(e,t,n){BV.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)BV[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(BV.sort(t),Ue.createTypedArray(n,BV)):e}var xIe="createVerticesFromQuantizedTerrainMesh",tgt=new Zn(xIe),ngt=new Zn(xIe,_f.maximumAsynchronousTasks);tC.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(s?ngt:tgt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:a});if(!l(h))return;let p=this;return Promise.resolve(h).then(function(A){let m=p._quantizedVertices.length/3,_=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,y=Ue.createTypedArray(_,A.indices),C=new Float32Array(A.vertices),E=A.center,I=A.minimumHeight,x=A.maximumHeight,S=p._boundingSphere,w=p._orientedBoundingBox,v=d.clone(A.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=A.vertexStride,N=Tr.clone(A.encoding);return p._mesh=new bc(E,C,y,A.indexCountWithoutSkirts,m,I,x,u,S,v,R,w,N,A.westIndicesSouthToNorth,A.southIndicesEastToWest,A.eastIndicesNorthToSouth,A.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 igt=new Zn("upsampleQuantizedTerrainMesh",_f.maximumAsynchronousTasks);tC.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,a),p=igt.scheduleTask({vertices:s.vertices,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let A=Math.min(this._westSkirtHeight,this._eastSkirtHeight);A=Math.min(A,this._southSkirtHeight),A=Math.min(A,this._northSkirtHeight);let m=c?A*.5:this._westSkirtHeight,_=u?A*.5:this._southSkirtHeight,y=c?this._eastSkirtHeight:A*.5,C=u?this._northSkirtHeight:A*.5,E=this._credits;return Promise.resolve(p).then(function(I){let x=new Uint16Array(I.vertices),S=Ue.createTypedArray(x.length/3,I.indices),w;return l(I.encodedNormals)&&(w=new Uint8Array(I.encodedNormals)),new tC({quantizedVertices:x,indices:S,encodedNormals:w,minimumHeight:I.minimumHeight,maximumHeight:I.maximumHeight,boundingSphere:le.clone(I.boundingSphere),orientedBoundingBox:en.clone(I.orientedBoundingBox),horizonOcclusionPoint:d.clone(I.horizonOcclusionPoint),westIndices:I.westIndices,southIndices:I.southIndices,eastIndices:I.eastIndices,northIndices:I.northIndices,westSkirtHeight:m,southSkirtHeight:_,eastSkirtHeight:y,northSkirtHeight:C,childTileMask:0,credits:E,createdByUpsampling:!0})})};var HZ=32767,TIe=new d;tC.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=HZ;let o=D.clamp((n-e.south)/e.height,0,1);return o*=HZ,l(this._mesh)?sgt(this,i,o):cgt(this,i,o)};function SIe(e,t,n,i,o,r,a,s){let c=Math.min(n,o,a),u=Math.max(n,o,a),f=Math.min(i,r,s),h=Math.max(i,r,s);return e>=c&&e<=u&&t>=f&&t<=h}var ogt=new Q,rgt=new Q,agt=new Q;function sgt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],h=a[s+2],p=r.decodeTextureCoordinates(o,u,ogt),A=r.decodeTextureCoordinates(o,f,rgt),m=r.decodeTextureCoordinates(o,h,agt);if(SIe(t,n,p.x,p.y,A.x,A.y,m.x,m.y)){let _=Op.computeBarycentricCoordinates(t,n,p.x,p.y,A.x,A.y,m.x,m.y,TIe);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){let y=r.decodeHeight(o,u),C=r.decodeHeight(o,f),E=r.decodeHeight(o,h);return _.x*y+_.y*C+_.z*E}}}}function cgt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,a=e._indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],h=a[s+2],p=i[u],A=i[f],m=i[h],_=o[u],y=o[f],C=o[h];if(SIe(t,n,p,_,A,y,m,C)){let E=Op.computeBarycentricCoordinates(t,n,p,_,A,y,m,C,TIe);if(E.x>=-1e-15&&E.y>=-1e-15&&E.z>=-1e-15){let I=E.x*r[u]+E.y*r[f]+E.z*r[h];return D.lerp(e._minimumHeight,e._maximumHeight,I/HZ)}}}}tC.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};tC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var fS=tC;function lgt(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 BIe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??te.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}BIe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function DIe(e,t,n){if(!t.format){let _="The tile format is not specified in the layer.json file.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}if(!t.tiles||t.tiles.length===0){let _="The layer.json file does not specify any tile URL templates.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let i=!1,o=!1,r=!1,a=!0,s=!1;if(t.format==="heightmap-1.0")s=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let _=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new za({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let _=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}if(e.levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let _=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,_),new ue(_)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,a=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,A;if(l(p)&&!l(h)){A=new Lp(e.tilingScheme,p.length);for(let _=0;_<p.length;++_){let y=p[_],C=e.tilingScheme.getNumberOfYTilesAtLevel(_);l(e.overallAvailability[_])||(e.overallAvailability[_]=[]);for(let E=0;E<y.length;++E){let I=y[E],x=C-I.endY-1,S=C-I.startY-1;e.overallAvailability[_].push([I.startX,x,I.endX,S]),A.addAvailableTileRange(_,I.startX,x,I.endX,S)}}}else l(h)&&(f=new Lp(e.tilingScheme,u),A=new Lp(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],A.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new lgt({resource:e.lastResource,version:t.version,isHeightmap:s,tileUrlTemplates:c,availability:A,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:a}));let m=t.parentUrl;return l(m)?l(A)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await YZ(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function ugt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=`
|
|
${t.message}`),e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return YZ(e,n);throw new ue(i)}async function fgt(e,t,n){await DIe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new Lp(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let a=e.overallAvailability[r];for(let s=0;s<a.length;++s){let c=a[s];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Et(e.attribution);e.tileCredits.push(o)}return!0}async function YZ(e,t){try{let n=await e.layerJsonResource.fetchJson();return fgt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await DIe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):ugt(e,n,t)}}function $h(e){e=e??V.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new _e;let t=e.credit;typeof t=="string"&&(t=new Et(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 WZ={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function wIe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function dgt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Xc({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 hgt(e,t,n,i,o,r){let a=r.littleEndianExtensionSize,s=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,h=Float64Array.BYTES_PER_ELEMENT*u,A=Uint16Array.BYTES_PER_ELEMENT*3,m=3,_=Uint16Array.BYTES_PER_ELEMENT,y=_*m,C=new DataView(t),E=new d(C.getFloat64(s,!0),C.getFloat64(s+8,!0),C.getFloat64(s+16,!0));s+=f;let I=C.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let x=C.getFloat32(s,!0);s+=Float32Array.BYTES_PER_ELEMENT;let S=new le(new d(C.getFloat64(s,!0),C.getFloat64(s+8,!0),C.getFloat64(s+16,!0)),C.getFloat64(s+f,!0));s+=h;let w=new d(C.getFloat64(s,!0),C.getFloat64(s+8,!0),C.getFloat64(s+16,!0));s+=f;let v=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,s,v*3);s+=v*A,v>64*1024&&(_=Uint32Array.BYTES_PER_ELEMENT,y=_*m);let N=R.subarray(0,v),L=R.subarray(v,2*v),g=R.subarray(v*2,3*v);tn.zigZagDeltaDecode(N,L,g),s%_!==0&&(s+=_-s%_);let b=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let T=Ue.createTypedArrayFromArrayBuffer(v,t,s,b*m);s+=b*y;let B=0,M=T.length;for(let re=0;re<M;++re){let ye=T[re];T[re]=B-ye,ye===0&&++B}let O=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let G=Ue.createTypedArrayFromArrayBuffer(v,t,s,O);s+=O*_;let k=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let z=Ue.createTypedArrayFromArrayBuffer(v,t,s,k);s+=k*_;let F=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let H=Ue.createTypedArrayFromArrayBuffer(v,t,s,F);s+=F*_;let Y=C.getUint32(s,!0);s+=Uint32Array.BYTES_PER_ELEMENT;let $=Ue.createTypedArrayFromArrayBuffer(v,t,s,Y);s+=Y*_;let W,K;for(;s<C.byteLength;){let re=C.getUint8(s,!0);s+=Uint8Array.BYTES_PER_ELEMENT;let ye=C.getUint32(s,a);if(s+=Uint32Array.BYTES_PER_ELEMENT,re===WZ.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,s,v*2);else if(re===WZ.WATER_MASK&&e._requestWaterMask)K=new Uint8Array(t,s,ye);else if(re===WZ.METADATA&&e._requestMetadata){let Ce=C.getUint32(s,!0);if(Ce>0){let Ne=Pr(new Uint8Array(t),s+Uint32Array.BYTES_PER_ELEMENT,Ce).available;if(l(Ne))for(let Le=0;Le<Ne.length;++Le){let Oe=n+Le+1,nt=Ne[Le],Fe=e._tilingScheme.getNumberOfYTilesAtLevel(Oe);for(let _t=0;_t<nt.length;++_t){let rt=nt[_t],je=Fe-rt.endY-1,st=Fe-rt.startY-1;e.availability.addAvailableTileRange(Oe,rt.startX,je,rt.endX,st),r.availability.addAvailableTileRange(Oe,rt.startX,je,rt.endX,st)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}s+=ye}let Z=e.getLevelMaximumGeometricError(n)*5,pe=e._tilingScheme.tileXYToRectangle(i,o,n),ge=en.fromRectangle(pe,I,x,e._tilingScheme.ellipsoid);return new fS({center:E,minimumHeight:I,maximumHeight:x,boundingSphere:S,orientedBoundingBox:ge,horizonOcclusionPoint:w,quantizedVertices:R,encodedNormals:W,indices:T,westIndices:G,southIndices:z,eastIndices:H,northIndices:$,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:K,credits:e._tileCredits})}$h.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,a=o.length,s=!1,c=Promise.resolve();if(a===1)r=o[0];else for(let u=0;u<a;++u){let f=o[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=qZ(this,e,t,n,f,u===0);h.result&&(s=!0,c=c.then(()=>h.promise))}return!l(r)&&s?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):vIe(this,e,t,n,r,i)};function vIe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ue("Terrain tile doesn't exist"));let a=o.tileUrlTemplates;if(a.length===0)return;let s;!e._scheme||e._scheme==="tms"?s=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:s=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let u,f,h=a[(t+s+i)%a.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=wIe(void 0)):u=wIe(c);let A=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:s},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(l(A))return A.then(function(m){return l(m)?l(e._heightmapStructure)?dgt(e,m,i,t,n):hgt(e,m,i,t,n,o):Promise.reject(new ue("Mesh buffer doesn't exist."))})}Object.defineProperties($h.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}}});$h.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};$h.fromIonAssetId=async function(e,t){let n=await _a.fromAssetId(e);return $h.fromUrl(n,t)};$h.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new BIe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await YZ(i);let o=new $h(t);return i.build(o),o};$h.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(qZ(this,e,t,n,i[r],r===0).result)return;return!1};$h.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let a=qZ(this,e,t,n,i[r],r===0);if(l(a.promise))return a.promise}};function jZ(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,a=1<<i-r,s=t/a|0,c=n/a|0;return{level:r,x:s,y:c}}function qZ(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let a,s=function(){delete o.availabilityPromiseCache[a]},c=o.availabilityTilesLoaded,u=o.availability,f=jZ(o,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(a=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[a],!l(h))){let p=new Br({throttle:!1,throttleByServer:!1,type:es.TERRAIN});h=vIe(e,f.x,f.y,f.level,o,p),l(h)&&(o.availabilityPromiseCache[a]=h,h.then(s))}return{result:!0,promise:h}}f=jZ(o,f.x,f.y,f.level)}return{result:!1}}$h._getAvailabilityTile=jZ;var dS=$h;function pg(e){e=e??V.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Cu(n),this._workerName="createCircleGeometry"}pg.packedLength=Cu.packedLength;pg.pack=function(e,t,n){return Cu.pack(e._ellipseGeometry,t,n)};var PIe=new Cu({center:new d,semiMajorAxis:1,semiMinorAxis:1}),xc={center:new d,radius:void 0,ellipsoid:te.clone(te.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new ke,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};pg.unpack=function(e,t,n){let i=Cu.unpack(e,t,PIe);return xc.center=d.clone(i._center,xc.center),xc.ellipsoid=te.clone(i._ellipsoid,xc.ellipsoid),xc.ellipsoid=te.clone(i._ellipsoid,PIe._ellipsoid),xc.height=i._height,xc.extrudedHeight=i._extrudedHeight,xc.granularity=i._granularity,xc.vertexFormat=ke.clone(i._vertexFormat,xc.vertexFormat),xc.stRotation=i._stRotation,xc.shadowVolume=i._shadowVolume,l(n)?(xc.semiMajorAxis=i._semiMajorAxis,xc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Cu(xc),n):(xc.radius=i._semiMajorAxis,new pg(xc))};pg.createGeometry=function(e){return Cu.createGeometry(e._ellipseGeometry)};pg.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),a=n(i,o);return new pg({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:a,vertexFormat:ke.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(pg.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var RIe=pg;function hS(e){e=e??V.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Dd(n),this._workerName="createCircleOutlineGeometry"}hS.packedLength=Dd.packedLength;hS.pack=function(e,t,n){return Dd.pack(e._ellipseGeometry,t,n)};var mgt=new Dd({center:new d,semiMajorAxis:1,semiMinorAxis:1}),yf={center:new d,radius:void 0,ellipsoid:te.clone(te.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};hS.unpack=function(e,t,n){let i=Dd.unpack(e,t,mgt);return yf.center=d.clone(i._center,yf.center),yf.ellipsoid=te.clone(i._ellipsoid,yf.ellipsoid),yf.height=i._height,yf.extrudedHeight=i._extrudedHeight,yf.granularity=i._granularity,yf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(yf.semiMajorAxis=i._semiMajorAxis,yf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Dd(yf),n):(yf.radius=i._semiMajorAxis,new hS(yf))};hS.createGeometry=function(e){return Dd.createGeometry(e._ellipseGeometry)};var MIe=hS;function pgt(e){return e=e??V.EMPTY_OBJECT,dS.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var vV=pgt;function Agt(e){return e=e??V.EMPTY_OBJECT,dS.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:te.WGS84})}var mS=Agt;function pS(e){e=e??V.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Ji({ellipsoid:e.ellipsoid??te.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e;let n=e.credit;typeof n=="string"&&(n=new Et(n)),this._credit=n}Object.defineProperties(pS.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}}});pS.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,a=this._height;return Promise.resolve(o).then(function(s){let c=s;return Array.isArray(c)&&(c=new Float64Array(c)),new Xc({buffer:c,width:r,height:a})})};pS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};pS.prototype.getTileDataAvailable=function(e,t,n){};pS.prototype.loadTileDataAvailability=function(e,t,n){};var NIe=pS;var ggt=1953029805,_gt=2917034100;function KZ(e,t){if(KZ.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ue("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===ggt||o===_gt)return t;let r=new DataView(e),a=0,s=t.byteLength,c=s-s%8,u=n,f,h=8;for(;a<c;)for(h=(h+8)%24,f=h;a<c&&f<u;)i.setUint32(a,i.getUint32(a,!0)^r.getUint32(f,!0),!0),i.setUint32(a+4,i.getUint32(a+4,!0)^r.getUint32(f+4,!0),!0),a+=8,f+=24;if(a<s)for(f>=u&&(h=(h+8)%24,f=h);a<s;)i.setUint8(a,i.getUint8(a)^r.getUint8(f)),a++,f++}KZ.passThroughDataForTesting=!1;var PV=KZ;function LIe(e){this.proxy=e}LIe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var OIe=LIe;function AS(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Ji({ellipsoid:e.ellipsoid??te.default})),this._levelZeroMaximumGeometricError=Yo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new _e}Object.defineProperties(AS.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(){}}});AS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Xc({buffer:new Uint8Array(256),width:16,height:16}))};AS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};AS.prototype.getTileDataAvailable=function(e,t,n){};AS.prototype.loadTileDataAvailability=function(e,t,n){};var gS=AS;function Qp(e){e=e??V.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ns,this._perspectiveMatrix=new P,this._infinitePerspective=new P}function XZ(e){let{top:t,bottom:n,right:i,left:o,near:r,far:a}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||a!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=a,e._perspectiveMatrix=P.computePerspectiveOffCenter(o,i,n,t,r,a,e._perspectiveMatrix),e._infinitePerspective=P.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(Qp.prototype,{projectionMatrix:{get:function(){return XZ(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return XZ(this),this._infinitePerspective}}});var ygt=new d,Cgt=new d,Egt=new d,Igt=new d;Qp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,a=this.right,s=this.left,c=this.near,u=this.far,f=d.cross(t,n,ygt),h=Cgt;d.multiplyByScalar(t,c,h),d.add(e,h,h);let p=Egt;d.multiplyByScalar(t,u,p),d.add(e,p,p);let A=Igt;d.multiplyByScalar(f,s,A),d.add(h,A,A),d.subtract(A,e,A),d.normalize(A,A),d.cross(A,n,A),d.normalize(A,A);let m=i[0];return l(m)||(m=i[0]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),d.multiplyByScalar(f,a,A),d.add(h,A,A),d.subtract(A,e,A),d.cross(n,A,A),d.normalize(A,A),m=i[1],l(m)||(m=i[1]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),d.multiplyByScalar(n,r,A),d.add(h,A,A),d.subtract(A,e,A),d.cross(f,A,A),d.normalize(A,A),m=i[2],l(m)||(m=i[2]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),d.multiplyByScalar(n,o,A),d.add(h,A,A),d.subtract(A,e,A),d.cross(A,f,A),d.normalize(A,A),m=i[3],l(m)||(m=i[3]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,e),m=i[4],l(m)||(m=i[4]=new ie),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,A),m=i[5],l(m)||(m=i[5]=new ie),m.x=A.x,m.y=A.y,m.z=A.z,m.w=-d.dot(A,p),this._cullingVolume};Qp.prototype.getPixelDimensions=function(e,t,n,i,o){XZ(this);let r=1/this.near,a=this.top*r,s=2*i*n*a/t;a=this.right*r;let c=2*i*n*a/e;return o.x=c,o.y=s,o};Qp.prototype.clone=function(e){return l(e)||(e=new Qp),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Qp.prototype.equals=function(e){return l(e)&&e instanceof Qp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Qp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Qp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var Su=Qp;function wu(e){e=e??V.EMPTY_OBJECT,this._offCenterFrustum=new Su,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}wu.packedLength=6;wu.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};wu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new wu),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 em(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(wu.prototype,{projectionMatrix:{get:function(){return em(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return em(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return em(this),this._fovy}},sseDenominator:{get:function(){return em(this),this._sseDenominator}},offCenterFrustum:{get:function(){return em(this),this._offCenterFrustum}}});wu.prototype.computeCullingVolume=function(e,t,n){return em(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};wu.prototype.getPixelDimensions=function(e,t,n,i,o){return em(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};wu.prototype.clone=function(e){return l(e)||(e=new wu),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};wu.prototype.equals=function(e){return!l(e)||!(e instanceof wu)?!1:(em(this),em(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};wu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof wu)?!1:(em(this),em(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Wi=wu;var RV=0,bgt=1;function N0(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??ke.DEFAULT,r=e._drawNearPlane??!0,a,s;t instanceof Wi?(a=RV,s=Wi.packedLength):t instanceof An&&(a=bgt,s=An.packedLength),this._frustumType=a,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Qe.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+s+d.packedLength+Qe.packedLength+ke.packedLength}N0.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===RV?(Wi.pack(o,t,n),n+=Wi.packedLength):(An.pack(o,t,n),n+=An.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Qe.pack(e._orientation,t,n),n+=Qe.packedLength,ke.pack(e._vertexFormat,t,n),n+=ke.packedLength,t[n]=e._drawNearPlane?1:0,t};var xgt=new Wi,Tgt=new An,Sgt=new Qe,wgt=new d,Bgt=new ke;N0.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===RV?(o=Wi.unpack(e,t,xgt),t+=Wi.packedLength):(o=An.unpack(e,t,Tgt),t+=An.packedLength);let r=d.unpack(e,t,wgt);t+=d.packedLength;let a=Qe.unpack(e,t,Sgt);t+=Qe.packedLength;let s=ke.unpack(e,t,Bgt);t+=ke.packedLength;let c=e[t]===1;if(!l(n))return new N0({frustum:o,origin:r,orientation:a,vertexFormat:s,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Qe.clone(a,n._orientation),n._vertexFormat=ke.clone(s,n._vertexFormat),n._drawNearPlane=c,n};function _S(e,t,n,i,o,r,a,s){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=a.x,n[e+1]=a.y,n[e+2]=a.z),l(i)&&(i[e]=s.x,i[e+1]=s.y,i[e+2]=s.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var Dgt=new J,vgt=new P,JZ=new P,FIe=new d,QIe=new d,kIe=new d,Pgt=new d,Rgt=new d,Mgt=new d,nC=new Array(3),QP=new Array(4);QP[0]=new ie(-1,-1,1,1);QP[1]=new ie(1,-1,1,1);QP[2]=new ie(1,1,1,1);QP[3]=new ie(-1,1,1,1);var UIe=new Array(4);for(let e=0;e<4;++e)UIe[e]=new ie;N0._computeNearFarPlanes=function(e,t,n,i,o,r,a,s){let c=J.fromQuaternion(t,Dgt),u=r??FIe,f=a??QIe,h=s??kIe;u=J.getColumn(c,0,u),f=J.getColumn(c,1,f),h=J.getColumn(c,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=P.computeView(e,h,f,u,vgt),A,m,_=i.projectionMatrix;if(n===RV){let y=P.multiply(_,p,JZ);m=P.inverse(y,JZ)}else A=P.inverseTransformation(p,JZ);l(m)?(nC[0]=i.near,nC[1]=i.far):(nC[0]=0,nC[1]=i.near,nC[2]=i.far);for(let y=0;y<2;++y)for(let C=0;C<4;++C){let E=ie.clone(QP[C],UIe[C]);if(l(m)){E=P.multiplyByVector(m,E,E);let I=1/E.w;d.multiplyByScalar(E,I,E),d.subtract(E,e,E),d.normalize(E,E);let x=d.dot(h,E);d.multiplyByScalar(E,nC[y]/x,E),d.add(E,e,E)}else{let I=i.offCenterFrustum;l(I)&&(i=I);let x=nC[y],S=nC[y+1];E.x=(E.x*(i.right-i.left)+i.left+i.right)*.5,E.y=(E.y*(i.top-i.bottom)+i.bottom+i.top)*.5,E.z=(E.z*(x-S)-x-S)*.5,E.w=1,P.multiplyByVector(A,E,E)}o[12*y+C*3]=E.x,o[12*y+C*3+1]=E.y,o[12*y+C*3+2]=E.z}};N0.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,a=e._vertexFormat,s=r?6:5,c=new Float64Array(72);N0._computeNearFarPlanes(i,o,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],r||(c=c.subarray(12));let f=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:c})});if(l(a.normal)||l(a.tangent)||l(a.bitangent)||l(a.st)){let p=l(a.normal)?new Float32Array(12*s):void 0,A=l(a.tangent)?new Float32Array(12*s):void 0,m=l(a.bitangent)?new Float32Array(12*s):void 0,_=l(a.st)?new Float32Array(8*s):void 0,y=FIe,C=QIe,E=kIe,I=d.negate(y,Pgt),x=d.negate(C,Rgt),S=d.negate(E,Mgt);u=0,r&&(_S(u,p,A,m,_,S,y,C),u+=12),_S(u,p,A,m,_,E,I,C),u+=12,_S(u,p,A,m,_,I,S,C),u+=12,_S(u,p,A,m,_,x,S,I),u+=12,_S(u,p,A,m,_,y,E,C),u+=12,_S(u,p,A,m,_,C,E,I),l(p)&&(f.normal=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:p})),l(A)&&(f.tangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:A})),l(m)&&(f.bitangent=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:m})),l(_)&&(f.st=new Me({componentDatatype:j.FLOAT,componentsPerAttribute:2,values:_}))}let h=new Uint16Array(6*s);for(let p=0;p<s;++p){let A=p*6,m=p*4;h[A]=m,h[A+1]=m+1,h[A+2]=m+2,h[A+3]=m,h[A+4]=m+2,h[A+5]=m+3}return new yt({attributes:f,indices:h,primitiveType:Pe.TRIANGLES,boundingSphere:le.fromVertices(c)})};var yS=N0;var ZZ=0,Ngt=1;function kP(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,a;t instanceof Wi?(r=ZZ,a=Wi.packedLength):t instanceof An&&(r=Ngt,a=An.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Qe.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+a+d.packedLength+Qe.packedLength}kP.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===ZZ?(Wi.pack(o,t,n),n+=Wi.packedLength):(An.pack(o,t,n),n+=An.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Qe.pack(e._orientation,t,n),n+=Qe.packedLength,t[n]=e._drawNearPlane?1:0,t};var Lgt=new Wi,Ogt=new An,Fgt=new Qe,Qgt=new d;kP.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===ZZ?(o=Wi.unpack(e,t,Lgt),t+=Wi.packedLength):(o=An.unpack(e,t,Ogt),t+=An.packedLength);let r=d.unpack(e,t,Qgt);t+=d.packedLength;let a=Qe.unpack(e,t,Fgt);t+=Qe.packedLength;let s=e[t]===1;if(!l(n))return new kP({frustum:o,origin:r,orientation:a,_drawNearPlane:s});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Qe.clone(a,n._orientation),n._drawNearPlane=s,n};kP.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,a=new Float64Array(24);yS._computeNearFarPlanes(i,o,t,n,a);let s=new En({position:new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:a})}),c,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,u=p*4,h[c]=u,h[c+1]=u+1,h[c+2]=u+1,h[c+3]=u+2,h[c+4]=u+2,h[c+5]=u+3,h[c+6]=u+3,h[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,h[c]=u,h[c+1]=u+4,h[c+2]=u+1,h[c+3]=u+5,h[c+4]=u+2,h[c+5]=u+6,h[c+6]=u+3,h[c+7]=u+7;return new yt({attributes:s,indices:h,primitiveType:Pe.LINES,boundingSphere:le.fromVertices(a)})};var MV=kP;function NV(){de.throwInstantiationError()}Object.defineProperties(NV.prototype,{credit:{get:de.throwInstantiationError}});NV.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Et.getIonCredit)};NV.prototype.geocode=de.throwInstantiationError;var UP=NV;var kgt={SEARCH:0,AUTOCOMPLETE:1},L0=Object.freeze(kgt);function zIe(){de.throwInstantiationError()}zIe.createGeometry=function(e){de.throwInstantiationError()};var GIe=zIe;function Ugt(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 LV=Ugt;var jgt=Na($Z(),1);function zgt(e,t){return(e&t)!==0}var Fl=zgt;var Ggt=[1,2,4,8],VIe=15,Vgt=16,Hgt=64,Wgt=128;function kp(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}kp.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new kp(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};kp.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};kp.prototype.hasSubtree=function(){return Fl(this._bits,Vgt)};kp.prototype.hasImagery=function(){return Fl(this._bits,Hgt)};kp.prototype.hasTerrain=function(){return Fl(this._bits,Wgt)};kp.prototype.hasChildren=function(){return Fl(this._bits,VIe)};kp.prototype.hasChild=function(e){return Fl(this._bits,Ggt[e])};kp.prototype.getChildBitmask=function(){return this._bits&VIe};var OV=kp;function Ygt(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 qgt=Ygt(`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 Cf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Cf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Cf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new Cf;i._resource=n;try{await Kgt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${WIe(i,"",1).url}: ${o}`;throw new ue(r)}return i};Cf.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,a=0;Fl(t,r)?Fl(e,r)&&(a|=1):(a|=2,Fl(e,r)||(a|=1)),i+=a}return i};Cf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,a=+e[i-o];Fl(a,2)?Fl(a,1)||(t|=r):(n|=r,Fl(a,1)&&(t|=r))}return{x:t,y:n,level:i}};Cf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var HIe=new Zn("decodeGoogleEarthEnterprisePacket");Cf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=WIe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,a=this.key;return o.then(function(s){return HIe.scheduleTask({buffer:s,quadKey:e,type:"Metadata",key:a},[s]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,_){return m.length-_.length});let A=p.length;for(let m=0;m<A;++m){let _=p[m];if(u[_]!==null){let C=OV.clone(u[_]),E=_.length;if(E===h)C.setParent(f);else if(E>1){let I=r[_.substring(0,_.length-1)];C.setParent(I)}r[_]=C}else r[_]=null}})})};Cf.prototype.populateSubtree=function(e,t,n,i){let o=Cf.tileXYToQuadKey(e,t,n);return n$(this,o,i)};function n$(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let a,s=e._subtreePromises,c=s[o];if(l(c))return c.then(function(){return a=new Br({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),n$(e,t,a)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ue(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return s[o]=c,c.then(function(){return a=new Br({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),n$(e,t,a)}).finally(function(){delete s[o]})}Cf.prototype.getTileInformation=function(e,t,n){let i=Cf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Cf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function WIe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var e$,t$;function Kgt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(t$)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;t$=BI(n).then(function(){e$=window.cesiumGoogleEarthDbRootParser(jgt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return t$.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=e$.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,a=r+o.byteLength,s=e.key=o.buffer.slice(r,a);o=i.dbrootData,r=o.byteOffset,a=r+o.byteLength;let c=o.buffer.slice(r,a);return HIe.scheduleTask({buffer:c,type:"DbRoot",key:s},[c])}).then(function(n){let i=e$.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let s=i.endSnippet.model;e.negativeAltitudeExponentBias=s.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=s.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],a=r.length;for(let s=0;s<a;++s){let c=r[s],u=c.copyrightString;l(u)&&(o[c.providerId]=new Et(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=qgt})}var iC=Cf;function O0(e){e=e??V.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(O0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var qIe="createVerticesFromGoogleEarthEnterpriseBuffer",Xgt=new Zn(qIe),Jgt=new Zn(qIe,_f.maximumAsynchronousTasks),jIe=new ce,FV=new ce;O0.prototype.createMesh=function(e){e=e??V.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,a=e.exaggerationRelativeHeight??0,s=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,jIe),t.tileXYToRectangle(n,i,o,FV);let u=c.cartographicToCartesian(ce.center(FV)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let A=(s?Jgt:Xgt).scheduleTask({buffer:this._buffer,nativeRectangle:jIe,rectangle:FV,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:a,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(A))return;let m=this;return A.then(function(_){return m._mesh=new bc(u,new Float32Array(_.vertices),new Uint16Array(_.indices),_.indexCountWithoutSkirts,_.vertexCountWithoutSkirts,_.minimumHeight,_.maximumHeight,FV,le.clone(_.boundingSphere3D),d.clone(_.occludeePointInScaledSpace),_.numberOfAttributes,en.clone(_.orientedBoundingBox),Tr.clone(_.encoding),_.westIndicesSouthToNorth,_.southIndicesEastToWest,_.eastIndicesNorthToSouth,_.northIndicesWestToEast),m._minimumHeight=_.minimumHeight,m._maximumHeight=_.maximumHeight,m._buffer=void 0,m._mesh})};O0.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),o=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?n_t(this,i,o):r_t(this,i,o,e)};var Zgt=new Zn("upsampleQuantizedTerrainMesh",_f.maximumAsynchronousTasks);O0.prototype.upsample=function(e,t,n,i,o,r,a){let s=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,u=n*2===r,f=e.ellipsoid,h=e.tileXYToRectangle(o,r,a),p=Zgt.scheduleTask({vertices:s.vertices,indices:s.indices,indexCountWithoutSkirts:s.indexCountWithoutSkirts,vertexCountWithoutSkirts:s.vertexCountWithoutSkirts,encoding:s.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:h,ellipsoid:f});if(!l(p))return;let A=this;return p.then(function(m){let _=new Uint16Array(m.vertices),y=Ue.createTypedArray(_.length/3,m.indices),C=A._skirtHeight;return new fS({quantizedVertices:_,indices:y,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:le.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:d.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:C,southSkirtHeight:C,eastSkirtHeight:C,northSkirtHeight:C,childTileMask:0,createdByUpsampling:!0,credits:A._credits})})};O0.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};O0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var $gt=new Q,e_t=new Q,t_t=new Q,KIe=new d;function n_t(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,a=i.indices;for(let s=0,c=a.length;s<c;s+=3){let u=a[s],f=a[s+1],h=a[s+2],p=r.decodeTextureCoordinates(o,u,$gt),A=r.decodeTextureCoordinates(o,f,e_t),m=r.decodeTextureCoordinates(o,h,t_t),_=Op.computeBarycentricCoordinates(t,n,p.x,p.y,A.x,A.y,m.x,m.y,KIe);if(_.x>=-1e-15&&_.y>=-1e-15&&_.z>=-1e-15){let y=r.decodeHeight(o,u),C=r.decodeHeight(o,f),E=r.decodeHeight(o,h);return _.x*y+_.y*C+_.z*E}}}var i_t=Uint16Array.BYTES_PER_ELEMENT,YIe=Uint32Array.BYTES_PER_ELEMENT,i$=Int32Array.BYTES_PER_ELEMENT,o_t=Float32Array.BYTES_PER_ELEMENT,o$=Float64Array.BYTES_PER_ELEMENT;function r_t(e,t,n,i){let o=e._buffer,r=0,a=0,s=0;n>.5?(t>.5?(r=2,a=.5):r=3,s=.5):t>.5&&(r=1,a=.5);let c=new DataView(o),u=0;for(let S=0;S<r;++S)u+=c.getUint32(u,!0),u+=YIe;u+=YIe,u+=2*o$;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=o$;let h=D.toRadians(c.getFloat64(u,!0)*180);u+=o$;let p=i.width/f/2,A=i.height/h/2,m=c.getInt32(u,!0);u+=i$;let _=c.getInt32(u,!0)*3;u+=i$,u+=i$;let y=new Array(m),C=new Array(m),E=new Array(m),I;for(I=0;I<m;++I)y[I]=a+c.getUint8(u++)*p,C[I]=s+c.getUint8(u++)*A,E[I]=c.getFloat32(u,!0)*6371010,u+=o_t;let x=new Array(_);for(I=0;I<_;++I)x[I]=c.getUint16(u,!0),u+=i_t;for(I=0;I<_;I+=3){let S=x[I],w=x[I+1],v=x[I+2],R=y[S],N=y[w],L=y[v],g=C[S],b=C[w],T=C[v],B=Op.computeBarycentricCoordinates(t,n,R,g,N,b,L,T,KIe);if(B.x>=-1e-15&&B.y>=-1e-15&&B.z>=-1e-15)return B.x*E[S]+B.y*E[w]+B.z*E[v]}}var zP=O0;var Nd={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},QV=new X;function kV(){this._terrainCache={},this._lastTidy=X.now()}kV.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:X.now()}};kV.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};kV.prototype.tidy=function(){if(X.now(QV),X.secondsDifference(QV,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];X.secondsDifference(QV,r.timestamp)>10&&delete e[o]}X.clone(QV,this._lastTidy)}};function oC(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=new Ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new kV,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new _e}Object.defineProperties(oC.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(){}}});oC.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ue(`The server ${e.url} doesn't have terrain`);let n=new oC(t);return n._metadata=e,n};var a_t=new Zn("decodeGoogleEarthEnterprisePacket");function XIe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Nd.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}oC.prototype.requestTileGeometry=function(e,t,n,i){let o=iC.tileXYToQuadKey(e,t,n),r=this._terrainCache,a=this._metadata,s=a.getTileInformationFromQuadKey(o);if(!l(s))return Promise.reject(new ue("Terrain tile doesn't exist"));let c=s.terrainState;l(c)||(c=s.terrainState=Nd.UNKNOWN);let u=r.get(o);if(l(u)){let C=a.providers[s.terrainProvider];return Promise.resolve(new zP({buffer:u,childTileMask:XIe(o,s,a),credits:l(C)?[C]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold}))}if(r.tidy(),s.ancestorHasTerrain){if(c===Nd.NONE)return Promise.reject(new ue("Terrain tile doesn't exist"))}else return Promise.resolve(new Xc({buffer:new Uint8Array(256),width:16,height:16}));let f,h=o,p=-1;switch(c){case Nd.SELF:p=s.terrainVersion;break;case Nd.PARENT:h=h.substring(0,h.length-1),f=a.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case Nd.UNKNOWN:s.hasTerrain()?p=s.terrainVersion:(h=h.substring(0,h.length-1),f=a.getTileInformationFromQuadKey(h),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new ue("Terrain tile doesn't exist"));let A=this._terrainPromises,m=this._terrainRequests,_,y;if(l(A[h]))_=A[h],y=m[h];else{y=i;let C=s_t(this,h,p,y).fetchArrayBuffer();if(!l(C))return;_=C.then(function(E){return l(E)?a_t.scheduleTask({buffer:E,type:"Terrain",key:a.key},[E]).then(function(I){let x=a.getTileInformationFromQuadKey(h);x.terrainState=Nd.SELF,r.add(h,I[0]);let S=x.terrainProvider,w=I.length-1;for(let v=0;v<w;++v){let R=h+v.toString(),N=a.getTileInformationFromQuadKey(R);l(N)&&(r.add(R,I[v+1]),N.terrainState=Nd.PARENT,N.terrainProvider===0&&(N.terrainProvider=S))}}):Promise.reject(new ue("Failed to load terrain."))}),A[h]=_,m[h]=y,_=_.finally(function(){delete A[h],delete m[h]})}return _.then(function(){let C=r.get(o);if(l(C)){let E=a.providers[s.terrainProvider];return new zP({buffer:C,childTileMask:XIe(o,s,a),credits:l(E)?[E]:void 0,negativeAltitudeExponentBias:a.negativeAltitudeExponentBias,negativeElevationThreshold:a.negativeAltitudeThreshold})}return Promise.reject(new ue("Failed to load terrain."))}).catch(function(C){return y.state===yi.CANCELLED?(i.state=y.state,Promise.reject(C)):(s.terrainState=Nd.NONE,Promise.reject(C))})};oC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};oC.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=iC.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let a=r.terrainState;if(a===Nd.NONE)return!1;if((!l(a)||a===Nd.UNKNOWN)&&(r.terrainState=Nd.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let s=i.getTileInformationFromQuadKey(o);if(!l(s)||!s.hasTerrain())return!1}return!0}if(i.isValid(o)){let a=new Br({throttle:!1,throttleByServer:!0,type:es.TERRAIN});i.populateSubtree(e,t,n,a)}return!1};oC.prototype.loadTileDataAvailability=function(e,t,n){};function s_t(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var JIe=oC;var c_t="https://maps.googleapis.com/maps/api/geocode/json",ZIe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function r$(e){e=e??V.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:c_t,queryParameters:{key:t}}),this._credit=new Et(ZIe,!0)}Object.defineProperties(r$.prototype,{credit:{get:function(){return this._credit}}});r$.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ue(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,a=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,a.lng,a.lat),attribution:{html:ZIe,collapsible:!1}}})};var $Ie=r$;function l_t(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var UV=l_t;var hbe={},u_t=32.184,f_t=2451545,ebe=-.0529921,tbe=-.1059842,nbe=13.0120009,ibe=13.3407154,obe=.9856003,rbe=26.4057084,abe=13.064993,sbe=.3287146,cbe=1.7484877,lbe=-.1589763,ube=.0036096,fbe=.1643573,dbe=12.9590088,a$=new X;hbe.ComputeMoon=function(e,t){l(e)||(e=X.now()),a$=X.addSeconds(e,u_t,a$);let n=X.totalDays(a$)-f_t,i=n/ci.DAYS_PER_JULIAN_CENTURY,o=(125.045+ebe*n)*D.RADIANS_PER_DEGREE,r=(250.089+tbe*n)*D.RADIANS_PER_DEGREE,a=(260.008+nbe*n)*D.RADIANS_PER_DEGREE,s=(176.625+ibe*n)*D.RADIANS_PER_DEGREE,c=(357.529+obe*n)*D.RADIANS_PER_DEGREE,u=(311.589+rbe*n)*D.RADIANS_PER_DEGREE,f=(134.963+abe*n)*D.RADIANS_PER_DEGREE,h=(276.617+sbe*n)*D.RADIANS_PER_DEGREE,p=(34.226+cbe*n)*D.RADIANS_PER_DEGREE,A=(15.134+lbe*n)*D.RADIANS_PER_DEGREE,m=(119.743+ube*n)*D.RADIANS_PER_DEGREE,_=(239.961+fbe*n)*D.RADIANS_PER_DEGREE,y=(25.053+dbe*n)*D.RADIANS_PER_DEGREE,C=Math.sin(o),E=Math.sin(r),I=Math.sin(a),x=Math.sin(s),S=Math.sin(c),w=Math.sin(u),v=Math.sin(f),R=Math.sin(h),N=Math.sin(p),L=Math.sin(A),g=Math.sin(m),b=Math.sin(_),T=Math.sin(y),B=Math.cos(o),M=Math.cos(r),O=Math.cos(a),G=Math.cos(s),k=Math.cos(c),z=Math.cos(u),F=Math.cos(f),H=Math.cos(h),Y=Math.cos(p),$=Math.cos(A),W=Math.cos(m),K=Math.cos(_),Z=Math.cos(y),pe=(269.9949+.0031*i-3.8787*C-.1204*E+.07*I-.0172*x+.0072*w-.0052*L+.0043*T)*D.RADIANS_PER_DEGREE,ge=(66.5392+.013*i+1.5419*B+.0239*M-.0278*O+.0068*G-.0029*z+9e-4*F+8e-4*$-9e-4*Z)*D.RADIANS_PER_DEGREE,re=(38.3213+13.17635815*n-14e-13*n*n+3.561*C+.1208*E-.0642*I+.0158*x+.0252*S-.0066*w-.0047*v-.0046*R+.0028*N+.0052*L+.004*g+.0019*b-.0044*T)*D.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*B*ebe+.1208*M*tbe-.0642*O*nbe+.0158*G*ibe+.0252*k*obe-.0066*z*rbe-.0047*F*abe-.0046*H*sbe+.0028*Y*cbe+.0052*$*lbe+.004*W*ube+.0019*K*fbe-.0044*Z*dbe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new UV),t.rightAscension=pe,t.declination=ge,t.rotation=re,t.rotationRate=ye,t};var zV=hbe;function mbe(e){(!l(e)||typeof e!="function")&&(e=zV.ComputeMoon),this._computeFunction=e}var d_t=new d,h_t=new d,m_t=new d;function p_t(e,t,n){let i=d_t;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=m_t;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let a=d.cross(r,i,h_t);return l(n)||(n=new J),n[0]=i.x,n[1]=a.x,n[2]=r.x,n[3]=i.y,n[4]=a.y,n[5]=r.y,n[6]=i.z,n[7]=a.z,n[8]=r.z,n}var A_t=new J,g_t=new Qe;mbe.prototype.evaluate=function(e,t){l(e)||(e=X.now());let n=this._computeFunction(e),i=p_t(n.rightAscension,n.declination,t),o=D.zeroToTwoPi(n.rotation),r=Qe.fromAxisAngle(d.UNIT_Z,o,g_t),a=J.fromQuaternion(Qe.conjugate(r,r),A_t);return J.multiply(a,i,i)};var GV=mbe;var GP={};GP.type=void 0;GP.getRequiredDataPoints=de.throwInstantiationError;GP.interpolateOrderZero=de.throwInstantiationError;GP.interpolate=de.throwInstantiationError;var pbe=GP;var __t={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},rC=Object.freeze(__t);function s$(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(s$.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});s$.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===L0.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,a=o.bbox;if(l(a))r=ce.fromDegrees(a[0],a[1],a[2],a[3]);else{let s=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=d.fromDegrees(s,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var VV=s$;function y_t(e){if(!Object.values(rC).some(t=>t===e))throw new de(`Invalid geocodeProviderType: "${e}"`)}var Abe=Object.freeze({[rC.GOOGLE]:"google",[rC.BING]:"bing",[rC.DEFAULT]:void 0});function C_t(e){return Abe[e]}function E_t(e){return Object.entries(Abe).find(t=>t[1]===e)[0]}function c$(e){e=e??V.EMPTY_OBJECT;let t=e.geocodeProviderType??rC.DEFAULT,n=e.accessToken??Fm.defaultAccessToken,i=De.createIfNeeded(e.server??Fm.defaultServer);i.appendForwardSlash();let o=Fm.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Et.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new VV(r),this.geocodeProviderType=t}Object.defineProperties(c$.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return E_t(this._pelias.url.queryParameters.geocoder)},set:function(e){y_t(e);let t={...this._pelias.url.queryParameters,geocoder:C_t(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});c$.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var CS=c$;var qa={};qa.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});qa.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});qa.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});qa.defaultAccessToken=void 0;qa.defaultShareKey=void 0;qa._getAuthorizationHeader=function(){return l(qa.defaultShareKey)?`Basic ${qa.defaultShareKey}`:`Bearer ${qa.defaultAccessToken}`};qa.apiEndpoint=new De({url:"https://api.bentley.com"});qa.getExports=async function(e,t){let n=new De({url:`${qa.apiEndpoint}mesh-export`,headers:{Authorization:qa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:qa.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ue(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ue("Not allowed, forbidden");if(i.statusCode===422)throw new ue(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${i.statusCode}`)}};qa.getRealityDataMetadata=async function(e,t){let n=new De({url:`${qa.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:qa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ue(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ue("Not allowed, forbidden");if(i.statusCode===404)throw new ue(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ue(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${i.statusCode}`)}};qa.getRealityDataURL=async function(e,t,n){let i=new De({url:`${qa.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:qa._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,a=new URL(r);return a.pathname=`${a.pathname}/${n}`,a.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let a=r.error.details?.[0].code??"";throw new ue(`Unauthorized, bad token, wrong scopes or headers bad. ${a}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ue("Not allowed, forbidden");if(o.statusCode===404)throw new ue(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ue(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ue("Too many requests")}throw new ue(`Unknown request failure ${o.statusCode}`)}};var ds=qa;var I_t={SHIFT:0,CTRL:1,ALT:2},ac=Object.freeze(I_t);function HV(){de.throwInstantiationError()}Object.defineProperties(HV.prototype,{ellipsoid:{get:de.throwInstantiationError}});HV.prototype.project=de.throwInstantiationError;HV.prototype.unproject=de.throwInstantiationError;var gbe=HV;var l$=[],u$=[];function b_t(e,t,n,i,o,r){let a=o-i+1,s=r-o,c=l$,u=u$,f,h;for(f=0;f<a;++f)c[f]=e[i+f];for(h=0;h<s;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let A=c[f],m=u[h];f<a&&(h>=s||t(A,m,n)<=0)?(e[p]=A,++f):h<s&&(e[p]=m,++h)}}function f$(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);f$(e,t,n,i,r),f$(e,t,n,r+1,o),b_t(e,t,n,i,r,o)}function x_t(e,t,n){let i=e.length,o=Math.ceil(i*.5);l$.length=o,u$.length=o,f$(e,t,n,0,i-1),l$.length=0,u$.length=0}var Ag=x_t;function ES(e){e=e??V.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(ES.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});ES.prototype.findTimeInterval=So.prototype.findTimeInterval;ES.prototype.wrapTime=So.prototype.wrapTime;ES.prototype.clampTime=So.prototype.clampTime;ES.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let a=0;a<this._count;a++){let s=o*this._count+a;t[a]=n[s]*(1-r)+n[s+this._count]*r}return t};var _be=ES;var T_t={NONE:-1,PARTIAL:0,FULL:1},qr=Object.freeze(T_t);function Jc(e,t){this._occluderPosition=d.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var WV=new d;Object.defineProperties(Jc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,WV),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,a;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,WV);let s=o*o*n;a=d.add(e,d.multiplyByScalar(r,s,WV),WV)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=a,this._cameraPosition=e}}});Jc.fromBoundingSphere=function(e,t,n){return l(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Jc(e,t)};var Cbe=new d;Jc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,Cbe),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var S_t=new d;Jc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,S_t),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,Cbe),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.magnitudeSquared(i),a=this._occluderRadius*this._occluderRadius,s=n*n;return(this._horizonDistance*this._horizonDistance+a)*s>r*a?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+s>r)}return!0}return!1};var w_t=new d;Jc.prototype.computeVisibility=function(e){let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return qr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,w_t),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let a=d.magnitudeSquared(i);return o*o+n*n<a?qr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,a<o*o+n*n?qr.FULL:qr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?qr.PARTIAL:qr.FULL))}}return qr.NONE};var jV=new d;Jc.computeOccludeePoint=function(e,t,n){let i=d.clone(t),o=d.clone(e.center),r=e.radius,a=n.length,s=d.normalize(d.subtract(i,o,jV),jV),c=-d.dot(s,o),u=Jc._anyRotationVector(o,s,c),f=Jc._horizonToPlaneNormalDotProduct(e,s,c,u,n[0]);if(!f)return;let h;for(let A=1;A<a;++A){if(h=Jc._horizonToPlaneNormalDotProduct(e,s,c,u,n[A]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(s,p,jV),jV)};var B_t=[];Jc.computeOccludeePointFromRectangle=function(e,t){t=t??te.default;let n=ce.subsample(e,t,0,B_t),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return Jc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var D_t=new d;Jc._anyRotationVector=function(e,t,n){let i=d.abs(t,D_t),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,a;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,a=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,a=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,a=d.UNIT_Z);let s=(d.dot(t,i)+n)/-d.dot(t,a);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(a,s,r),i),e,i),i)};var v_t=new d;Jc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,v_t);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let a=d.cross(t,r,r);if(d.magnitude(a)>D.EPSILON13)return d.normalize(a,new d)}return o};var d$=new d,P_t=new d,YV=new d,ybe=new d;Jc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,d$),a=d.clone(e.center,P_t),s=e.radius,c=d.subtract(a,r,YV),u=d.magnitudeSquared(c),f=s*s;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),y=p*m*p;c=d.normalize(c,c);let C=d.add(r,d.multiplyByScalar(c,y,ybe),ybe),E=Math.sqrt(h-y*y),I=this._rotationVector(a,t,n,r,i),x=d.fromElements(I.x*I.x*c.x+(I.x*I.y-I.z)*c.y+(I.x*I.z+I.y)*c.z,(I.x*I.y+I.z)*c.x+I.y*I.y*c.y+(I.y*I.z-I.x)*c.z,(I.x*I.z-I.y)*c.x+(I.y*I.z+I.x)*c.y+I.z*I.z*c.z,d$);x=d.normalize(x,x);let S=d.multiplyByScalar(x,E,d$);I=d.normalize(d.subtract(d.add(C,S,YV),a,YV),YV);let w=d.dot(t,I);I=d.normalize(d.subtract(d.subtract(C,S,I),a,I),I);let v=d.dot(t,I);return w<v?w:v};var qV=Jc;function h$(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Et('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(h$.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});h$.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Pt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let{lng:a,lat:s}=i.geometry;o=d.fromDegrees(a,s)}return{displayName:i.formatted,destination:o}})})};var Ebe=h$;var R_t={packedLength:void 0,pack:de.throwInstantiationError,unpack:de.throwInstantiationError},Ibe=R_t;var M_t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:de.throwInstantiationError,unpackInterpolationResult:de.throwInstantiationError},bbe=M_t;var N_t=new d;function L_t(e,t,n,i){let o=QI(e,t,n,i,N_t);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var xbe=L_t;function Tbe(){de.throwInstantiationError()}Tbe.prototype.getURL=de.throwInstantiationError;var Sbe=Tbe;async function O_t(e,t,n,i){return l(i)||(i=!1),k_t(e,t,n,i)}function F_t(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(Bbe(i)):r=o.then(Bbe(i)).catch(U_t(i)),e.shift(),t.push(r),!0}function Q_t(e){return new Promise(function(t){setTimeout(t,e)})}function m$(e,t,n){return e.length?F_t(e,t,n)?m$(e,t,n):Q_t(100).then(()=>m$(e,t,n)):Promise.resolve()}function k_t(e,t,n,i){let o=e.tilingScheme,r,a=[],s={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!l(u))continue;let f=u.toString();if(!s.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};s[f]=h,a.push(h)}s[f].positions.push(n[r])}let c=[];return m$(a,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function wbe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Bbe(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 a=t[r];if(!wbe(a,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 a=t[r];wbe(a,i,n)}}):Promise.resolve()}}function U_t(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var KV=O_t;var p$=new Q;async function Dbe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,a=[];for(let c=0;c<t.length;++c){let u=t[c],f=r.computeMaximumLevelAtPosition(u);if(o[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,p$);let p=e.loadTileDataAvailability(p$.x,p$.y,1);l(p)&&a.push(p)}let h=i[f];l(h)||(i[f]=h=[]),h.push(u)}await Promise.all(a),await Promise.all(i.map(function(c,u){if(l(c))return KV(e,u,c,n)}));let s=[];for(let c=0;c<t.length;++c){let u=t[c];r.computeMaximumLevelAtPosition(u)!==o[c]&&s.push(u)}return s.length>0&&await Dbe(e,s,n),t}var IS=Dbe;var z_t={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Dn=Object.freeze(z_t);function aC(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)*(i.offsetWidth/o.width),n.y=(t.clientY-o.top)*(i.offsetHeight/o.height),n}function E$(e,t){let n=e;return l(t)&&(n+=`+${t}`),n}function F0(e){if(e.shiftKey)return ac.SHIFT;if(e.ctrlKey)return ac.CTRL;if(e.altKey)return ac.ALT}var fa={LEFT:0,MIDDLE:1,RIGHT:2};function Ef(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function G_t(e){let t=e._element,n=l(t.disableRootEvents)?t:document;hn.supportsPointerEvents()?(Ef(e,"pointerdown",t,q_t),Ef(e,"pointerup",t,kbe),Ef(e,"pointermove",t,K_t),Ef(e,"pointercancel",t,kbe)):(Ef(e,"mousedown",t,Ube),Ef(e,"mouseup",n,zbe),Ef(e,"mousemove",n,Gbe),Ef(e,"touchstart",t,j_t),Ef(e,"touchend",n,Nbe),Ef(e,"touchmove",n,Y_t),Ef(e,"touchcancel",n,Nbe)),Ef(e,"dblclick",t,H_t);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ef(e,i,t,W_t)}function V_t(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var vbe={position:new Q};function I$(e){e._lastSeenTouchEvent=ki()}function b$(e){return ki()-e._lastSeenTouchEvent>tm.mouseEmulationIgnoreMilliseconds}function C$(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function Ube(e,t){if(!b$(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===fa.LEFT)i=Dn.LEFT_DOWN;else if(n===fa.MIDDLE)i=Dn.MIDDLE_DOWN;else if(n===fa.RIGHT)i=Dn.RIGHT_DOWN;else return;let o=aC(e,t,e._primaryPosition);Q.clone(o,e._primaryStartPosition),Q.clone(o,e._primaryPreviousPosition);let r=F0(t),a=e.getInputAction(i,r);l(a)&&(Q.clone(o,vbe.position),a(vbe),t.preventDefault())}var Pbe={position:new Q},Rbe={position:new Q};function A$(e,t,n,i){let o=F0(i),r=e.getInputAction(t,o),a=e.getInputAction(n,o);if(l(r)||l(a)){let s=aC(e,i,e._primaryPosition);if(l(r)&&(Q.clone(s,Pbe.position),r(Pbe)),l(a)){let c=e._primaryStartPosition;C$(c,s,e._clickPixelTolerance)&&(Q.clone(s,Rbe.position),a(Rbe))}}}function zbe(e,t){if(!b$(e))return;let n=t.button;n!==fa.LEFT&&n!==fa.MIDDLE&&n!==fa.RIGHT||(e._buttonDown[fa.LEFT]&&(A$(e,Dn.LEFT_UP,Dn.LEFT_CLICK,t),e._buttonDown[fa.LEFT]=!1),e._buttonDown[fa.MIDDLE]&&(A$(e,Dn.MIDDLE_UP,Dn.MIDDLE_CLICK,t),e._buttonDown[fa.MIDDLE]=!1),e._buttonDown[fa.RIGHT]&&(A$(e,Dn.RIGHT_UP,Dn.RIGHT_CLICK,t),e._buttonDown[fa.RIGHT]=!1))}var g$={startPosition:new Q,endPosition:new Q};function Gbe(e,t){if(!b$(e))return;let n=F0(t),i=aC(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Dn.MOUSE_MOVE,n);l(r)&&(Q.clone(o,g$.startPosition),Q.clone(i,g$.endPosition),r(g$)),Q.clone(i,o),(e._buttonDown[fa.LEFT]||e._buttonDown[fa.MIDDLE]||e._buttonDown[fa.RIGHT])&&t.preventDefault()}var Mbe={position:new Q};function H_t(e,t){let n=t.button,i;if(n===fa.LEFT)i=Dn.LEFT_DOUBLE_CLICK;else return;let o=F0(t),r=e.getInputAction(i,o);l(r)&&(aC(e,t,Mbe.position),r(Mbe))}function W_t(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=F0(t),o=e.getInputAction(Dn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function j_t(e,t){I$(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i)r=n[i],a=r.identifier,s.set(a,aC(e,r,new Q));XV(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,c.set(a,Q.clone(s.get(a)))}function Nbe(e,t){I$(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i)r=n[i],a=r.identifier,s.remove(a);XV(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,c.remove(a)}var Lbe={position:new Q},_$={position1:new Q,position2:new Q},Obe={position:new Q},Fbe={position:new Q},Qbe={position:new Q};function XV(e,t){let n=F0(t),i=e._positions,o=i.length,r,a,s=e._isPinching;if(o!==1&&e._buttonDown[fa.LEFT]){if(e._buttonDown[fa.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Dn.LEFT_UP,n),l(r)&&(Q.clone(e._primaryPosition,Obe.position),r(Obe)),o===0&&!e._isTouchHolding&&(a=e.getInputAction(Dn.LEFT_CLICK,n),l(a))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];C$(c,u,e._clickPixelTolerance)&&(Q.clone(e._primaryPosition,Fbe.position),a(Fbe))}e._isTouchHolding=!1}if(o===0&&s&&(e._isPinching=!1,r=e.getInputAction(Dn.PINCH_END,n),l(r)&&r()),o===1&&!s){let c=i.values[0];Q.clone(c,e._primaryPosition),Q.clone(c,e._primaryStartPosition),Q.clone(c,e._primaryPreviousPosition),e._buttonDown[fa.LEFT]=!0,r=e.getInputAction(Dn.LEFT_DOWN,n),l(r)&&(Q.clone(c,Lbe.position),r(Lbe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,a=e.getInputAction(Dn.RIGHT_CLICK,n),l(a))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];C$(u,f,e._holdPixelTolerance)&&(Q.clone(e._primaryPosition,Qbe.position),a(Qbe))}},tm.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!s&&(e._isPinching=!0,r=e.getInputAction(Dn.PINCH_START,n),l(r)&&(Q.clone(i.values[0],_$.position1),Q.clone(i.values[1],_$.position2),r(_$),t.preventDefault()))}function Y_t(e,t){I$(e);let n=t.changedTouches,i,o=n.length,r,a,s=e._positions;for(i=0;i<o;++i){r=n[i],a=r.identifier;let u=s.get(a);l(u)&&aC(e,r,u)}Vbe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],a=r.identifier,Q.clone(s.get(a),c.get(a))}var y$={startPosition:new Q,endPosition:new Q},VP={distance:{startPosition:new Q,endPosition:new Q},angleAndHeight:{startPosition:new Q,endPosition:new Q}};function Vbe(e,t){let n=F0(t),i=e._positions,o=e._previousPositions,r=i.length,a;if(r===1&&e._buttonDown[fa.LEFT]){let s=i.values[0];Q.clone(s,e._primaryPosition);let c=e._primaryPreviousPosition;a=e.getInputAction(Dn.MOUSE_MOVE,n),l(a)&&(Q.clone(c,y$.startPosition),Q.clone(s,y$.endPosition),a(y$)),Q.clone(s,c),t.preventDefault()}else if(r===2&&e._isPinching&&(a=e.getInputAction(Dn.PINCH_MOVE,n),l(a))){let s=i.values[0],c=i.values[1],u=o.values[0],f=o.values[1],h=c.x-s.x,p=c.y-s.y,A=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,_=f.y-u.y,y=Math.sqrt(m*m+_*_)*.25,C=(c.y+s.y)*.125,E=(f.y+u.y)*.125,I=Math.atan2(p,h),x=Math.atan2(_,m);Q.fromElements(0,y,VP.distance.startPosition),Q.fromElements(0,A,VP.distance.endPosition),Q.fromElements(x,E,VP.angleAndHeight.startPosition),Q.fromElements(I,C,VP.angleAndHeight.endPosition),a(VP)}}function q_t(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,aC(e,t,new Q)),XV(e,t),e._previousPositions.set(i,Q.clone(n.get(i)))}else Ube(e,t)}function kbe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),XV(e,t),e._previousPositions.remove(i)}else zbe(e,t)}function K_t(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;aC(e,t,o),Vbe(e,t);let r=e._previousPositions;Q.clone(n.get(i),r.get(i))}else Gbe(e,t)}function tm(e){this._inputEvents={},this._buttonDown={[fa.LEFT]:!1,[fa.MIDDLE]:!1,[fa.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-tm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new Q,this._primaryPosition=new Q,this._primaryPreviousPosition=new Q,this._positions=new Ft,this._previousPositions=new Ft,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,G_t(this)}tm.prototype.setInputAction=function(e,t,n){let i=E$(t,n);this._inputEvents[i]=e};tm.prototype.getInputAction=function(e,t){let n=E$(e,t);return this._inputEvents[n]};tm.prototype.removeInputAction=function(e,t){let n=E$(e,t);delete this._inputEvents[n]};tm.prototype.isDestroyed=function(){return!1};tm.prototype.destroy=function(){return V_t(this),fe(this)};tm.mouseEmulationIgnoreMilliseconds=800;tm.touchHoldDelayMilliseconds=1500;var Ld=tm;function X_t(e,t,n,i,o,r,a){let s=to.numberOfPoints(e,t,o),c,u=n.red,f=n.green,h=n.blue,p=n.alpha,A=i.red,m=i.green,_=i.blue,y=i.alpha;if(U.equals(n,i)){for(c=0;c<s;c++)r[a++]=U.floatToByte(u),r[a++]=U.floatToByte(f),r[a++]=U.floatToByte(h),r[a++]=U.floatToByte(p);return a}let C=(A-u)/s,E=(m-f)/s,I=(_-h)/s,x=(y-p)/s,S=a;for(c=0;c<s;c++)r[S++]=U.floatToByte(u+c*C),r[S++]=U.floatToByte(f+c*E),r[S++]=U.floatToByte(h+c*I),r[S++]=U.floatToByte(p+c*x);return S}function HP(e){e=e??V.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??te.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=l(n)?1+n.length*U.packedLength:1,this.packedLength=o+te.packedLength+3}HP.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let a=e._colors;for(r=l(a)?a.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(a[i],t,n);return te.pack(e._ellipsoid,t,n),n+=te.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};HP.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let a=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)a[i]=U.unpack(e,t);let s=te.unpack(e,t);t+=te.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=r,n._colors=a,n._ellipsoid=s,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new HP({positions:r,colors:a,ellipsoid:s,colorsPerVertex:c,arcType:u,granularity:f})};var JV=new Array(2),ZV=new Array(2),J_t={positions:JV,height:ZV,ellipsoid:void 0,minDistance:void 0,granularity:void 0};HP.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,a=e._ellipsoid,s=D.chordLength(r,a.maximumRadius),c=l(n)&&!i,u,f=t.length,h,p,A,m,_=0;if(o===un.GEODESIC||o===un.RHUMB){let x,S,w;o===un.GEODESIC?(x=D.chordLength(r,a.maximumRadius),S=to.numberOfPoints,w=to.generateArc):(x=r,S=to.numberOfPointsRhumbLine,w=to.generateRhumbArc);let v=to.extractHeights(t,a),R=J_t;if(o===un.GEODESIC?R.minDistance=s:R.granularity=r,R.ellipsoid=a,c){let N=0;for(u=0;u<f-1;u++)N+=S(t[u],t[u+1],x)+1;h=new Float64Array(N*3),A=new Uint8Array(N*4),R.positions=JV,R.height=ZV;let L=0;for(u=0;u<f-1;++u){JV[0]=t[u],JV[1]=t[u+1],ZV[0]=v[u],ZV[1]=v[u+1];let g=w(R);if(l(n)){let b=g.length/3;m=n[u];for(let T=0;T<b;++T)A[L++]=U.floatToByte(m.red),A[L++]=U.floatToByte(m.green),A[L++]=U.floatToByte(m.blue),A[L++]=U.floatToByte(m.alpha)}h.set(g,_),_+=g.length}}else if(R.positions=t,R.height=v,h=new Float64Array(w(R)),l(n)){for(A=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let L=t[u],g=t[u+1],b=n[u],T=n[u+1];_=X_t(L,g,b,T,s,A,_)}let N=n[f-1];A[_++]=U.floatToByte(N.red),A[_++]=U.floatToByte(N.green),A[_++]=U.floatToByte(N.blue),A[_++]=U.floatToByte(N.alpha)}}else{p=c?f*2-2:f,h=new Float64Array(p*3),A=l(n)?new Uint8Array(p*4):void 0;let x=0,S=0;for(u=0;u<f;++u){let w=t[u];if(c&&u>0&&(d.pack(w,h,x),x+=3,m=n[u-1],A[S++]=U.floatToByte(m.red),A[S++]=U.floatToByte(m.green),A[S++]=U.floatToByte(m.blue),A[S++]=U.floatToByte(m.alpha)),c&&u===f-1)break;d.pack(w,h,x),x+=3,l(n)&&(m=n[u],A[S++]=U.floatToByte(m.red),A[S++]=U.floatToByte(m.green),A[S++]=U.floatToByte(m.blue),A[S++]=U.floatToByte(m.alpha))}}let y=new En;y.position=new Me({componentDatatype:j.DOUBLE,componentsPerAttribute:3,values:h}),l(n)&&(y.color=new Me({componentDatatype:j.UNSIGNED_BYTE,componentsPerAttribute:4,values:A,normalize:!0})),p=h.length/3;let C=(p-1)*2,E=Ue.createTypedArray(p,C),I=0;for(u=0;u<p-1;++u)E[I++]=u,E[I++]=u+1;return new yt({attributes:y,indices:E,primitiveType:Pe.LINES,boundingSphere:le.fromPoints(t)})};var Hbe=HP;function bS(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new nc(i),this._workerName="createSphereGeometry"}bS.packedLength=nc.packedLength;bS.pack=function(e,t,n){return nc.pack(e._ellipsoidGeometry,t,n)};var Z_t=new nc,sC={radius:void 0,radii:new d,vertexFormat:new ke,stackPartitions:void 0,slicePartitions:void 0};bS.unpack=function(e,t,n){let i=nc.unpack(e,t,Z_t);return sC.vertexFormat=ke.clone(i._vertexFormat,sC.vertexFormat),sC.stackPartitions=i._stackPartitions,sC.slicePartitions=i._slicePartitions,l(n)?(d.clone(i._radii,sC.radii),n._ellipsoidGeometry=new nc(sC),n):(sC.radius=i._radii.x,new bS(sC))};bS.createGeometry=function(e){return nc.createGeometry(e._ellipsoidGeometry)};var $V=bS;function $_t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var xS=$_t;var eyt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Tn=eyt;function cC(e){}Object.defineProperties(cC.prototype,{ellipsoid:{get:de.throwInstantiationError},rectangle:{get:de.throwInstantiationError},projection:{get:de.throwInstantiationError}});cC.prototype.getNumberOfXTilesAtLevel=de.throwInstantiationError;cC.prototype.getNumberOfYTilesAtLevel=de.throwInstantiationError;cC.prototype.rectangleToNativeRectangle=de.throwInstantiationError;cC.prototype.tileXYToNativeRectangle=de.throwInstantiationError;cC.prototype.tileXYToRectangle=de.throwInstantiationError;cC.prototype.positionToTileXY=de.throwInstantiationError;var Wbe=cC;function Q0(e){e=e??V.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??Ze.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Q0.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(Q0.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=tyt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Q0.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,fe(this)};Q0.prototype.isDestroyed=function(){return!1};Q0.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};Q0.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=this.epoch??Ze.MINIMUM_VALUE,a=X.secondsDifference(o,r),s=t.duration,c,u=t.currentTime;t.loop?(a=a%s,a<0&&(a=s-a),c=a):a>s?c=s:a<0?c=0:c=a;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function tyt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var jbe=Q0;function nyt(e,t){this.rectangle=e,this.maxLevel=t}function Ybe(e){this.ellipsoid=e.ellipsoid??te.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}Ybe.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 iyt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ji({ellipsoid:e.ellipsoid});else throw new ue(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Yo.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 a=o[r],s=D.toRadians(parseFloat(a.getAttribute("minx"))),c=D.toRadians(parseFloat(a.getAttribute("miny"))),u=D.toRadians(parseFloat(a.getAttribute("maxx"))),f=D.toRadians(parseFloat(a.getAttribute("maxy"))),h=parseInt(a.getAttribute("maxlevel"),10);e.rectangles.push(new nyt(new ce(s,c,u,f),h))}}function oyt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ue(i)}async function ryt(e,t,n){try{let i=await t.fetchXML();iyt(e,i)}catch(i){oyt(t,i,n)}}function lC(e){e=e??V.EMPTY_OBJECT,this._errorEvent=new _e,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(lC.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(){}}});lC.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=new Ybe(t),i=De.createIfNeeded(e);await ryt(n,i);let o=new lC(t);return n.build(o),o._resource=i,o};lC.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),a=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(a))return;let s=this;return Promise.resolve(a).then(function(c){return new Xc({buffer:mm(c),width:s._heightmapWidth,height:s._heightmapHeight,childTileMask:ayt(s,e,t,n),structure:s._terrainDataStructure})})};lC.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var qbe=new ce;function ayt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,a=o.tileXYToRectangle(t,n,i),s=0;for(let c=0;c<r.length&&s!==15;++c){let u=r[c];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,a,qbe);l(h)&&(e8(o,f,t*2,n*2,i+1)&&(s|=4),e8(o,f,t*2+1,n*2,i+1)&&(s|=8),e8(o,f,t*2,n*2+1,i+1)&&(s|=1),e8(o,f,t*2+1,n*2+1,i+1)&&(s|=2))}return s}function e8(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(ce.intersection(r,t,qbe))}lC.prototype.getTileDataAvailable=function(e,t,n){};lC.prototype.loadTileDataAvailability=function(e,t,n){};var Kbe=lC;var syt={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},Xbe=Object.freeze(syt);function cyt(e){switch(e){case ee.FLOAT:return"float";case ee.FLOAT_VEC2:return"vec2";case ee.FLOAT_VEC3:return"vec3";case ee.FLOAT_VEC4:return"vec4";case ee.FLOAT_MAT2:return"mat2";case ee.FLOAT_MAT3:return"mat3";case ee.FLOAT_MAT4:return"mat4";case ee.SAMPLER_2D:return"sampler2D";case ee.BOOL:return"bool"}}var Jbe=cyt;function lyt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var t8=lyt;var WP=`#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 n8=`in vec2 v_textureCoordinates;
|
|
const float M_PI = 3.141592653589793;
|
|
|
|
float vdcRadicalInverse(int i)
|
|
{
|
|
float r;
|
|
float base = 2.0;
|
|
float value = 0.0;
|
|
float invBase = 1.0 / base;
|
|
float invBi = invBase;
|
|
for (int x = 0; x < 100; x++)
|
|
{
|
|
if (i <= 0)
|
|
{
|
|
break;
|
|
}
|
|
r = mod(float(i), base);
|
|
value += r * invBi;
|
|
invBi *= invBase;
|
|
i = int(float(i) * invBase);
|
|
}
|
|
return value;
|
|
}
|
|
|
|
vec2 hammersley2D(int i, int N)
|
|
{
|
|
return vec2(float(i) / float(N), vdcRadicalInverse(i));
|
|
}
|
|
|
|
vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
|
|
{
|
|
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
|
|
float phi = 2.0 * M_PI * xi.x;
|
|
float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
|
|
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
|
|
vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
|
|
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
|
|
vec3 tangentX = normalize(cross(upVector, N));
|
|
vec3 tangentY = cross(N, tangentX);
|
|
return tangentX * H.x + tangentY * H.y + N * H.z;
|
|
}
|
|
|
|
/**
|
|
* Estimate the geometric self-shadowing of the microfacets in a surface,
|
|
* using the Smith Joint GGX visibility function.
|
|
* Note: Vis = G / (4 * NdotL * NdotV)
|
|
* see Eric Heitz. 2014. Understanding the Masking-Shadowing Function in Microfacet-Based BRDFs. Journal of Computer Graphics Techniques, 3
|
|
* see Real-Time Rendering. Page 331 to 336.
|
|
* see https://google.github.io/filament/Filament.md.html#materialsystem/specularbrdf/geometricshadowing(specularg)
|
|
*
|
|
* @param {float} alphaRoughness The roughness of the material, expressed as the square of perceptual roughness.
|
|
* @param {float} NdotL The cosine of the angle between the surface normal and the direction to the light source.
|
|
* @param {float} NdotV The cosine of the angle between the surface normal and the direction to the camera.
|
|
*/
|
|
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
|
|
{
|
|
float alphaRoughnessSq = alphaRoughness * alphaRoughness;
|
|
|
|
float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
|
|
float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
|
|
|
|
float GGX = GGXV + GGXL; // 2.0 if NdotL = NdotV = 1.0
|
|
if (GGX > 0.0)
|
|
{
|
|
return 0.5 / GGX; // 1/4 if NdotL = NdotV = 1.0
|
|
}
|
|
return 0.0;
|
|
}
|
|
|
|
vec2 integrateBrdf(float roughness, float NdotV)
|
|
{
|
|
vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
|
|
float A = 0.0;
|
|
float B = 0.0;
|
|
const int NumSamples = 1024;
|
|
float alphaRoughness = roughness * roughness;
|
|
for (int i = 0; i < NumSamples; i++)
|
|
{
|
|
vec2 xi = hammersley2D(i, NumSamples);
|
|
vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
|
|
vec3 L = 2.0 * dot(V, H) * H - V;
|
|
float NdotL = clamp(L.z, 0.0, 1.0);
|
|
float NdotH = clamp(H.z, 0.0, 1.0);
|
|
float VdotH = clamp(dot(V, H), 0.0, 1.0);
|
|
if (NdotL > 0.0)
|
|
{
|
|
float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
|
|
float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
|
|
float Fc = pow(1.0 - VdotH, 5.0);
|
|
A += (1.0 - Fc) * G_Vis;
|
|
B += Fc * G_Vis;
|
|
}
|
|
}
|
|
return vec2(A, B) / float(NumSamples);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
|
|
}
|
|
`;var i8=`uniform sampler2D u_noiseTexture;
|
|
uniform vec3 u_noiseTextureDimensions;
|
|
uniform float u_noiseDetail;
|
|
in vec2 v_offset;
|
|
in vec3 v_maximumSize;
|
|
in vec4 v_color;
|
|
in float v_slice;
|
|
in float v_brightness;
|
|
|
|
float wrap(float value, float rangeLength) {
|
|
if(value < 0.0) {
|
|
float absValue = abs(value);
|
|
float modValue = mod(absValue, rangeLength);
|
|
return mod(rangeLength - modValue, rangeLength);
|
|
}
|
|
return mod(value, rangeLength);
|
|
}
|
|
|
|
vec3 wrapVec(vec3 value, float rangeLength) {
|
|
return vec3(wrap(value.x, rangeLength),
|
|
wrap(value.y, rangeLength),
|
|
wrap(value.z, rangeLength));
|
|
}
|
|
|
|
vec2 voxelToUV(vec3 voxelIndex) {
|
|
float textureSliceWidth = u_noiseTextureDimensions.x;
|
|
float noiseTextureRows = u_noiseTextureDimensions.y;
|
|
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
|
|
|
|
float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
|
|
vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
|
|
inverseNoiseTextureRows / textureSliceWidth);
|
|
vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
|
|
float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
|
|
float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);
|
|
|
|
float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
|
|
float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
|
|
return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
|
|
}
|
|
|
|
// Interpolate a voxel with its neighbor (along the positive X-axis)
|
|
vec4 lerpSamplesX(vec3 voxelIndex, float x) {
|
|
vec2 uv0 = voxelToUV(voxelIndex);
|
|
vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
|
|
vec4 sample0 = texture(u_noiseTexture, uv0);
|
|
vec4 sample1 = texture(u_noiseTexture, uv1);
|
|
return mix(sample0, sample1, x);
|
|
}
|
|
|
|
vec4 sampleNoiseTexture(vec3 position) {
|
|
float textureSliceWidth = u_noiseTextureDimensions.x;
|
|
vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
|
|
vec3 lerpValue = fract(recenteredPos);
|
|
vec3 voxelIndex = floor(recenteredPos);
|
|
|
|
vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
|
|
vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
|
|
vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
|
|
vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);
|
|
|
|
vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
|
|
vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
|
|
return mix(yLerp0, yLerp1, lerpValue.z);
|
|
}
|
|
|
|
// Intersection with a unit sphere with radius 0.5 at center (0, 0, 0).
|
|
bool intersectSphere(vec3 origin, vec3 dir, float slice,
|
|
out vec3 point, out vec3 normal) {
|
|
float A = dot(dir, dir);
|
|
float B = dot(origin, dir);
|
|
float C = dot(origin, origin) - 0.25;
|
|
float discriminant = (B * B) - (A * C);
|
|
if(discriminant < 0.0) {
|
|
return false;
|
|
}
|
|
float root = sqrt(discriminant);
|
|
float t = (-B - root) / A;
|
|
if(t < 0.0) {
|
|
t = (-B + root) / A;
|
|
}
|
|
point = origin + t * dir;
|
|
|
|
if(slice >= 0.0) {
|
|
point.z = (slice / 2.0) - 0.5;
|
|
if(length(point) > 0.5) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
normal = normalize(point);
|
|
point -= czm_epsilon2 * normal;
|
|
return true;
|
|
}
|
|
|
|
// Transforms the ray origin and direction into unit sphere space,
|
|
// then transforms the result back into the ellipsoid's space.
|
|
bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
|
|
out vec3 point, out vec3 normal) {
|
|
if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
|
|
return false;
|
|
}
|
|
|
|
vec3 o = (origin - center) / scale;
|
|
vec3 d = dir / scale;
|
|
vec3 p, n;
|
|
bool intersected = intersectSphere(o, d, slice, p, n);
|
|
if(intersected) {
|
|
point = (p * scale) + center;
|
|
normal = n;
|
|
}
|
|
return intersected;
|
|
}
|
|
|
|
// Assume that if phase shift is being called for octave i,
|
|
// the frequency is of i - 1. This saves us from doing extra
|
|
// division / multiplication operations.
|
|
vec2 phaseShift2D(vec2 p, vec2 freq) {
|
|
return (czm_pi / 2.0) * sin(freq.yx * p.yx);
|
|
}
|
|
|
|
vec2 phaseShift3D(vec3 p, vec2 freq) {
|
|
return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
|
|
}
|
|
|
|
// The cloud texture function derived from Gardner's 1985 paper,
|
|
// "Visual Simulation of Clouds."
|
|
// https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf
|
|
const float T0 = 0.6; // contrast of the texture pattern
|
|
const float k = 0.1; // computed to produce a maximum value of 1
|
|
const float C0 = 0.8; // coefficient
|
|
const float FX0 = 0.6; // frequency X
|
|
const float FY0 = 0.6; // frequency Y
|
|
const int octaves = 5;
|
|
|
|
float T(vec3 point) {
|
|
vec2 sum = vec2(0.0);
|
|
float Ci = C0;
|
|
vec2 FXY = vec2(FX0, FY0);
|
|
vec2 PXY = vec2(0.0);
|
|
for(int i = 1; i <= octaves; i++) {
|
|
PXY = phaseShift3D(point, FXY);
|
|
Ci *= 0.707;
|
|
FXY *= 2.0;
|
|
vec2 sinTerm = sin(FXY * point.xy + PXY);
|
|
sum += Ci * sinTerm + vec2(T0);
|
|
}
|
|
return k * sum.x * sum.y;
|
|
}
|
|
|
|
const float a = 0.5; // fraction of surface reflection due to ambient or scattered light,
|
|
const float t = 0.4; // fraction of texture shading
|
|
const float s = 0.25; // fraction of specular reflection
|
|
|
|
float I(float Id, float Is, float It) {
|
|
return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
|
|
}
|
|
|
|
const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));
|
|
|
|
vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
|
|
float brightness) {
|
|
vec3 cloudPoint, cloudNormal;
|
|
if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
|
|
cloudPoint, cloudNormal)) {
|
|
return vec4(0.0);
|
|
}
|
|
|
|
float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection
|
|
float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection
|
|
float It = T(cloudPoint); // texture function
|
|
float intensity = I(Id, Is, It);
|
|
vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));
|
|
|
|
vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
|
|
float W = noise.x;
|
|
float W2 = noise.y;
|
|
float W3 = noise.z;
|
|
|
|
// The dot product between the cloud's normal and the ray's direction is greatest
|
|
// in the center of the ellipsoid's surface. It decreases towards the edge.
|
|
// Thus, it is used to blur the areas leading to the edges of the ellipsoid,
|
|
// so that no harsh lines appear.
|
|
|
|
// The first (and biggest) layer of worley noise is then subtracted from this.
|
|
// The final result is scaled up so that the base cloud is not too translucent.
|
|
float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
|
|
float TR = pow(ndDot, 3.0) - W; // translucency
|
|
TR *= 1.3;
|
|
|
|
// Subtracting the second and third layers of worley noise is more complicated.
|
|
// If these layers of noise were simply subtracted from the current translucency,
|
|
// the shape derived from the first layer of noise would be completely deleted.
|
|
// The erosion of this noise should thus be constricted to the edges of the cloud.
|
|
// However, because the edges of the ellipsoid were already blurred away, mapping
|
|
// the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance.
|
|
// The value of (0.5 - ndDot) provides the best compromise.
|
|
float minusDot = 0.5 - ndDot;
|
|
|
|
// Even with the previous calculation, subtracting the second layer of wnoise
|
|
// erode too much of the cloud. The addition of it, however, will detailed
|
|
// volume to the cloud. As long as the noise is only added and not subtracted,
|
|
// the results are aesthetically pleasing.
|
|
|
|
// The minusDot product is mapped in a way that it is larger at the edges of
|
|
// the ellipsoid, so a subtraction and min operation are used instead of
|
|
// an addition and max one.
|
|
TR -= min(minusDot * W2, 0.0);
|
|
|
|
// The third level of worley noise is subtracted from the result, with some
|
|
// modifications. First, a scalar is added to minusDot so that the noise
|
|
// starts affecting the shape farther away from the center of the ellipsoid's
|
|
// surface. Then, it is scaled down so its impact is not too intense.
|
|
TR -= 0.8 * (minusDot + 0.25) * W3;
|
|
|
|
// The texture function's shading does not correlate with the shape of the cloud
|
|
// produced by the layers of noise, so an extra shading scalar is calculated.
|
|
// The darkest areas of the cloud are assigned to be where the noise erodes
|
|
// the cloud the most. This is then interpolated based on the translucency
|
|
// and the diffuse shading term of that point in the cloud.
|
|
float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
|
|
|
|
// To avoid values that are too dark, this scalar is increased by a small amount
|
|
// and clamped so it never goes to zero.
|
|
shading = clamp(shading + 0.2, 0.3, 1.0);
|
|
|
|
// Finally, the contrast of the cloud's color is increased.
|
|
vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
|
|
return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
|
|
}
|
|
|
|
void main() {
|
|
#ifdef DEBUG_BILLBOARDS
|
|
out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
|
|
#endif
|
|
// To avoid calculations with high values,
|
|
// we raycast from an arbitrarily smaller space.
|
|
vec2 coordinate = v_maximumSize.xy * v_offset;
|
|
|
|
vec3 ellipsoidScale = 0.82 * v_maximumSize;
|
|
vec3 ellipsoidCenter = vec3(0.0);
|
|
|
|
float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
|
|
vec3 eye = vec3(0, 0, -10.0 - zOffset);
|
|
vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
|
|
vec3 rayOrigin = eye;
|
|
#ifdef DEBUG_ELLIPSOIDS
|
|
vec3 point, normal;
|
|
if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
|
|
point, normal)) {
|
|
out_FragColor = v_brightness * v_color;
|
|
}
|
|
#else
|
|
#ifndef DEBUG_BILLBOARDS
|
|
vec4 cloud = drawCloud(rayOrigin, rayDir,
|
|
ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
|
|
if(cloud.w < 0.01) {
|
|
discard;
|
|
}
|
|
out_FragColor = cloud;
|
|
#endif
|
|
#endif
|
|
}
|
|
`;var o8=`#ifdef INSTANCED
|
|
in vec2 direction;
|
|
#endif
|
|
in vec4 positionHighAndScaleX;
|
|
in vec4 positionLowAndScaleY;
|
|
in vec4 packedAttribute0;
|
|
in vec4 packedAttribute1;
|
|
in vec4 color;
|
|
|
|
out vec2 v_offset;
|
|
out vec3 v_maximumSize;
|
|
out vec4 v_color;
|
|
out float v_slice;
|
|
out float v_brightness;
|
|
|
|
void main() {
|
|
// Unpack attributes.
|
|
vec3 positionHigh = positionHighAndScaleX.xyz;
|
|
vec3 positionLow = positionLowAndScaleY.xyz;
|
|
vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);
|
|
|
|
float show = packedAttribute0.x;
|
|
float brightness = packedAttribute0.y;
|
|
vec2 coordinates = packedAttribute0.wz;
|
|
vec3 maximumSize = packedAttribute1.xyz;
|
|
float slice = packedAttribute1.w;
|
|
|
|
#ifdef INSTANCED
|
|
vec2 dir = direction;
|
|
#else
|
|
vec2 dir = coordinates;
|
|
#endif
|
|
|
|
vec2 offset = dir - vec2(0.5, 0.5);
|
|
vec2 scaledOffset = scale * offset;
|
|
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
|
|
vec4 positionEC = czm_modelViewRelativeToEye * p;
|
|
positionEC.xy += scaledOffset;
|
|
|
|
positionEC.xyz *= show;
|
|
gl_Position = czm_projection * positionEC;
|
|
|
|
v_offset = offset;
|
|
v_maximumSize = maximumSize;
|
|
v_color = color;
|
|
v_slice = slice;
|
|
v_brightness = brightness;
|
|
}
|
|
`;var r8=`uniform vec3 u_noiseTextureDimensions;
|
|
uniform float u_noiseDetail;
|
|
uniform vec3 u_noiseOffset;
|
|
in vec2 v_position;
|
|
|
|
float wrap(float value, float rangeLength) {
|
|
if(value < 0.0) {
|
|
float absValue = abs(value);
|
|
float modValue = mod(absValue, rangeLength);
|
|
return mod(rangeLength - modValue, rangeLength);
|
|
}
|
|
return mod(value, rangeLength);
|
|
}
|
|
|
|
vec3 wrapVec(vec3 value, float rangeLength) {
|
|
return vec3(wrap(value.x, rangeLength),
|
|
wrap(value.y, rangeLength),
|
|
wrap(value.z, rangeLength));
|
|
}
|
|
|
|
vec3 random3(vec3 p) {
|
|
float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
|
|
float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
|
|
return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
|
|
}
|
|
|
|
// Frequency corresponds to cell size.
|
|
// The higher the frequency, the smaller the cell size.
|
|
vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
|
|
float textureSliceWidth = u_noiseTextureDimensions.x;
|
|
vec3 cell = centerCell + offset;
|
|
cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
|
|
cell += floor(u_noiseOffset / u_noiseDetail);
|
|
vec3 p = offset + random3(cell);
|
|
return p;
|
|
}
|
|
|
|
float worleyNoise(vec3 p, float freq) {
|
|
vec3 centerCell = floor(p * freq);
|
|
vec3 pointInCell = fract(p * freq);
|
|
float shortestDistance = 1000.0;
|
|
|
|
for(float z = -1.0; z <= 1.0; z++) {
|
|
for(float y = -1.0; y <= 1.0; y++) {
|
|
for(float x = -1.0; x <= 1.0; x++) {
|
|
vec3 offset = vec3(x, y, z);
|
|
vec3 point = getWorleyCellPoint(centerCell, offset, freq);
|
|
|
|
float distance = length(pointInCell - point);
|
|
if(distance < shortestDistance) {
|
|
shortestDistance = distance;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
return shortestDistance;
|
|
}
|
|
|
|
const float MAX_FBM_ITERATIONS = 10.0;
|
|
|
|
float worleyFBMNoise(vec3 p, float octaves, float scale) {
|
|
float noise = 0.0;
|
|
float freq = 1.0;
|
|
float persistence = 0.625;
|
|
for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
|
|
if(i >= octaves) {
|
|
break;
|
|
}
|
|
|
|
noise += worleyNoise(p * scale, freq * scale) * persistence;
|
|
persistence *= 0.5;
|
|
freq *= 2.0;
|
|
}
|
|
return noise;
|
|
}
|
|
|
|
void main() {
|
|
float textureSliceWidth = u_noiseTextureDimensions.x;
|
|
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
|
|
float x = mod(v_position.x, textureSliceWidth);
|
|
float y = mod(v_position.y, textureSliceWidth);
|
|
float sliceRow = floor(v_position.y / textureSliceWidth);
|
|
float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;
|
|
|
|
vec3 position = vec3(x, y, z);
|
|
position /= u_noiseDetail;
|
|
float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
|
|
float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
|
|
float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
|
|
out_FragColor = vec4(worley0, worley1, worley2, 1.0);
|
|
}
|
|
`;var a8=`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 s8=`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 c8=`/**
|
|
* Compositing for Weighted Blended Order-Independent Transparency. See:
|
|
* - http://jcgt.org/published/0002/02/09/
|
|
* - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html
|
|
*/
|
|
|
|
uniform sampler2D u_opaque;
|
|
uniform sampler2D u_accumulation;
|
|
uniform sampler2D u_revealage;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
vec4 opaque = texture(u_opaque, v_textureCoordinates);
|
|
vec4 accum = texture(u_accumulation, v_textureCoordinates);
|
|
float r = texture(u_revealage, v_textureCoordinates).r;
|
|
|
|
#ifdef MRT
|
|
vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
|
|
#else
|
|
vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
|
|
#endif
|
|
|
|
out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
|
|
|
|
if (opaque != czm_backgroundColor)
|
|
{
|
|
out_FragColor.a = 1.0;
|
|
}
|
|
}
|
|
`;var l8=`uniform mat3 u_cubeMapPanoramaTransform;
|
|
|
|
in vec3 position;
|
|
out vec3 v_texCoord;
|
|
|
|
void main()
|
|
{
|
|
vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * position));
|
|
gl_Position = czm_projection * vec4(p, 1.0);
|
|
v_texCoord = position.xyz;
|
|
}
|
|
`;var u8=`in vec4 positionEC;
|
|
|
|
void main()
|
|
{
|
|
vec3 position;
|
|
vec3 direction;
|
|
if (czm_orthographicIn3D == 1.0)
|
|
{
|
|
vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
|
|
vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom
|
|
vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top
|
|
position = vec3(mix(minPlane, maxPlane, uv), 0.0);
|
|
direction = vec3(0.0, 0.0, -1.0);
|
|
}
|
|
else
|
|
{
|
|
position = vec3(0.0);
|
|
direction = normalize(positionEC.xyz);
|
|
}
|
|
|
|
czm_ray ray = czm_ray(position, direction);
|
|
|
|
vec3 ellipsoid_center = czm_view[3].xyz;
|
|
|
|
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
|
|
if (!czm_isEmpty(intersection))
|
|
{
|
|
out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
|
|
}
|
|
else
|
|
{
|
|
discard;
|
|
}
|
|
|
|
czm_writeLogDepth();
|
|
}
|
|
`;var f8=`in vec4 position;
|
|
|
|
out vec4 positionEC;
|
|
|
|
void main()
|
|
{
|
|
positionEC = czm_modelView * position;
|
|
gl_Position = czm_projection * positionEC;
|
|
|
|
czm_vertexLogDepth();
|
|
}
|
|
`;var jP=`uniform vec3 u_radii;
|
|
uniform vec3 u_oneOverEllipsoidRadiiSquared;
|
|
|
|
in vec3 v_positionEC;
|
|
|
|
vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
|
|
{
|
|
vec3 positionEC = czm_pointAlongRay(ray, intersection);
|
|
vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
|
|
vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
|
|
vec3 sphericalNormal = normalize(positionMC / u_radii);
|
|
vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates
|
|
vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordinates
|
|
|
|
vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal);
|
|
vec3 positionToEyeEC = -positionEC;
|
|
|
|
czm_materialInput materialInput;
|
|
materialInput.s = st.s;
|
|
materialInput.st = st;
|
|
materialInput.str = (positionMC + u_radii) / u_radii;
|
|
materialInput.normalEC = normalEC;
|
|
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
|
|
materialInput.positionToEyeEC = positionToEyeEC;
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
|
|
#ifdef ONLY_SUN_LIGHTING
|
|
return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
|
|
#else
|
|
return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
#endif
|
|
}
|
|
|
|
void main()
|
|
{
|
|
// PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii
|
|
// in the vertex shader. Only when it is larger than some constant, march along the ray.
|
|
// Otherwise perform one intersection test which will be the common case.
|
|
|
|
// Test if the ray intersects a sphere with the ellipsoid's maximum radius.
|
|
// For very oblate ellipsoids, using the ellipsoid's radii for an intersection test
|
|
// may cause false negatives. This will discard fragments before marching the ray forward.
|
|
float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
|
|
vec3 direction = normalize(v_positionEC);
|
|
vec3 ellipsoidCenter = czm_modelView[3].xyz;
|
|
|
|
float t1 = -1.0;
|
|
float t2 = -1.0;
|
|
|
|
float b = -2.0 * dot(direction, ellipsoidCenter);
|
|
float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;
|
|
|
|
float discriminant = b * b - 4.0 * c;
|
|
if (discriminant >= 0.0) {
|
|
t1 = (-b - sqrt(discriminant)) * 0.5;
|
|
t2 = (-b + sqrt(discriminant)) * 0.5;
|
|
}
|
|
|
|
if (t1 < 0.0 && t2 < 0.0) {
|
|
discard;
|
|
}
|
|
|
|
float t = min(t1, t2);
|
|
if (t < 0.0) {
|
|
t = 0.0;
|
|
}
|
|
|
|
// March ray forward to intersection with larger sphere and find
|
|
czm_ray ray = czm_ray(t * direction, direction);
|
|
|
|
vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);
|
|
|
|
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
|
|
|
|
if (czm_isEmpty(intersection))
|
|
{
|
|
discard;
|
|
}
|
|
|
|
// If the viewer is outside, compute outsideFaceColor, with normals facing outward.
|
|
vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
|
|
|
|
// If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward.
|
|
vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);
|
|
|
|
out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
|
|
out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);
|
|
|
|
#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
|
|
t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
|
|
vec3 positionEC = czm_pointAlongRay(ray, t);
|
|
vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
|
|
#ifdef LOG_DEPTH
|
|
czm_writeLogDepth(1.0 + positionCC.w);
|
|
#else
|
|
float z = positionCC.z / positionCC.w;
|
|
|
|
float n = czm_depthRange.near;
|
|
float f = czm_depthRange.far;
|
|
|
|
gl_FragDepth = (z * (f - n) + f + n) * 0.5;
|
|
#endif
|
|
#endif
|
|
}
|
|
`;var YP=`in vec3 position;
|
|
|
|
uniform vec3 u_radii;
|
|
|
|
out vec3 v_positionEC;
|
|
|
|
void main()
|
|
{
|
|
// In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates.
|
|
// Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry,
|
|
// but doing it here allows us to change the radii without rewriting the vertex data, and
|
|
// allows all ellipsoids to reuse the same vertex data.
|
|
vec4 p = vec4(u_radii * position, 1.0);
|
|
|
|
vec4 pEC = czm_modelView * p;
|
|
v_positionEC = pEC.xyz; // position in eye coordinates
|
|
gl_Position = czm_projection * pEC;
|
|
// With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums
|
|
// and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the
|
|
// ellipsoid (does not write depth) that was rendered in the farther frustum.
|
|
//
|
|
// Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates
|
|
// artifacts since some fragments can be alpha blended twice. This is solved by only rendering
|
|
// the ellipsoid in the closest frustum to the viewer.
|
|
gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
|
|
|
|
czm_vertexLogDepth();
|
|
}
|
|
`;/**
|
|
* @license
|
|
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* * Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
* * Neither the name of NVIDIA CORPORATION nor the names of its
|
|
* contributors may be used to endorse or promote products derived
|
|
* from this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*/var d8=`/**
|
|
* @license
|
|
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
|
|
*
|
|
* Redistribution and use in source and binary forms, with or without
|
|
* modification, are permitted provided that the following conditions
|
|
* are met:
|
|
* * Redistributions of source code must retain the above copyright
|
|
* notice, this list of conditions and the following disclaimer.
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
* documentation and/or other materials provided with the distribution.
|
|
* * Neither the name of NVIDIA CORPORATION nor the names of its
|
|
* contributors may be used to endorse or promote products derived
|
|
* from this software without specific prior written permission.
|
|
*
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY
|
|
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
|
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
*/
|
|
|
|
// NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples
|
|
// Original source (archived): https://archive.org/details/nvidiagame-works-graphics-samples-master
|
|
// Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h
|
|
// Shader link in fork: https://github.com/lyntel/GraphicsSamples/blob/3d30817ebeeade64fe6a4fc3aa1fe4265c29b6fd/samples/es3-kepler/FXAA/FXAA3_11.h
|
|
|
|
// Steps used to integrate into Cesium:
|
|
// * The following defines are set:
|
|
// #define FXAA_PC 1
|
|
// #define FXAA_WEBGL_1 1
|
|
// #define FXAA_GREEN_AS_LUMA 1
|
|
// #define FXAA_EARLY_EXIT 1
|
|
// #define FXAA_GLSL_120 1
|
|
// * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed.
|
|
// * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace
|
|
// /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/.
|
|
// * There are no implicit conversions from ivec* to vec* so replace:
|
|
// #define FxaaInt2 ivec2
|
|
// with
|
|
// #define FxaaInt2 vec2
|
|
// * The texture2DLod function is only available in vertex shaders so replace:
|
|
// #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0)
|
|
// #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0)
|
|
// with
|
|
// #define FxaaTexTop(t, p) texture(t, p)
|
|
// #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
|
|
// * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future.
|
|
// * The following parameters to FxaaPixelShader are unused and can be removed:
|
|
// fxaaConsolePosPos
|
|
// fxaaConsoleRcpFrameOpt
|
|
// fxaaConsoleRcpFrameOpt2
|
|
// fxaaConsole360RcpFrameOpt2
|
|
// fxaaConsoleEdgeSharpness
|
|
// fxaaConsoleEdgeThreshold
|
|
// fxaaConsoleEdgeThresholdMi
|
|
// fxaaConsole360ConstDir
|
|
|
|
//
|
|
// Choose the quality preset.
|
|
// This needs to be compiled into the shader as it effects code.
|
|
// Best option to include multiple presets is to
|
|
// in each shader define the preset, then include this file.
|
|
//
|
|
// OPTIONS
|
|
// -----------------------------------------------------------------------
|
|
// 10 to 15 - default medium dither (10=fastest, 15=highest quality)
|
|
// 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality)
|
|
// 39 - no dither, very expensive
|
|
//
|
|
// NOTES
|
|
// -----------------------------------------------------------------------
|
|
// 12 = slightly faster then FXAA 3.9 and higher edge quality (default)
|
|
// 13 = about same speed as FXAA 3.9 and better than 12
|
|
// 23 = closest to FXAA 3.9 visually and performance wise
|
|
// _ = the lowest digit is directly related to performance
|
|
// _ = the highest digit is directly related to style
|
|
//
|
|
//#define FXAA_QUALITY_PRESET 12
|
|
|
|
|
|
#if (FXAA_QUALITY_PRESET == 10)
|
|
#define FXAA_QUALITY_PS 3
|
|
#define FXAA_QUALITY_P0 1.5
|
|
#define FXAA_QUALITY_P1 3.0
|
|
#define FXAA_QUALITY_P2 12.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 11)
|
|
#define FXAA_QUALITY_PS 4
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 3.0
|
|
#define FXAA_QUALITY_P3 12.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 12)
|
|
#define FXAA_QUALITY_PS 5
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 4.0
|
|
#define FXAA_QUALITY_P4 12.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 13)
|
|
#define FXAA_QUALITY_PS 6
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 4.0
|
|
#define FXAA_QUALITY_P5 12.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 14)
|
|
#define FXAA_QUALITY_PS 7
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 4.0
|
|
#define FXAA_QUALITY_P6 12.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 15)
|
|
#define FXAA_QUALITY_PS 8
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 2.0
|
|
#define FXAA_QUALITY_P6 4.0
|
|
#define FXAA_QUALITY_P7 12.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 20)
|
|
#define FXAA_QUALITY_PS 3
|
|
#define FXAA_QUALITY_P0 1.5
|
|
#define FXAA_QUALITY_P1 2.0
|
|
#define FXAA_QUALITY_P2 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 21)
|
|
#define FXAA_QUALITY_PS 4
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 22)
|
|
#define FXAA_QUALITY_PS 5
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 23)
|
|
#define FXAA_QUALITY_PS 6
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 24)
|
|
#define FXAA_QUALITY_PS 7
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 3.0
|
|
#define FXAA_QUALITY_P6 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 25)
|
|
#define FXAA_QUALITY_PS 8
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 2.0
|
|
#define FXAA_QUALITY_P6 4.0
|
|
#define FXAA_QUALITY_P7 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 26)
|
|
#define FXAA_QUALITY_PS 9
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 2.0
|
|
#define FXAA_QUALITY_P6 2.0
|
|
#define FXAA_QUALITY_P7 4.0
|
|
#define FXAA_QUALITY_P8 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 27)
|
|
#define FXAA_QUALITY_PS 10
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 2.0
|
|
#define FXAA_QUALITY_P6 2.0
|
|
#define FXAA_QUALITY_P7 2.0
|
|
#define FXAA_QUALITY_P8 4.0
|
|
#define FXAA_QUALITY_P9 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 28)
|
|
#define FXAA_QUALITY_PS 11
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 2.0
|
|
#define FXAA_QUALITY_P6 2.0
|
|
#define FXAA_QUALITY_P7 2.0
|
|
#define FXAA_QUALITY_P8 2.0
|
|
#define FXAA_QUALITY_P9 4.0
|
|
#define FXAA_QUALITY_P10 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 29)
|
|
#define FXAA_QUALITY_PS 12
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.5
|
|
#define FXAA_QUALITY_P2 2.0
|
|
#define FXAA_QUALITY_P3 2.0
|
|
#define FXAA_QUALITY_P4 2.0
|
|
#define FXAA_QUALITY_P5 2.0
|
|
#define FXAA_QUALITY_P6 2.0
|
|
#define FXAA_QUALITY_P7 2.0
|
|
#define FXAA_QUALITY_P8 2.0
|
|
#define FXAA_QUALITY_P9 2.0
|
|
#define FXAA_QUALITY_P10 4.0
|
|
#define FXAA_QUALITY_P11 8.0
|
|
#endif
|
|
#if (FXAA_QUALITY_PRESET == 39)
|
|
#define FXAA_QUALITY_PS 12
|
|
#define FXAA_QUALITY_P0 1.0
|
|
#define FXAA_QUALITY_P1 1.0
|
|
#define FXAA_QUALITY_P2 1.0
|
|
#define FXAA_QUALITY_P3 1.0
|
|
#define FXAA_QUALITY_P4 1.0
|
|
#define FXAA_QUALITY_P5 1.5
|
|
#define FXAA_QUALITY_P6 2.0
|
|
#define FXAA_QUALITY_P7 2.0
|
|
#define FXAA_QUALITY_P8 2.0
|
|
#define FXAA_QUALITY_P9 2.0
|
|
#define FXAA_QUALITY_P10 4.0
|
|
#define FXAA_QUALITY_P11 8.0
|
|
#endif
|
|
|
|
#define FxaaBool bool
|
|
#define FxaaFloat float
|
|
#define FxaaFloat2 vec2
|
|
#define FxaaFloat3 vec3
|
|
#define FxaaFloat4 vec4
|
|
#define FxaaHalf float
|
|
#define FxaaHalf2 vec2
|
|
#define FxaaHalf3 vec3
|
|
#define FxaaHalf4 vec4
|
|
#define FxaaInt2 vec2
|
|
#define FxaaTex sampler2D
|
|
|
|
#define FxaaSat(x) clamp(x, 0.0, 1.0)
|
|
#define FxaaTexTop(t, p) texture(t, p)
|
|
#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
|
|
|
|
FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
|
|
|
|
FxaaFloat4 FxaaPixelShader(
|
|
//
|
|
// Use noperspective interpolation here (turn off perspective interpolation).
|
|
// {xy} = center of pixel
|
|
FxaaFloat2 pos,
|
|
//
|
|
// Input color texture.
|
|
// {rgb_} = color in linear or perceptual color space
|
|
// if (FXAA_GREEN_AS_LUMA == 0)
|
|
// {___a} = luma in perceptual color space (not linear)
|
|
FxaaTex tex,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This must be from a constant/uniform.
|
|
// {x_} = 1.0/screenWidthInPixels
|
|
// {_y} = 1.0/screenHeightInPixels
|
|
FxaaFloat2 fxaaQualityRcpFrame,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This used to be the FXAA_QUALITY_SUBPIX define.
|
|
// It is here now to allow easier tuning.
|
|
// Choose the amount of sub-pixel aliasing removal.
|
|
// This can effect sharpness.
|
|
// 1.00 - upper limit (softer)
|
|
// 0.75 - default amount of filtering
|
|
// 0.50 - lower limit (sharper, less sub-pixel aliasing removal)
|
|
// 0.25 - almost off
|
|
// 0.00 - completely off
|
|
FxaaFloat fxaaQualitySubpix,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This used to be the FXAA_QUALITY_EDGE_THRESHOLD define.
|
|
// It is here now to allow easier tuning.
|
|
// The minimum amount of local contrast required to apply algorithm.
|
|
// 0.333 - too little (faster)
|
|
// 0.250 - low quality
|
|
// 0.166 - default
|
|
// 0.125 - high quality
|
|
// 0.063 - overkill (slower)
|
|
FxaaFloat fxaaQualityEdgeThreshold,
|
|
//
|
|
// Only used on FXAA Quality.
|
|
// This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define.
|
|
// It is here now to allow easier tuning.
|
|
// Trims the algorithm from processing darks.
|
|
// 0.0833 - upper limit (default, the start of visible unfiltered edges)
|
|
// 0.0625 - high quality (faster)
|
|
// 0.0312 - visible limit (slower)
|
|
// Special notes when using FXAA_GREEN_AS_LUMA,
|
|
// Likely want to set this to zero.
|
|
// As colors that are mostly not-green
|
|
// will appear very dark in the green channel!
|
|
// Tune by looking at mostly non-green content,
|
|
// then start at zero and increase until aliasing is a problem.
|
|
FxaaFloat fxaaQualityEdgeThresholdMin
|
|
) {
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat2 posM;
|
|
posM.x = pos.x;
|
|
posM.y = pos.y;
|
|
FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
|
|
#define lumaM rgbyM.y
|
|
FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
|
|
FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
|
|
FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
|
|
FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat maxSM = max(lumaS, lumaM);
|
|
FxaaFloat minSM = min(lumaS, lumaM);
|
|
FxaaFloat maxESM = max(lumaE, maxSM);
|
|
FxaaFloat minESM = min(lumaE, minSM);
|
|
FxaaFloat maxWN = max(lumaN, lumaW);
|
|
FxaaFloat minWN = min(lumaN, lumaW);
|
|
FxaaFloat rangeMax = max(maxWN, maxESM);
|
|
FxaaFloat rangeMin = min(minWN, minESM);
|
|
FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
|
|
FxaaFloat range = rangeMax - rangeMin;
|
|
FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
|
|
FxaaBool earlyExit = range < rangeMaxClamped;
|
|
/*--------------------------------------------------------------------------*/
|
|
if(earlyExit)
|
|
return rgbyM;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
|
|
FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
|
|
FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
|
|
FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat lumaNS = lumaN + lumaS;
|
|
FxaaFloat lumaWE = lumaW + lumaE;
|
|
FxaaFloat subpixRcpRange = 1.0/range;
|
|
FxaaFloat subpixNSWE = lumaNS + lumaWE;
|
|
FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
|
|
FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat lumaNESE = lumaNE + lumaSE;
|
|
FxaaFloat lumaNWNE = lumaNW + lumaNE;
|
|
FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
|
|
FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat lumaNWSW = lumaNW + lumaSW;
|
|
FxaaFloat lumaSWSE = lumaSW + lumaSE;
|
|
FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
|
|
FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
|
|
FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
|
|
FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
|
|
FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
|
|
FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
|
|
FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
|
|
FxaaBool horzSpan = edgeHorz >= edgeVert;
|
|
FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
|
|
/*--------------------------------------------------------------------------*/
|
|
if(!horzSpan) lumaN = lumaW;
|
|
if(!horzSpan) lumaS = lumaE;
|
|
if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
|
|
FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat gradientN = lumaN - lumaM;
|
|
FxaaFloat gradientS = lumaS - lumaM;
|
|
FxaaFloat lumaNN = lumaN + lumaM;
|
|
FxaaFloat lumaSS = lumaS + lumaM;
|
|
FxaaBool pairN = abs(gradientN) >= abs(gradientS);
|
|
FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
|
|
if(pairN) lengthSign = -lengthSign;
|
|
FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat2 posB;
|
|
posB.x = posM.x;
|
|
posB.y = posM.y;
|
|
FxaaFloat2 offNP;
|
|
offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
|
|
offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
|
|
if(!horzSpan) posB.x += lengthSign * 0.5;
|
|
if( horzSpan) posB.y += lengthSign * 0.5;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat2 posN;
|
|
posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
|
|
posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
|
|
FxaaFloat2 posP;
|
|
posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
|
|
posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
|
|
FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
|
|
FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
|
|
FxaaFloat subpixE = subpixC * subpixC;
|
|
FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
|
|
/*--------------------------------------------------------------------------*/
|
|
if(!pairN) lumaNN = lumaSS;
|
|
FxaaFloat gradientScaled = gradient * 1.0/4.0;
|
|
FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
|
|
FxaaFloat subpixF = subpixD * subpixE;
|
|
FxaaBool lumaMLTZero = lumaMM < 0.0;
|
|
/*--------------------------------------------------------------------------*/
|
|
lumaEndN -= lumaNN * 0.5;
|
|
lumaEndP -= lumaNN * 0.5;
|
|
FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
|
|
FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
|
|
FxaaBool doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
|
|
/*--------------------------------------------------------------------------*/
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 3)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 4)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 5)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 6)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 7)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 8)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 9)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 10)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 11)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
|
|
/*--------------------------------------------------------------------------*/
|
|
#if (FXAA_QUALITY_PS > 12)
|
|
if(doneNP) {
|
|
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
|
|
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
|
|
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
|
|
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
|
|
doneN = abs(lumaEndN) >= gradientScaled;
|
|
doneP = abs(lumaEndP) >= gradientScaled;
|
|
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
|
|
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
|
|
doneNP = (!doneN) || (!doneP);
|
|
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
|
|
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
#endif
|
|
/*--------------------------------------------------------------------------*/
|
|
}
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat dstN = posM.x - posN.x;
|
|
FxaaFloat dstP = posP.x - posM.x;
|
|
if(!horzSpan) dstN = posM.y - posN.y;
|
|
if(!horzSpan) dstP = posP.y - posM.y;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
|
|
FxaaFloat spanLength = (dstP + dstN);
|
|
FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
|
|
FxaaFloat spanLengthRcp = 1.0/spanLength;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaBool directionN = dstN < dstP;
|
|
FxaaFloat dst = min(dstN, dstP);
|
|
FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
|
|
FxaaFloat subpixG = subpixF * subpixF;
|
|
FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
|
|
FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
|
|
/*--------------------------------------------------------------------------*/
|
|
FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
|
|
FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
|
|
if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
|
|
if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
|
|
return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
|
|
}
|
|
`;var h8=`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
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
#ifdef APPLY_INVERT_COLOR_MARS3D
|
|
uniform bool u_mars3dTextureInvertColor[TEXTURE_UNITS];
|
|
#endif
|
|
|
|
#ifdef APPLY_FILTER_COLOR_MARS3D
|
|
uniform vec3 u_mars3dTextureFilterColor[TEXTURE_UNITS];
|
|
#endif
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
|
|
#ifdef APPLY_IMAGERY_CUTOUT
|
|
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
|
|
#endif
|
|
|
|
#ifdef APPLY_COLOR_TO_ALPHA
|
|
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
|
|
#endif
|
|
|
|
uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
|
|
#endif
|
|
|
|
#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
|
|
uniform sampler2D u_waterMask;
|
|
uniform vec4 u_waterMaskTranslationAndScale;
|
|
uniform float u_zoomedOutOceanSpecularIntensity;
|
|
#endif
|
|
|
|
#ifdef SHOW_OCEAN_WAVES
|
|
uniform sampler2D u_oceanNormalMap;
|
|
#endif
|
|
|
|
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
|
|
uniform vec2 u_lightingFadeDistance;
|
|
#endif
|
|
|
|
#ifdef TILE_LIMIT_RECTANGLE
|
|
uniform vec4 u_cartographicLimitRectangle;
|
|
#endif
|
|
|
|
#ifdef GROUND_ATMOSPHERE
|
|
uniform vec2 u_nightFadeDistance;
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_PLANES
|
|
uniform highp sampler2D u_clippingPlanes;
|
|
uniform mat4 u_clippingPlanesMatrix;
|
|
uniform vec4 u_clippingPlanesEdgeStyle;
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
uniform highp sampler2D u_clippingDistance;
|
|
in vec2 v_clippingPosition;
|
|
flat in int v_regionIndex;
|
|
#endif
|
|
|
|
#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
|
|
uniform float u_minimumBrightness;
|
|
#endif
|
|
|
|
// Based on colorCorrect
|
|
// The colorCorrect flag can only be true when tileProvider.hue/saturation/brightnessShift
|
|
// are nonzero AND when (applyFog || showGroundAtmosphere) in the tile provider
|
|
// - The tileProvider.hue/saturation/brightnessShift are just passed through
|
|
// from the Globe hue/saturation/brightness, like atmosphereBrightnessShift
|
|
// - The applyFog depends on enableFog, and some tile distance from the viewer
|
|
// - The showGroundAtmosphere is a flag that is passed through from the Globe,
|
|
// and is true by default when the ellipsoid is WGS84
|
|
#ifdef COLOR_CORRECT
|
|
uniform vec3 u_hsbShift; // Hue, saturation, brightness
|
|
#endif
|
|
|
|
// Based on highlightFillTile
|
|
// This is set for terrain tiles when they are "fill" tiles, and
|
|
// the terrainProvider.fillHighlightColor was set to a value with
|
|
// nonzero alpha
|
|
#ifdef HIGHLIGHT_FILL_TILE
|
|
uniform vec4 u_fillHighlightColor;
|
|
#endif
|
|
|
|
// Based on translucent
|
|
// This is set depending on the GlobeTranslucencyState
|
|
#ifdef TRANSLUCENT
|
|
uniform vec4 u_frontFaceAlphaByDistance;
|
|
uniform vec4 u_backFaceAlphaByDistance;
|
|
uniform vec4 u_translucencyRectangle;
|
|
#endif
|
|
|
|
// Based on showUndergroundColor
|
|
// This is set when GlobeSurfaceTileProvider.isUndergroundVisible
|
|
// returns true, AND the tileProvider.undergroundColor had a value with
|
|
// nonzero alpha, and the tileProvider.undergroundColorAlphaByDistance
|
|
// was in the right range
|
|
#ifdef UNDERGROUND_COLOR
|
|
uniform vec4 u_undergroundColor;
|
|
uniform vec4 u_undergroundColorAlphaByDistance;
|
|
#endif
|
|
|
|
// Based on enableLighting && hasVertexNormals
|
|
// The enableLighting flag is passed in directly from the Globe.
|
|
// The hasVertexNormals flag is from the tileProvider
|
|
#ifdef ENABLE_VERTEX_LIGHTING
|
|
uniform float u_lambertDiffuseMultiplier;
|
|
uniform float u_vertexShadowDarkness;
|
|
#endif
|
|
|
|
in vec3 v_positionMC;
|
|
in vec3 v_positionEC;
|
|
in vec3 v_textureCoordinates;
|
|
in vec3 v_normalMC;
|
|
in vec3 v_normalEC;
|
|
|
|
#ifdef APPLY_MATERIAL
|
|
in float v_height;
|
|
in float v_slope;
|
|
in float v_aspect;
|
|
#endif
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
|
|
#ifdef APPLY_MARS3D_FLOOD
|
|
uniform bool u_mars_flood_enabled;
|
|
uniform bool u_mars_flood_only;
|
|
uniform vec4 u_mars_flood_rectangle;
|
|
uniform highp sampler2D u_mars_flood_texture;
|
|
#endif
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
|
|
#ifdef APPLY_MARS3D_CLIP
|
|
uniform bool u_mars_clip_enabled;
|
|
uniform bool u_mars_clip_only;
|
|
uniform vec4 u_mars_clip_rectangle;
|
|
uniform highp sampler2D u_mars_clip_texture;
|
|
#endif
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u7F16\u8F91\u901A\u7528\u7684\u8303\u56F4\u5224\u65AD\u65B9\u6CD5\uFF08\u542B \u5730\u5F62\u62AC\u5347/\u5730\u5F62\u538B\u5E73/\u5730\u5F62\u5F00\u6316/\u5730\u5F62\u533A\u57DF\u6750\u8D28\uFF09
|
|
uniform highp float u_mars_inverseTileWidth;
|
|
uniform highp vec2 u_mars_cartographicTileRectangle;
|
|
|
|
bool inAreaMars3DRange(vec4 rectangle, sampler2D rangeTexture) {
|
|
float lo = v_textureCoordinates.x / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.x;
|
|
float la = v_textureCoordinates.y / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.y;
|
|
|
|
float newX = (lo - rectangle.x) / rectangle.z;
|
|
float newY = (la - rectangle.y) / rectangle.w;
|
|
|
|
if(newX >= 0.0 && newX <= 1.0 && newY >= 0.0 && newY <= 1.0){
|
|
vec4 point = texture(rangeTexture, vec2(newX, newY));
|
|
return point.r > 0.0;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u7F16\u8F91\u901A\u7528\u7684\u8303\u56F4\u5224\u65AD\u65B9\u6CD5\uFF08\u542B \u5730\u5F62\u62AC\u5347/\u5730\u5F62\u538B\u5E73/\u5730\u5F62\u5F00\u6316/\u5730\u5F62\u533A\u57DF\u6750\u8D28\uFF09
|
|
|
|
#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
|
|
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
|
|
#ifdef APPLY_MARS3D_UPLIFT
|
|
uniform vec4 u_mars_uplift_rectangle;
|
|
uniform highp sampler2D u_mars_uplift_texture;
|
|
uniform bool u_mars_uplift_enabled;
|
|
uniform bool u_mars_uplift_hideInsideOrOutside;
|
|
#endif
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
|
|
|
|
#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,
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
bool textureInvertColor,
|
|
vec3 texturefilterColor,
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
float split,
|
|
vec4 colorToAlpha,
|
|
float nightBlend)
|
|
{
|
|
// This crazy step stuff sets the alpha to 0.0 if this following condition is true:
|
|
// tileTextureCoordinates.s < textureCoordinateRectangle.s ||
|
|
// tileTextureCoordinates.s > textureCoordinateRectangle.p ||
|
|
// tileTextureCoordinates.t < textureCoordinateRectangle.t ||
|
|
// tileTextureCoordinates.t > textureCoordinateRectangle.q
|
|
// In other words, the alpha is zero if the fragment is outside the rectangle
|
|
// covered by this texture. Would an actual 'if' yield better performance?
|
|
vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
|
|
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
|
|
|
|
alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
|
|
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
|
|
|
|
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
|
|
textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
|
|
#endif
|
|
|
|
vec2 translation = textureCoordinateTranslationAndScale.xy;
|
|
vec2 scale = textureCoordinateTranslationAndScale.zw;
|
|
vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
|
|
vec4 value = texture(textureToSample, textureCoordinates);
|
|
vec3 color = value.rgb;
|
|
float alpha = value.a;
|
|
|
|
#ifdef APPLY_COLOR_TO_ALPHA
|
|
vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
|
|
colorDiff.r = czm_maximumComponent(colorDiff);
|
|
alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
|
|
#endif
|
|
|
|
#if !defined(APPLY_GAMMA)
|
|
vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
|
|
color = tempColor.rgb;
|
|
alpha = tempColor.a;
|
|
#else
|
|
color = pow(color, vec3(textureOneOverGamma));
|
|
#endif
|
|
|
|
#ifdef APPLY_SPLIT
|
|
float splitPosition = czm_splitPosition;
|
|
// Split to the left
|
|
if (split < 0.0 && gl_FragCoord.x > splitPosition) {
|
|
alpha = 0.0;
|
|
}
|
|
// Split to the right
|
|
else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
|
|
alpha = 0.0;
|
|
}
|
|
#endif
|
|
|
|
#ifdef APPLY_BRIGHTNESS
|
|
color = mix(vec3(0.0), color, textureBrightness);
|
|
#endif
|
|
|
|
#ifdef APPLY_CONTRAST
|
|
color = mix(vec3(0.5), color, textureContrast);
|
|
#endif
|
|
|
|
#ifdef APPLY_HUE
|
|
color = czm_hue(color, textureHue);
|
|
#endif
|
|
|
|
#ifdef APPLY_SATURATION
|
|
color = czm_saturation(color, textureSaturation);
|
|
#endif
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
#ifdef APPLY_INVERT_COLOR_MARS3D
|
|
if(textureInvertColor) {
|
|
color = vec3(1.0 - color.r, 1.0 - color.g, 1.0 - color.b);
|
|
}
|
|
#endif
|
|
|
|
#ifdef APPLY_FILTER_COLOR_MARS3D
|
|
if(texturefilterColor.x != 1.0 || texturefilterColor.y != 1.0 || texturefilterColor.z != 1.0) {
|
|
color = vec3(color.r * texturefilterColor.x, color.g * texturefilterColor.y, color.b * texturefilterColor.z);
|
|
}
|
|
#endif
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
|
|
float sourceAlpha = alpha * textureAlpha;
|
|
float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
|
|
outAlpha += sign(outAlpha) - 1.0;
|
|
|
|
vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
|
|
|
|
// When rendering imagery for a tile in multiple passes,
|
|
// some GPU/WebGL implementation combinations will not blend fragments in
|
|
// additional passes correctly if their computation includes an unmasked
|
|
// divide-by-zero operation,
|
|
// even if it's not in the output or if the output has alpha zero.
|
|
//
|
|
// For example, without sanitization for outAlpha,
|
|
// this renders without artifacts:
|
|
// if (outAlpha == 0.0) { outColor = vec3(0.0); }
|
|
//
|
|
// but using czm_branchFreeTernary will cause portions of the tile that are
|
|
// alpha-zero in the additional pass to render as black instead of blending
|
|
// with the previous pass:
|
|
// outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor);
|
|
//
|
|
// So instead, sanitize against divide-by-zero,
|
|
// store this state on the sign of outAlpha, and correct on return.
|
|
|
|
return vec4(outColor, max(outAlpha, 0.0));
|
|
}
|
|
|
|
vec3 colorCorrect(vec3 rgb) {
|
|
#ifdef COLOR_CORRECT
|
|
// Convert rgb color to hsb
|
|
vec3 hsb = czm_RGBToHSB(rgb);
|
|
// Perform hsb shift
|
|
hsb.x += u_hsbShift.x; // hue
|
|
hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation
|
|
hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness
|
|
// Convert shifted hsb back to rgb
|
|
rgb = czm_HSBToRGB(hsb);
|
|
#endif
|
|
return rgb;
|
|
}
|
|
|
|
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()
|
|
{
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
|
|
#ifdef APPLY_MARS3D_CLIP
|
|
if(u_mars_clip_enabled) {
|
|
if(u_mars_clip_only) {
|
|
if(!inAreaMars3DRange(u_mars_clip_rectangle, u_mars_clip_texture)) {
|
|
discard;
|
|
}
|
|
} else {
|
|
if(inAreaMars3DRange(u_mars_clip_rectangle, u_mars_clip_texture)) {
|
|
discard;
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u5F00\u6316
|
|
|
|
#ifdef TILE_LIMIT_RECTANGLE
|
|
if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
|
|
v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
|
|
{
|
|
discard;
|
|
}
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_PLANES
|
|
float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
|
|
#endif
|
|
|
|
#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
|
|
vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates
|
|
vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordinates
|
|
#endif
|
|
|
|
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
|
|
float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
|
|
#else
|
|
float nightBlend = 0.0;
|
|
#endif
|
|
|
|
// The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0
|
|
// where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the
|
|
// fragments on the edges of tiles even though the vertex shader is outputting
|
|
// coordinates strictly in the 0-1 range.
|
|
vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
|
|
|
|
#ifdef SHOW_TILE_BOUNDARIES
|
|
if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
|
|
v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
|
|
{
|
|
color = vec4(1.0, 0.0, 0.0, 1.0);
|
|
}
|
|
#endif
|
|
|
|
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
|
|
float cameraDist;
|
|
if (czm_sceneMode == czm_sceneMode2D)
|
|
{
|
|
cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
|
|
}
|
|
else if (czm_sceneMode == czm_sceneModeColumbusView)
|
|
{
|
|
cameraDist = -czm_view[3].z;
|
|
}
|
|
else
|
|
{
|
|
cameraDist = length(czm_view[3]);
|
|
}
|
|
float fadeOutDist = u_lightingFadeDistance.x;
|
|
float fadeInDist = u_lightingFadeDistance.y;
|
|
if (czm_sceneMode != czm_sceneMode3D) {
|
|
vec3 radii = czm_ellipsoidRadii;
|
|
float maxRadii = max(radii.x, max(radii.y, radii.z));
|
|
fadeOutDist -= maxRadii;
|
|
fadeInDist -= maxRadii;
|
|
}
|
|
float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
|
|
#else
|
|
float fade = 0.0;
|
|
#endif
|
|
|
|
#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
|
|
vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
|
|
vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
|
|
vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
|
|
waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;
|
|
|
|
float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;
|
|
|
|
#ifdef SHOW_REFLECTIVE_OCEAN
|
|
if (mask > 0.0)
|
|
{
|
|
mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);
|
|
|
|
vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
|
|
vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx);
|
|
|
|
vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));
|
|
|
|
color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef APPLY_MATERIAL
|
|
czm_materialInput materialInput;
|
|
materialInput.st = v_textureCoordinates.st;
|
|
materialInput.normalEC = normalize(v_normalEC);
|
|
materialInput.positionToEyeEC = -v_positionEC;
|
|
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
|
|
materialInput.slope = v_slope;
|
|
materialInput.height = v_height;
|
|
materialInput.aspect = v_aspect;
|
|
#ifdef HAS_WATER_MASK
|
|
materialInput.waterMask = mask;
|
|
#endif
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
|
|
bool hasAlphaBlend = true;
|
|
#ifdef APPLY_MARS3D_FLOOD
|
|
hasAlphaBlend = !u_mars_flood_enabled || (u_mars_flood_enabled && inAreaMars3DRange(u_mars_flood_rectangle, u_mars_flood_texture));
|
|
if(u_mars_flood_enabled) {
|
|
if(u_mars_flood_only) {
|
|
if(! inAreaMars3DRange(u_mars_flood_rectangle, u_mars_flood_texture)) {
|
|
discard;
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-07-19 \u5730\u5F62\u533A\u57DF\u6750\u8D28(\u6DF9\u6CA1\uFF0C\u7B49\u9AD8\u7EBF)
|
|
|
|
if(hasAlphaBlend) {
|
|
vec4 materialColor = vec4(material.diffuse, material.alpha);
|
|
color = alphaBlend(materialColor, color);
|
|
}
|
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_VERTEX_LIGHTING
|
|
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
|
|
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
|
|
#elif defined(ENABLE_DAYNIGHT_SHADING)
|
|
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
|
|
diffuseIntensity = mix(1.0, diffuseIntensity, fade);
|
|
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
|
|
#else
|
|
vec4 finalColor = color;
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_PLANES
|
|
vec4 clippingPlanesEdgeColor = vec4(1.0);
|
|
clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
|
|
float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
|
|
|
|
if (clipDistance < clippingPlanesEdgeWidth)
|
|
{
|
|
finalColor = clippingPlanesEdgeColor;
|
|
}
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
vec2 clippingPosition = v_clippingPosition;
|
|
int regionIndex = v_regionIndex;
|
|
clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
|
|
#endif
|
|
|
|
#ifdef HIGHLIGHT_FILL_TILE
|
|
finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
|
|
#endif
|
|
|
|
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
|
|
vec3 atmosphereLightDirection = czm_sunDirectionWC;
|
|
#else
|
|
vec3 atmosphereLightDirection = czm_lightDirectionWC;
|
|
#endif
|
|
|
|
#if defined(GROUND_ATMOSPHERE) || defined(FOG)
|
|
if (!czm_backFacing())
|
|
{
|
|
bool dynamicLighting = false;
|
|
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
|
|
dynamicLighting = true;
|
|
#endif
|
|
|
|
vec3 rayleighColor;
|
|
vec3 mieColor;
|
|
float opacity;
|
|
|
|
vec3 positionWC;
|
|
vec3 lightDirection;
|
|
|
|
// When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader.
|
|
// Otherwise, the scattering is computed in the vertex shader.
|
|
#ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
|
|
positionWC = computeEllipsoidPosition();
|
|
lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
|
|
computeAtmosphereScattering(
|
|
positionWC,
|
|
lightDirection,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
#else
|
|
positionWC = v_positionMC;
|
|
lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
|
|
rayleighColor = v_atmosphereRayleighColor;
|
|
mieColor = v_atmosphereMieColor;
|
|
opacity = v_atmosphereOpacity;
|
|
#endif
|
|
|
|
#ifdef COLOR_CORRECT
|
|
const bool ignoreBlackPixels = true;
|
|
rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
|
|
mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
|
|
#endif
|
|
|
|
vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
|
|
|
|
// Fog is applied to tiles selected for fog, close to the Earth.
|
|
#ifdef FOG
|
|
vec3 fogColor = groundAtmosphereColor.rgb;
|
|
|
|
// If there is lighting, apply that to the fog.
|
|
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
|
|
float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
|
|
fogColor *= darken;
|
|
#endif
|
|
|
|
#ifndef HDR
|
|
fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
|
|
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
|
|
#endif
|
|
|
|
finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a);
|
|
|
|
#else
|
|
// Apply ground atmosphere. This happens when the camera is far away from the earth.
|
|
|
|
// The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere.
|
|
// This value is larger near the "circumference", as it is further away from the camera. We use it to
|
|
// brighten up that area of the ground atmosphere.
|
|
const float transmittanceModifier = 0.5;
|
|
float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);
|
|
|
|
vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;
|
|
|
|
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
|
|
float fadeInDist = u_nightFadeDistance.x;
|
|
float fadeOutDist = u_nightFadeDistance.y;
|
|
|
|
float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
|
|
float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
|
|
vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);
|
|
|
|
finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
|
|
#endif
|
|
|
|
#ifndef HDR
|
|
finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
|
|
#else
|
|
finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
|
|
#endif
|
|
|
|
finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
|
|
#endif
|
|
}
|
|
#endif
|
|
|
|
#ifdef UNDERGROUND_COLOR
|
|
if (czm_backFacing())
|
|
{
|
|
float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
|
|
float distance = max(v_distance - distanceFromEllipsoid, 0.0);
|
|
float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
|
|
vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
|
|
finalColor = alphaBlend(undergroundColor, finalColor);
|
|
}
|
|
#endif
|
|
|
|
#ifdef TRANSLUCENT
|
|
if (inTranslucencyRectangle())
|
|
{
|
|
vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
|
|
finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
|
|
}
|
|
#endif
|
|
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u62AC\u5347
|
|
#ifdef APPLY_MARS3D_UPLIFT
|
|
if(u_mars_uplift_enabled) {
|
|
bool isInSlopeRampRectangle = inAreaMars3DRange(u_mars_uplift_rectangle, u_mars_uplift_texture);
|
|
if(isInSlopeRampRectangle == u_mars_uplift_hideInsideOrOutside) {
|
|
discard;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
out_FragColor = finalColor;
|
|
}
|
|
|
|
|
|
#ifdef SHOW_REFLECTIVE_OCEAN
|
|
|
|
float waveFade(float edge0, float edge1, float x)
|
|
{
|
|
float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
|
|
return pow(1.0 - y, 5.0);
|
|
}
|
|
|
|
float linearFade(float edge0, float edge1, float x)
|
|
{
|
|
return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
|
|
}
|
|
|
|
// Based on water rendering by Jonas Wagner:
|
|
// http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
|
|
|
|
// low altitude wave settings
|
|
const float oceanFrequencyLowAltitude = 825000.0;
|
|
const float oceanAnimationSpeedLowAltitude = 0.004;
|
|
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
|
|
const float oceanSpecularIntensity = 0.5;
|
|
|
|
// high altitude wave settings
|
|
const float oceanFrequencyHighAltitude = 125000.0;
|
|
const float oceanAnimationSpeedHighAltitude = 0.008;
|
|
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
|
|
|
|
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
|
|
{
|
|
vec3 positionToEyeEC = -positionEyeCoordinates;
|
|
float positionToEyeECLength = length(positionToEyeEC);
|
|
|
|
// The double normalize below works around a bug in Firefox on Android devices.
|
|
vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
|
|
|
|
// Fade out the waves as the camera moves far from the surface.
|
|
float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
|
|
|
|
#ifdef SHOW_OCEAN_WAVES
|
|
// high altitude waves
|
|
float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
|
|
vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
|
|
vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
|
|
|
|
// low altitude waves
|
|
time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
|
|
noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
|
|
vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
|
|
|
|
// blend the 2 wave layers based on distance to surface
|
|
float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
|
|
float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
|
|
vec3 normalTangentSpace =
|
|
(highAltitudeFade * normalTangentSpaceHighAltitude) +
|
|
(lowAltitudeFade * normalTangentSpaceLowAltitude);
|
|
normalTangentSpace = normalize(normalTangentSpace);
|
|
|
|
// fade out the normal perturbation as we move farther from the water surface
|
|
normalTangentSpace.xy *= waveIntensity;
|
|
normalTangentSpace = normalize(normalTangentSpace);
|
|
#else
|
|
vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
|
|
#endif
|
|
|
|
vec3 normalEC = enuToEye * normalTangentSpace;
|
|
|
|
const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
|
|
|
|
// Use diffuse light to highlight the waves
|
|
float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
|
|
vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
|
|
|
|
#ifdef SHOW_OCEAN_WAVES
|
|
// Where diffuse light is low or non-existent, use wave highlights based solely on
|
|
// the wave bumpiness and no particular light direction.
|
|
float tsPerturbationRatio = normalTangentSpace.z;
|
|
vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
|
|
#else
|
|
vec3 nonDiffuseHighlight = vec3(0.0);
|
|
#endif
|
|
|
|
// Add specular highlights in 3D, and in all modes when zoomed in.
|
|
float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
|
|
float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
|
|
float specular = specularIntensity * surfaceReflectance;
|
|
|
|
#ifdef HDR
|
|
specular *= 1.4;
|
|
|
|
float e = 0.2;
|
|
float d = 3.3;
|
|
float c = 1.7;
|
|
|
|
vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
|
|
#else
|
|
vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
|
|
#endif
|
|
|
|
return vec4(color, imageryColor.a);
|
|
}
|
|
|
|
#endif // #ifdef SHOW_REFLECTIVE_OCEAN
|
|
`;var m8=`#ifdef QUANTIZATION_BITS12
|
|
in vec4 compressed0;
|
|
in float compressed1;
|
|
#else
|
|
in vec4 position3DAndHeight;
|
|
in vec4 textureCoordAndEncodedNormals;
|
|
#endif
|
|
|
|
#ifdef GEODETIC_SURFACE_NORMALS
|
|
in vec3 geodeticSurfaceNormal;
|
|
#endif
|
|
|
|
#ifdef EXAGGERATION
|
|
uniform vec2 u_verticalExaggerationAndRelativeHeight;
|
|
#endif
|
|
|
|
uniform vec3 u_center3D;
|
|
uniform mat4 u_modifiedModelView;
|
|
uniform mat4 u_modifiedModelViewProjection;
|
|
uniform vec4 u_tileRectangle;
|
|
|
|
// Uniforms for 2D Mercator projection
|
|
uniform vec2 u_southAndNorthLatitude;
|
|
uniform vec2 u_southMercatorYAndOneOverHeight;
|
|
|
|
out vec3 v_positionMC;
|
|
out vec3 v_positionEC;
|
|
|
|
out vec3 v_textureCoordinates;
|
|
out vec3 v_normalMC;
|
|
out vec3 v_normalEC;
|
|
|
|
#ifdef APPLY_MATERIAL
|
|
out float v_slope;
|
|
out float v_aspect;
|
|
out float v_height;
|
|
#endif
|
|
|
|
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
|
|
out float v_distance;
|
|
#endif
|
|
|
|
#if defined(FOG) || defined(GROUND_ATMOSPHERE)
|
|
out vec3 v_atmosphereRayleighColor;
|
|
out vec3 v_atmosphereMieColor;
|
|
out float v_atmosphereOpacity;
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
uniform highp sampler2D u_clippingExtents;
|
|
out vec2 v_clippingPosition;
|
|
flat out int v_regionIndex;
|
|
#endif
|
|
|
|
// These functions are generated at runtime.
|
|
vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
|
|
float get2DYPositionFraction(vec2 textureCoordinates);
|
|
|
|
vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
|
|
{
|
|
return u_modifiedModelViewProjection * vec4(position, 1.0);
|
|
}
|
|
|
|
float get2DMercatorYPositionFraction(vec2 textureCoordinates)
|
|
{
|
|
// The width of a tile at level 11, in radians and assuming a single root tile, is
|
|
// 2.0 * czm_pi / pow(2.0, 11.0)
|
|
// We want to just linearly interpolate the 2D position from the texture coordinates
|
|
// when we're at this level or higher. The constant below is the expression
|
|
// above evaluated and then rounded up at the 4th significant digit.
|
|
const float maxTileWidth = 0.003068;
|
|
float positionFraction = textureCoordinates.y;
|
|
float southLatitude = u_southAndNorthLatitude.x;
|
|
float northLatitude = u_southAndNorthLatitude.y;
|
|
if (northLatitude - southLatitude > maxTileWidth)
|
|
{
|
|
float southMercatorY = u_southMercatorYAndOneOverHeight.x;
|
|
float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;
|
|
|
|
float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
|
|
currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
|
|
positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
|
|
}
|
|
return positionFraction;
|
|
}
|
|
|
|
float get2DGeographicYPositionFraction(vec2 textureCoordinates)
|
|
{
|
|
return textureCoordinates.y;
|
|
}
|
|
|
|
vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
|
|
{
|
|
float yPositionFraction = get2DYPositionFraction(textureCoordinates);
|
|
vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
|
|
return u_modifiedModelViewProjection * rtcPosition2D;
|
|
}
|
|
|
|
vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
|
|
{
|
|
return getPositionPlanarEarth(position, 0.0, textureCoordinates);
|
|
}
|
|
|
|
vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
|
|
{
|
|
return getPositionPlanarEarth(position, height, textureCoordinates);
|
|
}
|
|
|
|
vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
|
|
{
|
|
// We do not do RTC while morphing, so there is potential for jitter.
|
|
// This is unlikely to be noticeable, though.
|
|
vec3 position3DWC = position + u_center3D;
|
|
float yPositionFraction = get2DYPositionFraction(textureCoordinates);
|
|
vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
|
|
vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
|
|
vec4 morphPositionEC = czm_modelView * morphPosition;
|
|
return czm_projection * morphPositionEC;
|
|
}
|
|
|
|
#ifdef QUANTIZATION_BITS12
|
|
uniform vec2 u_minMaxHeight;
|
|
uniform mat4 u_scaleAndBias;
|
|
#endif
|
|
|
|
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
|
|
#ifdef APPLY_MARS3D_FLAT
|
|
uniform bool u_mars_flat_enabled;
|
|
uniform vec4 u_mars_flat_rectangle;
|
|
uniform highp sampler2D u_mars_flat_texture;
|
|
|
|
uniform highp float u_mars_inverseTileWidth;
|
|
uniform highp vec2 u_mars_cartographicTileRectangle;
|
|
|
|
vec4 getAreaMars3DRange(vec4 rectangle, sampler2D rangeTexture, vec2 textureCoordinates) {
|
|
float lo = textureCoordinates.x / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.x;
|
|
float la = textureCoordinates.y / u_mars_inverseTileWidth + u_mars_cartographicTileRectangle.y;
|
|
|
|
float newX = (lo - rectangle.x) / rectangle.z;
|
|
float newY = (la - rectangle.y) / rectangle.w;
|
|
|
|
vec4 point;
|
|
if(newX >= 0.0 && newX <= 1.0 && newY >= 0.0 && newY <= 1.0){
|
|
vec4 point = texture(rangeTexture, vec2(newX, newY));
|
|
return point;
|
|
}else{
|
|
return vec4(0.0);
|
|
}
|
|
}
|
|
#endif
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
|
|
|
|
|
|
void main()
|
|
{
|
|
#ifdef QUANTIZATION_BITS12
|
|
vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
|
|
vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
|
|
vec3 position = vec3(xy, zh.x);
|
|
float height = zh.y;
|
|
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
|
|
|
|
height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
|
|
position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
|
|
|
|
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
|
|
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
|
|
float encodedNormal = compressed1;
|
|
#elif defined(INCLUDE_WEB_MERCATOR_Y)
|
|
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
|
|
float encodedNormal = 0.0;
|
|
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
|
|
float webMercatorT = textureCoordinates.y;
|
|
float encodedNormal = compressed0.w;
|
|
#else
|
|
float webMercatorT = textureCoordinates.y;
|
|
float encodedNormal = 0.0;
|
|
#endif
|
|
|
|
#else
|
|
// A single float per element
|
|
vec3 position = position3DAndHeight.xyz;
|
|
float height = position3DAndHeight.w;
|
|
vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;
|
|
|
|
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
|
|
float webMercatorT = textureCoordAndEncodedNormals.z;
|
|
float encodedNormal = textureCoordAndEncodedNormals.w;
|
|
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
|
|
float webMercatorT = textureCoordinates.y;
|
|
float encodedNormal = textureCoordAndEncodedNormals.z;
|
|
#elif defined(INCLUDE_WEB_MERCATOR_Y)
|
|
float webMercatorT = textureCoordAndEncodedNormals.z;
|
|
float encodedNormal = 0.0;
|
|
#else
|
|
float webMercatorT = textureCoordinates.y;
|
|
float encodedNormal = 0.0;
|
|
#endif
|
|
|
|
#endif
|
|
|
|
vec3 position3DWC = position + u_center3D;
|
|
|
|
#ifdef GEODETIC_SURFACE_NORMALS
|
|
vec3 ellipsoidNormal = geodeticSurfaceNormal;
|
|
#else
|
|
vec3 ellipsoidNormal = normalize(position3DWC);
|
|
#endif
|
|
|
|
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
|
|
float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
|
|
float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
|
|
float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;
|
|
|
|
// stop from going through center of earth
|
|
float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
|
|
newHeight = max(newHeight, -minRadius);
|
|
|
|
vec3 offset = ellipsoidNormal * (newHeight - height);
|
|
position += offset;
|
|
position3DWC += offset;
|
|
height = newHeight;
|
|
#endif
|
|
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
|
|
#ifdef APPLY_MARS3D_FLAT
|
|
if(u_mars_flat_enabled) {
|
|
vec4 isInside = getAreaMars3DRange(u_mars_flat_rectangle,u_mars_flat_texture,textureCoordinates);
|
|
if(isInside.r>0.0 || isInside.g>0.0 || isInside.b>0.0 || isInside.a>0.0){
|
|
float newHeight = czm_unpackFloat(isInside);
|
|
if(newHeight>-9999.0 && newHeight<9999.0){
|
|
vec3 offset = (newHeight - height) * ellipsoidNormal;
|
|
position += offset;
|
|
position3DWC += offset;
|
|
height = newHeight;
|
|
// vec3 newPosition = (position3DWC + offset) - u_center3D;
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
// \u3010mars3d.cn\u4FEE\u6539\u3011 Muyao 2023-02-20 \u5730\u5F62\u538B\u5E73
|
|
|
|
gl_Position = getPosition(position, height, textureCoordinates);
|
|
|
|
v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
|
|
v_positionMC = position3DWC; // position in model coordinates
|
|
|
|
v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
|
|
|
|
#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
|
|
vec3 normalMC = czm_octDecode(encodedNormal);
|
|
|
|
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
|
|
vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
|
|
vec3 rejection = normalMC - projection;
|
|
normalMC = normalize(projection + rejection * exaggeration);
|
|
#endif
|
|
|
|
v_normalMC = normalMC;
|
|
v_normalEC = czm_normal3D * v_normalMC;
|
|
#endif
|
|
|
|
#ifdef ENABLE_CLIPPING_POLYGONS
|
|
vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
|
|
sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
|
|
|
|
vec2 minDistance = vec2(czm_infinity);
|
|
v_clippingPosition = vec2(czm_infinity);
|
|
v_regionIndex = -1;
|
|
|
|
for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
|
|
vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
|
|
vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
|
|
|
|
vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
|
|
vec2 distance = abs(rectUv - clamped) * extents.wz;
|
|
|
|
float threshold = 0.01;
|
|
if (minDistance.x > distance.x || minDistance.y > distance.y) {
|
|
minDistance = distance;
|
|
v_clippingPosition = rectUv;
|
|
if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
|
|
v_regionIndex = regionIndex;
|
|
}
|
|
}
|
|
}
|
|
#endif
|
|
|
|
#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
|
|
|
|
bool dynamicLighting = false;
|
|
|
|
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
|
|
dynamicLighting = true;
|
|
#endif
|
|
|
|
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
|
|
vec3 atmosphereLightDirection = czm_sunDirectionWC;
|
|
#else
|
|
vec3 atmosphereLightDirection = czm_lightDirectionWC;
|
|
#endif
|
|
|
|
vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));
|
|
|
|
computeAtmosphereScattering(
|
|
position3DWC,
|
|
lightDirection,
|
|
v_atmosphereRayleighColor,
|
|
v_atmosphereMieColor,
|
|
v_atmosphereOpacity
|
|
);
|
|
#endif
|
|
|
|
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
|
|
v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
|
|
#endif
|
|
|
|
#ifdef APPLY_MATERIAL
|
|
float northPoleZ = czm_ellipsoidRadii.z;
|
|
vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
|
|
vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
|
|
float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
|
|
v_slope = acos(dotProd);
|
|
vec3 normalRejected = ellipsoidNormal * dotProd;
|
|
vec3 normalProjected = v_normalMC - normalRejected;
|
|
vec3 aspectVector = normalize(normalProjected);
|
|
v_aspect = acos(dot(aspectVector, vectorEastMC));
|
|
float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
|
|
v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
|
|
v_height = height;
|
|
#endif
|
|
}
|
|
`;var qP=`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 KP=`float interpolateByDistance(vec4 nearFarScalar, float distance)
|
|
{
|
|
float startDistance = nearFarScalar.x;
|
|
float startValue = nearFarScalar.y;
|
|
float endDistance = nearFarScalar.z;
|
|
float endValue = nearFarScalar.w;
|
|
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
|
|
return mix(startValue, endValue, t);
|
|
}
|
|
|
|
void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
|
|
{
|
|
float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;
|
|
|
|
// Adjustment to the atmosphere radius applied based on the camera height.
|
|
float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
|
|
float distanceAdjustMax = czm_ellipsoidRadii.x;
|
|
float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
|
|
float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);
|
|
|
|
// Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit
|
|
// for the position on the ellipsoid.
|
|
float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
|
|
float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
|
|
|
|
// Setup the primary ray: from the camera position to the vertex position.
|
|
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
|
|
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
|
|
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
|
|
|
|
underTranslucentGlobe = 0.0;
|
|
|
|
// Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled.
|
|
#if defined(GLOBE_TRANSLUCENT)
|
|
|
|
// Check for intersection with the inner radius of the atmopshere.
|
|
czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
|
|
if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
|
|
|
|
// Compute position on globe.
|
|
vec3 direction = normalize(positionWC);
|
|
czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
|
|
czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
|
|
vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);
|
|
|
|
// Control the color using the camera angle.
|
|
float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
|
|
|
|
// Control the opacity using the distance from Earth.
|
|
opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
|
|
vec3 horizonColor = vec3(0.1, 0.2, 0.3);
|
|
vec3 nearColor = vec3(0.0);
|
|
|
|
rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
|
|
|
|
// Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton.
|
|
underTranslucentGlobe = 1.0;
|
|
return;
|
|
}
|
|
#endif
|
|
|
|
computeScattering(
|
|
primaryRay,
|
|
length(cameraToPositionWC),
|
|
lightDirection,
|
|
atmosphereInnerRadius,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity
|
|
);
|
|
|
|
// Alter the opacity based on how close the viewer is to the ground.
|
|
// (0.0 = At edge of atmosphere, 1.0 = On ground)
|
|
float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
|
|
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
|
|
opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
|
|
|
|
// Alter alpha based on time of day (0.0 = night , 1.0 = day)
|
|
float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
|
|
opacity *= pow(nightAlpha, 0.5);
|
|
}
|
|
`;var p8=`in vec3 v_outerPositionWC;
|
|
|
|
uniform vec3 u_hsbShift;
|
|
|
|
#ifndef PER_FRAGMENT_ATMOSPHERE
|
|
in vec3 v_mieColor;
|
|
in vec3 v_rayleighColor;
|
|
in float v_opacity;
|
|
in float v_translucent;
|
|
#endif
|
|
|
|
void main (void)
|
|
{
|
|
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
|
|
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);
|
|
|
|
vec3 mieColor;
|
|
vec3 rayleighColor;
|
|
float opacity;
|
|
float translucent;
|
|
|
|
#ifdef PER_FRAGMENT_ATMOSPHERE
|
|
computeAtmosphereScattering(
|
|
v_outerPositionWC,
|
|
lightDirection,
|
|
rayleighColor,
|
|
mieColor,
|
|
opacity,
|
|
translucent
|
|
);
|
|
#else
|
|
mieColor = v_mieColor;
|
|
rayleighColor = v_rayleighColor;
|
|
opacity = v_opacity;
|
|
translucent = v_translucent;
|
|
#endif
|
|
|
|
vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
|
|
|
|
#ifndef HDR
|
|
color.rgb = czm_pbrNeutralTonemapping(color.rgb);
|
|
color.rgb = czm_inverseGamma(color.rgb);
|
|
#endif
|
|
|
|
#ifdef COLOR_CORRECT
|
|
const bool ignoreBlackPixels = true;
|
|
color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
|
|
#endif
|
|
|
|
// For the parts of the sky atmosphere that are not behind a translucent globe,
|
|
// we mix in the default opacity so that the sky atmosphere still appears at distance.
|
|
// This is needed because the opacity in the sky atmosphere is initially adjusted based
|
|
// on the camera height.
|
|
if (translucent == 0.0) {
|
|
color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
|
|
}
|
|
|
|
out_FragColor = color;
|
|
}
|
|
`;var A8=`in vec4 position;
|
|
|
|
out vec3 v_outerPositionWC;
|
|
|
|
#ifndef PER_FRAGMENT_ATMOSPHERE
|
|
out vec3 v_mieColor;
|
|
out vec3 v_rayleighColor;
|
|
out float v_opacity;
|
|
out float v_translucent;
|
|
#endif
|
|
|
|
void main(void)
|
|
{
|
|
vec4 positionWC = czm_model * position;
|
|
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
|
|
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);
|
|
|
|
#ifndef PER_FRAGMENT_ATMOSPHERE
|
|
computeAtmosphereScattering(
|
|
positionWC.xyz,
|
|
lightDirection,
|
|
v_rayleighColor,
|
|
v_mieColor,
|
|
v_opacity,
|
|
v_translucent
|
|
);
|
|
#endif
|
|
|
|
v_outerPositionWC = positionWC.xyz;
|
|
vec4 positionEC = czm_modelView * position;
|
|
gl_Position = czm_projection * positionEC;
|
|
}
|
|
`;var g8=`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 _8=`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 y8=`uniform sampler2D u_texture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
vec4 color = texture(u_texture, v_textureCoordinates);
|
|
out_FragColor = czm_gammaCorrect(color);
|
|
}
|
|
`;var C8=`uniform float u_radiusTS;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
vec2 rotate(vec2 p, vec2 direction)
|
|
{
|
|
return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
|
|
}
|
|
|
|
vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
|
|
{
|
|
vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
|
|
float radius = length(rotatedPosition) * lengthScalar;
|
|
float burst = 1.0 - smoothstep(0.0, 0.55, radius);
|
|
return vec4(burst);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
float lengthScalar = 2.0 / sqrt(2.0);
|
|
vec2 position = v_textureCoordinates - vec2(0.5);
|
|
float radius = length(position) * lengthScalar;
|
|
float surface = step(radius, u_radiusTS);
|
|
vec4 color = vec4(vec2(1.0), surface + 0.2, surface);
|
|
|
|
float glow = 1.0 - smoothstep(0.0, 0.55, radius);
|
|
color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;
|
|
|
|
vec4 burst = vec4(0.0);
|
|
|
|
// The following loop has been manually unrolled for speed, to
|
|
// avoid sin() and cos().
|
|
//
|
|
//for (float i = 0.4; i < 3.2; i += 1.047) {
|
|
// vec2 direction = vec2(sin(i), cos(i));
|
|
// burst += 0.4 * addBurst(position, direction, lengthScalar);
|
|
//
|
|
// direction = vec2(sin(i - 0.08), cos(i - 0.08));
|
|
// burst += 0.3 * addBurst(position, direction, lengthScalar);
|
|
//}
|
|
|
|
burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4
|
|
burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047
|
|
burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0
|
|
|
|
burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08
|
|
burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08
|
|
burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08
|
|
|
|
// End of manual loop unrolling.
|
|
|
|
color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
|
|
|
|
out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
|
|
}
|
|
`;var E8=`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 I8=`
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
czm_materialInput materialInput;
|
|
|
|
materialInput.s = v_textureCoordinates.s;
|
|
materialInput.st = v_textureCoordinates;
|
|
materialInput.str = vec3(v_textureCoordinates, 0.0);
|
|
materialInput.normalEC = vec3(0.0, 0.0, -1.0);
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
|
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
}
|
|
`;async function x$(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,a=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(a):r=i.unproject(a),!l(n))return r;let s=n.availability;if(!l(s)||t.mode===oe.SCENE2D)return r;let c=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await x$._sampleTerrainMostDetailed(n,c),f=!1,h=u.reduce(function(A,m){return l(m.height)?(f=!0,Math.max(m.height,A)):A},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}x$._sampleTerrainMostDetailed=IS;var TS=x$;var uyt=new Q;function fyt(e,t){let n=e.unionClippingRegions,i=e.length,o=Ca.useFloatTexture(t),r=Ca.getTextureResolution(e,t,uyt),a=r.x,s=r.y,c=o?myt(a,s):pyt(a,s);return c+=`
|
|
`,c+=n?dyt(i):hyt(i),c}function dyt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
|
|
{
|
|
vec4 position = czm_windowToEyeCoordinates(fragCoord);
|
|
vec3 clipNormal = vec3(0.0);
|
|
vec3 clipPosition = vec3(0.0);
|
|
float clipAmount;
|
|
float pixelWidth = czm_metersPerPixel(position);
|
|
bool breakAndDiscard = false;
|
|
for (int i = 0; i < ${e}; ++i)
|
|
{
|
|
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
|
|
clipNormal = clippingPlane.xyz;
|
|
clipPosition = -clippingPlane.w * clipNormal;
|
|
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
|
|
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
|
|
if (amount <= 0.0)
|
|
{
|
|
breakAndDiscard = true;
|
|
// HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
|
|
break;
|
|
}
|
|
}
|
|
if (breakAndDiscard) {
|
|
discard;
|
|
}
|
|
return clipAmount;
|
|
}
|
|
`}function hyt(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 myt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
|
{
|
|
int pixY = clippingPlaneNumber / ${e};
|
|
int pixX = clippingPlaneNumber - (pixY * ${e});
|
|
// Sample from center of pixel
|
|
float u = (float(pixX) + 0.5) * ${o};
|
|
float v = (float(pixY) + 0.5) * ${r};
|
|
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
`}function pyt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
|
|
{
|
|
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
|
|
int pixY = clippingPlaneStartIndex / ${e};
|
|
int pixX = clippingPlaneStartIndex - (pixY * ${e});
|
|
// Sample from center of pixel
|
|
float u = (float(pixX) + 0.5) * ${o};
|
|
float v = (float(pixY) + 0.5) * ${r};
|
|
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
|
|
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
|
|
vec4 plane;
|
|
plane.xyz = czm_octDecode(oct, 65535.0);
|
|
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
|
|
return czm_transformPlane(plane, transform);
|
|
}
|
|
`}var SS=fyt;function Ayt(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 T$(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function gyt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case oe.SCENE3D:o=t;break;case oe.SCENE2D:case oe.COLUMBUS_VIEW:o=n;break;case oe.MORPHING:o=i;break}return o}function _yt(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 yyt(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 Cyt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}T$.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,a=e.applyHue,s=e.applySaturation,c=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,A=e.showReflectiveOcean,m=e.showOceanWaves,_=e.enableLighting,y=e.dynamicAtmosphereLighting,C=e.dynamicAtmosphereLightingFromSun,E=e.showGroundAtmosphere,I=e.perFragmentGroundAtmosphere,x=e.hasVertexNormals,S=e.useWebMercatorProjection,w=e.enableFog,v=e.enableClippingPlanes,R=e.clippingPlanes,N=e.enableClippingPolygons,L=e.clippingPolygons,g=e.clippedByBoundaries,b=e.hasImageryLayerCutout,T=e.colorCorrect,B=e.highlightFillTile,M=e.colorToAlpha,O=e.hasGeodeticSurfaceNormals,G=e.hasExaggeration,k=e.showUndergroundColor,z=e.translucent,F=e.marsOptions||{},H=0,Y="",W=n.renderedMesh.encoding;W.quantization===rc.BITS12&&(H=1,Y="QUANTIZATION_BITS12");let Z=0,pe="";g&&(Z=1,pe="TILE_LIMIT_RECTANGLE");let ge=0,re="";b&&(ge=1,re="APPLY_IMAGERY_CUTOUT");let ye=t.mode,Ce=((ye|o<<2|r<<3|a<<4|s<<5|c<<6|u<<7|p<<8|A<<9|m<<10|_<<11|y<<12|C<<13|E<<14|I<<15|x<<16|S<<17|w<<18|H<<19|h<<20|v<<21|N<<22|Z<<23|ge<<24|T<<25|B<<26|M<<27|O<<28|G<<29|k<<30|z<<31)>>>0)+(f?4294967296:0),ve=0;l(R)&&R.length>0&&(ve=v?R.clippingPlanesState:0);let Ne=0;l(L)&&L.length>0&&(Ne=N?L.clippingPolygonsState:0);let Le=n.surfaceShader;if(l(Le)&&Le.numberOfDayTextures===i&&Le.flags===Ce&&Le.material===this.material&&Le.clippingShaderState===ve&&Le.clippingPolygonShaderState===Ne)return Le.shaderProgram;let Oe=this._shadersByTexturesFlags[i];if(l(Oe)||(Oe=this._shadersByTexturesFlags[i]=[]),Le=Oe[Ce],!l(Le)||Le.material!==this.material||Le.clippingShaderState!==ve||Le.clippingPolygonShaderState!==Ne){let nt=this.baseVertexShaderSource.clone(),Fe=this.baseFragmentShaderSource.clone();ve!==0&&Fe.sources.unshift(SS(R,t.context)),Ne!==0&&(Fe.sources.unshift(_yt(t.context)),nt.sources.unshift(yyt(t.context))),F.enableUplift&&Fe.defines.push("APPLY_MARS3D_UPLIFT"),F.enableFlat&&nt.defines.push("APPLY_MARS3D_FLAT"),F.enableClip&&Fe.defines.push("APPLY_MARS3D_CLIP"),F.enableFlood&&Fe.defines.push("APPLY_MARS3D_FLOOD"),nt.defines.push(Y),Fe.defines.push(`TEXTURE_UNITS ${i}`,pe,re),o&&Fe.defines.push("APPLY_BRIGHTNESS"),r&&Fe.defines.push("APPLY_CONTRAST"),a&&Fe.defines.push("APPLY_HUE"),s&&Fe.defines.push("APPLY_SATURATION"),c&&Fe.defines.push("APPLY_GAMMA"),F.invertColor&&Fe.defines.push("APPLY_INVERT_COLOR_MARS3D"),F.filterColor&&Fe.defines.push("APPLY_FILTER_COLOR_MARS3D"),u&&Fe.defines.push("APPLY_ALPHA"),f&&Fe.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&Fe.defines.push("HAS_WATER_MASK"),A&&(Fe.defines.push("SHOW_REFLECTIVE_OCEAN"),nt.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&Fe.defines.push("SHOW_OCEAN_WAVES"),M&&Fe.defines.push("APPLY_COLOR_TO_ALPHA"),k&&(nt.defines.push("UNDERGROUND_COLOR"),Fe.defines.push("UNDERGROUND_COLOR")),z&&(nt.defines.push("TRANSLUCENT"),Fe.defines.push("TRANSLUCENT")),_&&(x?(nt.defines.push("ENABLE_VERTEX_LIGHTING"),Fe.defines.push("ENABLE_VERTEX_LIGHTING")):(nt.defines.push("ENABLE_DAYNIGHT_SHADING"),Fe.defines.push("ENABLE_DAYNIGHT_SHADING"))),y&&(nt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Fe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),C&&(nt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),Fe.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),E&&(nt.defines.push("GROUND_ATMOSPHERE"),Fe.defines.push("GROUND_ATMOSPHERE"),I&&(nt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),Fe.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),nt.defines.push("INCLUDE_WEB_MERCATOR_Y"),Fe.defines.push("INCLUDE_WEB_MERCATOR_Y"),w&&(nt.defines.push("FOG"),Fe.defines.push("FOG")),h&&Fe.defines.push("APPLY_SPLIT"),v&&Fe.defines.push("ENABLE_CLIPPING_PLANES"),N&&(Fe.defines.push("ENABLE_CLIPPING_POLYGONS"),nt.defines.push("ENABLE_CLIPPING_POLYGONS"),L.inverse&&Fe.defines.push("CLIPPING_INVERSE"),Fe.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`),nt.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${L.extentsCount}`)),T&&Fe.defines.push("COLOR_CORRECT"),B&&Fe.defines.push("HIGHLIGHT_FILL_TILE"),O&&nt.defines.push("GEODETIC_SURFACE_NORMALS"),G&&nt.defines.push("EXAGGERATION");let _t=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
|
|
{
|
|
vec4 color = initialColor;
|
|
`;b&&(_t+=` vec4 cutoutAndColorResult;
|
|
bool texelUnclipped;
|
|
`);for(let je=0;je<i;++je)b?_t+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${je}];
|
|
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
|
|
cutoutAndColorResult = sampleAndBlend(
|
|
`:_t+=` color = sampleAndBlend(
|
|
`,_t+=` color,
|
|
u_dayTextures[${je}],
|
|
u_dayTextureUseWebMercatorT[${je}] ? textureCoordinates.xz : textureCoordinates.xy,
|
|
u_dayTextureTexCoordsRectangle[${je}],
|
|
u_dayTextureTranslationAndScale[${je}],
|
|
${u?`u_dayTextureAlpha[${je}]`:"1.0"},
|
|
${f?`u_dayTextureNightAlpha[${je}]`:"1.0"},
|
|
${f?`u_dayTextureDayAlpha[${je}]`:"1.0"},
|
|
${o?`u_dayTextureBrightness[${je}]`:"0.0"},
|
|
${r?`u_dayTextureContrast[${je}]`:"0.0"},
|
|
${a?`u_dayTextureHue[${je}]`:"0.0"},
|
|
${s?`u_dayTextureSaturation[${je}]`:"0.0"},
|
|
${c?`u_dayTextureOneOverGamma[${je}]`:"0.0"},
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
${F.invertColor?`u_mars3dTextureInvertColor[${je}]`:"false"},
|
|
${F.filterColor?`u_mars3dTextureFilterColor[${je}]`:"vec3(1.0)"},
|
|
//\u3010mars3d.cn\u4FEE\u6539\u3011 Hao 2022-1-5 \u74E6\u7247\u6EE4\u955C\u6548\u679C
|
|
${h?`u_dayTextureSplit[${je}]`:"0.0"},
|
|
${M?`u_colorsToAlpha[${je}]`:"vec4(0.0)"},
|
|
nightBlend);
|
|
`,b&&(_t+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
|
|
`);_t+=` return color;
|
|
}`,Fe.sources.push(_t),nt.sources.push(gyt(ye)),nt.sources.push(Cyt(S));let rt=$t.fromCache({context:t.context,vertexShaderSource:nt,fragmentShaderSource:Fe,attributeLocations:W.getAttributeLocations()});Le=Oe[Ce]=new Ayt(i,Ce,this.material,rt,ve,Ne)}return n.surfaceShader=Le,Le.shaderProgram};T$.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!l(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],l(t)&&t.shaderProgram.destroy())}return fe(this)};var b8=T$;var Eyt={START:0,LOADING:1,DONE:2,FAILED:3},sc=Object.freeze(Eyt);var Iyt={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Lo=Object.freeze(Iyt);function hr(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ie(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Lo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(hr.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===Lo.RECEIVING||e===Lo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let a=i[o];n=!l(a.loadingImagery)||a.loadingImagery.state!==Hn.TRANSITIONING}return n}},renderedMesh:{get:function(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}}});hr.prototype.pick=function(e,t,n,i,o){if(!l(this.renderedMesh))return;let r=this.renderedMesh.pick(e,i,t,n);return d.clone(r,o)};hr.prototype.freeResources=function(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=Lo.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()};hr.prototype.freeVertexArray=function(){hr._freeVertexArray(this.vertexArray),this.vertexArray=void 0,hr._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};hr.initialize=function(e,t,n){let i=e.data;l(i)||(i=e.data=new hr),e.state===sc.START&&(byt(e,t,n),e.state=sc.LOADING)};hr.processStateMachine=function(e,t,n,i,o,r,a){hr.initialize(e,n,i);let s=e.data;if(e.state===sc.LOADING&&xyt(e,t,n,i,o,r),a)return;let c=e.renderable;e.renderable=l(s.vertexArray);let u=s.terrainState===Lo.READY;e.upsampledFromParent=l(s.terrainData)&&s.terrainData.wasCreatedByUpsampling();let f=s.processImagery(e,n,t);if(u&&f){let h=e._loadedCallbacks,p={};for(let A in h)h.hasOwnProperty(A)&&(h[A](e)||(p[A]=h[A]));e._loadedCallbacks=p,e.state=sc.DONE}c&&(e.renderable=!0)};hr.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,a=!1,s=!0,c=o.imagery,u,f;for(u=0,f=c.length;u<f;++u){let h=c[u];if(!l(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===Hn.PLACEHOLDER){let A=h.loadingImagery.imageryLayer;if(A.ready){h.freeResources(),c.splice(u,1),A._createTileImagerySkeletons(e,t,u),--u,f=c.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);s=s&&p,a=a||p||l(h.readyImagery),r=r&&l(h.loadingImagery)&&(h.loadingImagery.state===Hn.FAILED||h.loadingImagery.state===Hn.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(a||s),s};function Zbe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,a=o.encoding,s=r.length/a.stride,c=Tr.clone(a);c.hasGeodeticSurfaceNormals=t,c=Tr.clone(c);let u=c.stride,f=new Float32Array(s*u);t?a.addGeodeticSurfaceNormals(r,f,n):a.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(hr._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=hr._createVertexArrayForMesh(i.context,o)):(hr._freeVertexArray(e.vertexArray),e.vertexArray=hr._createVertexArrayForMesh(i.context,o)),hr._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}hr.prototype.addGeodeticSurfaceNormals=function(e,t){Zbe(this,!0,e,t)};hr.prototype.removeGeodeticSurfaceNormals=function(e){Zbe(this,!1,void 0,e)};hr.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,a=t.verticalExaggerationRelativeHeight,s=r!==1,c=o.encoding,u=c.exaggeration!==r,f=c.exaggerationRelativeHeight!==a;if(u||f){if(u)if(s&&!c.hasGeodeticSurfaceNormals){let p=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(p,t)}else!s&&c.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(c.exaggeration=r,c.exaggerationRelativeHeight=a,n!==void 0){n._tileToUpdateHeights.push(e);let p=e.customData;for(let A of p)A.level=-1}o.updateExaggeration(r,a)}};hr.prototype.updateSceneMode=function(e){let n=this.renderedMesh;n!==void 0&&n.updateSceneMode(e)};function byt(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(i)&&l(e.parent)){let o=e.parent,r=o.data;l(r)&&l(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=Lo.FAILED);for(let o=0,r=n.length;o<r;++o){let a=n.get(o);a.show&&a._createTileImagerySkeletons(e,t)}}function xyt(e,t,n,i,o,r){let a=e.data,s=e.parent;if(a.terrainState===Lo.FAILED&&s!==void 0&&(s.data!==void 0&&s.data.terrainData!==void 0&&s.data.terrainData.canUpsample!==!1||hr.processStateMachine(s,t,n,i,o,r,!0)),a.terrainState===Lo.FAILED&&Tyt(a,e,t,n,e.x,e.y,e.level),a.terrainState===Lo.UNLOADED&&Syt(a,n,e.x,e.y,e.level),a.terrainState===Lo.RECEIVED&&Byt(a,t,n,e.x,e.y,e.level),a.terrainState===Lo.TRANSFORMED&&(Dyt(a,t.context,n,e.x,e.y,e.level,r),a.updateExaggeration(e,t,o)),a.terrainState>=Lo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)Pyt(t.context,a);else{let u=a._findAncestorTileWithTerrainData(e);l(u)&&l(u.data.waterMaskTexture)&&(a.waterMaskTexture=u.data.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,u,a.waterMaskTranslationAndScale))}}function Tyt(e,t,n,i,o,r,a){let s=t.parent;if(!s){t.state=sc.FAILED;return}let c=s.data.terrainData,u=s.x,f=s.y,h=s.level;if(!l(c))return;let p=c.upsample(i.tilingScheme,u,f,h,o,r,a);l(p)&&(e.terrainState=Lo.RECEIVING,Promise.resolve(p).then(function(A){l(A)&&(e.terrainData=A,e.terrainState=Lo.RECEIVED)}).catch(function(){e.terrainState=Lo.FAILED}))}function Syt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=Lo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Lo.RECEIVED,e.request=void 0}function a(c){if(e.request.state===yi.CANCELLED){e.terrainData=void 0,e.terrainState=Lo.UNLOADED,e.request=void 0;return}e.terrainState=Lo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=tr.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&s()}function s(){let c=new Br({throttle:!1,throttleByServer:!0,type:es.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,o,c);l(u)?(e.terrainState=Lo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){a(f)})):(e.terrainState=Lo.UNLOADED,e.request=void 0)}s()}var wyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Byt(e,t,n,i,o,r){let a=n.tilingScheme,s=wyt;s.tilingScheme=a,s.x=i,s.y=o,s.level=r,s.exaggeration=t.verticalExaggeration,s.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,s.throttle=!0;let u=e.terrainData.createMesh(s);l(u)&&(e.terrainState=Lo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Lo.TRANSFORMED}).catch(function(){e.terrainState=Lo.FAILED}))}hr._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=tt.createVertexBuffer({context:e,typedArray:n,usage:Re.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},a=r[e.id];if(!l(a)||a.isDestroyed()){let s=t.indices;a=tt.createIndexBuffer({context:e,typedArray:s,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(s.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,r[e.id]=a,t.indices.indexBuffers=r}else++a.referenceCount;return new Vn({context:e,attributes:o,indexBuffer:a})};hr._freeVertexArray=function(e){if(l(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),l(t)&&!t.isDestroyed()&&l(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Dyt(e,t,n,i,o,r,a){e.vertexArray=hr._createVertexArrayForMesh(t,e.mesh),e.terrainState=Lo.READY,e.fill=e.fill&&e.fill.destroy(a)}function vyt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=vt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:si.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Pyt(e,t){let n=t.terrainData.waterMask,i=vyt(e),o,r=n.length;if(n instanceof ImageBitmap)o=vt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let a=Math.sqrt(r);o=vt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:He.UNSIGNED_BYTE,source:{width:a,height:a,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ie.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}hr.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;l(t)&&(!l(t.data)||!l(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};hr.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,a=o.height,s=r/i.width,c=a/i.height;return n.x=s*(o.west-i.west)/r,n.y=c*(o.south-i.south)/a,n.z=s,n.w=c,n};var nm=hr;var $be={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>=$be.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},li=$be;function BS(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 ie}BS.prototype.update=function(e,t,n){this.changedThisFrame&&(axe(e,t,this.tile,n),this.changedThisFrame=!1)};BS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};BS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):nm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Ryt=new AE;BS.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,a=o._lastSelectionFrameNumber,s=Ryt;s.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&s.enqueue(t[u])}let c=s.dequeue();for(;c!==void 0;){let u=c.findTileToWest(r),f=c.findTileToSouth(r),h=c.findTileToEast(r),p=c.findTileToNorth(r);hs(e,n,c,u,a,Tn.EAST,!1,s,i),hs(e,n,c,f,a,Tn.NORTH,!1,s,i),hs(e,n,c,h,a,Tn.WEST,!1,s,i),hs(e,n,c,p,a,Tn.SOUTH,!1,s,i);let A=u.findTileToNorth(r),m=u.findTileToSouth(r),_=h.findTileToNorth(r),y=h.findTileToSouth(r);hs(e,n,c,A,a,Tn.SOUTHEAST,!1,s,i),hs(e,n,c,_,a,Tn.SOUTHWEST,!1,s,i),hs(e,n,c,m,a,Tn.NORTHEAST,!1,s,i),hs(e,n,c,y,a,Tn.NORTHWEST,!1,s,i),c=s.dequeue()}};function hs(e,t,n,i,o,r,a,s,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||li.wasKicked(u._lastSelectionResult)||li.originalResult(u._lastSelectionResult)===li.CULLED);){if(a)return;let f=u.parent;if(r>=Tn.NORTHWEST&&f!==void 0)switch(r){case Tn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case Tn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case Tn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case Tn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===li.RENDERED){if(l(u.data.vertexArray))return;Myt(e,t,n,u,r,o,s,c);return}if(li.originalResult(i._lastSelectionResult)!==li.CULLED)switch(r){case Tn.WEST:hs(e,t,n,i.northwestChild,o,r,!0,s,c),hs(e,t,n,i.southwestChild,o,r,!0,s,c);break;case Tn.EAST:hs(e,t,n,i.southeastChild,o,r,!0,s,c),hs(e,t,n,i.northeastChild,o,r,!0,s,c);break;case Tn.SOUTH:hs(e,t,n,i.southwestChild,o,r,!0,s,c),hs(e,t,n,i.southeastChild,o,r,!0,s,c);break;case Tn.NORTH:hs(e,t,n,i.northeastChild,o,r,!0,s,c),hs(e,t,n,i.northwestChild,o,r,!0,s,c);break;case Tn.NORTHWEST:hs(e,t,n,i.northwestChild,o,r,!0,s,c);break;case Tn.NORTHEAST:hs(e,t,n,i.northeastChild,o,r,!0,s,c);break;case Tn.SOUTHWEST:hs(e,t,n,i.southwestChild,o,r,!0,s,c);break;case Tn.SOUTHEAST:hs(e,t,n,i.southeastChild,o,r,!0,s,c);break;default:throw new de("Invalid edge")}}}function Myt(e,t,n,i,o,r,a,s){let c=i.data;if(c.fill===void 0)c.fill=new BS(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,a.enqueue(i)),Nyt(e,t,n,i,o,s)}function Nyt(e,t,n,i,o,r){let a=i.data.fill,s,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(axe(e,t,n,r),c.changedThisFrame=!1),s=n.data.fill.mesh):s=n.data.mesh;let u,f;switch(o){case Tn.WEST:u=a.westMeshes,f=a.westTiles;break;case Tn.SOUTH:u=a.southMeshes,f=a.southTiles;break;case Tn.EAST:u=a.eastMeshes,f=a.eastTiles;break;case Tn.NORTH:u=a.northMeshes,f=a.northTiles;break;case Tn.NORTHWEST:a.changedThisFrame=a.changedThisFrame||a.northwestMesh!==s,a.northwestMesh=s,a.northwestTile=n;return;case Tn.NORTHEAST:a.changedThisFrame=a.changedThisFrame||a.northeastMesh!==s,a.northeastMesh=s,a.northeastTile=n;return;case Tn.SOUTHWEST:a.changedThisFrame=a.changedThisFrame||a.southwestMesh!==s,a.southwestMesh=s,a.southwestTile=n;return;case Tn.SOUTHEAST:a.changedThisFrame=a.changedThisFrame||a.southeastMesh!==s,a.southeastMesh=s,a.southeastTile=n;return}if(n.level<=i.level){a.changedThisFrame=a.changedThisFrame||u[0]!==s||u.length!==1,u[0]=s,f[0]=n,u.length=1,f.length=1;return}let h,p,A,m,_=n.rectangle,y,C=i.rectangle;switch(o){case Tn.WEST:for(y=(C.north-C.south)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.greaterThan(_.north,m.south,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.greaterThanOrEquals(_.south,m.north,y));++p);break;case Tn.SOUTH:for(y=(C.east-C.west)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.lessThan(_.west,m.east,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.lessThanOrEquals(_.east,m.west,y));++p);break;case Tn.EAST:for(y=(C.north-C.south)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.lessThan(_.south,m.north,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.lessThanOrEquals(_.north,m.south,y));++p);break;case Tn.NORTH:for(y=(C.east-C.west)*D.EPSILON5,h=0;h<f.length&&(A=f[h],m=A.rectangle,!D.greaterThan(_.east,m.west,y));++h);for(p=h;p<f.length&&(A=f[p],m=A.rectangle,!D.greaterThanOrEquals(_.west,m.east,y));++p);break}p-h===1?(a.changedThisFrame=a.changedThisFrame||u[h]!==s,u[h]=s,f[h]=n):(a.changedThisFrame=!0,u.splice(h,p-h,s),f.splice(h,p-h,n))}var k0=new me,Lyt=new me,wS=new d,D$=new d,S$=new Q,w$=new Q,If=new Q;function v8(){this.height=0,this.encodedNormal=new Q}function x8(e,t,n,i,o,r,a,s,c){if(l(o))return o;let u;if(l(r)&&l(a))u=(r.height+a.height)*.5;else if(l(r))u=r.height;else if(l(a))u=a.height;else if(l(s))u=s.height;else{let h=e.tile.data.tileBoundingRegion,p=0,A=0;l(h)&&(p=h.minimumHeight,A=h.maximumHeight),u=(p+A)*.5}return sxe(e,t,n,i,u,c),c}var Oyt={minimumHeight:0,maximumHeight:0},Fyt=new d,exe=new v8,txe=new v8,nxe=new v8,ixe=new v8,Qyt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,kyt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function axe(e,t,n,i){nm.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,a=n.rectangle,s=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=s!==1,f=n.tilingScheme.ellipsoid,h=S8(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,nxe),p=S8(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,exe),A=S8(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,txe),m=S8(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,ixe);h=x8(r,f,0,1,h,p,m,A,nxe),p=x8(r,f,0,0,p,h,A,m,exe),A=x8(r,f,1,1,A,p,m,h,txe),m=x8(r,f,1,1,m,A,h,p,ixe);let _=p.height,y=A.height,C=h.height,E=m.height,I=Math.min(_,y,C,E),x=Math.max(_,y,C,E),S=(I+x)*.5,w,v,R=e.getLevelMaximumGeometricError(n.level),N=f.maximumRadius-R,L=Math.acos(N/f.maximumRadius)*4;if(L*=1.5,a.width>L&&x-I<=R){let T=new Xc({width:9,height:9,buffer:Qyt,structure:{heightOffset:x}}),B=kyt;B.tilingScheme=n.tilingScheme,B.x=n.x,B.y=n.y,B.level=n.level,B.exaggeration=s,B.exaggerationRelativeHeight=c,r.mesh=T._createMeshSync(B)}else{let T=u,B=ce.center(a,Lyt);B.height=S;let M=f.cartographicToCartesian(B,Fyt),O=new Tr(M,void 0,void 0,void 0,void 0,!0,!0,T,s,c),G=5,k;for(k=r.westMeshes,w=0,v=k.length;w<v;++w)G+=k[w].eastIndicesNorthToSouth.length;for(k=r.southMeshes,w=0,v=k.length;w<v;++w)G+=k[w].northIndicesWestToEast.length;for(k=r.eastMeshes,w=0,v=k.length;w<v;++w)G+=k[w].westIndicesSouthToNorth.length;for(k=r.northMeshes,w=0,v=k.length;w<v;++w)G+=k[w].southIndicesEastToWest.length;let z=Oyt;z.minimumHeight=I,z.maximumHeight=x;let F=O.stride,H=new Float32Array(G*F),Y=0,$=Y;Y=T8(f,a,O,H,Y,0,1,h.height,h.encodedNormal,1,z),Y=B8(r,f,O,H,Y,r.westTiles,r.westMeshes,Tn.EAST,z);let W=Y;Y=T8(f,a,O,H,Y,0,0,p.height,p.encodedNormal,0,z),Y=B8(r,f,O,H,Y,r.southTiles,r.southMeshes,Tn.NORTH,z);let K=Y;Y=T8(f,a,O,H,Y,1,0,A.height,A.encodedNormal,0,z),Y=B8(r,f,O,H,Y,r.eastTiles,r.eastMeshes,Tn.WEST,z);let Z=Y;Y=T8(f,a,O,H,Y,1,1,m.height,m.encodedNormal,1,z),Y=B8(r,f,O,H,Y,r.northTiles,r.northMeshes,Tn.SOUTH,z),I=z.minimumHeight,x=z.maximumHeight;let pe=en.fromRectangle(a,I,x,n.tilingScheme.ellipsoid),ge=mi.geodeticLatitudeToMercatorAngle(a.south),re=1/(mi.geodeticLatitudeToMercatorAngle(a.north)-ge),ye=(mi.geodeticLatitudeToMercatorAngle(B.latitude)-ge)*re,Ce=f.geodeticSurfaceNormalCartographic(k0,D$),ve=tn.octEncode(Ce,S$),Ne=Y;O.encode(H,Y*F,pe.center,Q.fromElements(.5,.5,If),S,ve,ye,Ce),++Y;let Le=Y,Oe=Le<256?1:2,nt=(Le-1)*3,Fe=nt*Oe,_t=(H.length-Le*F)*Float32Array.BYTES_PER_ELEMENT,rt;if(_t>=Fe){let Se=Le*F*Float32Array.BYTES_PER_ELEMENT;rt=Le<256?new Uint8Array(H.buffer,Se,nt):new Uint16Array(H.buffer,Se,nt)}else rt=Le<256?new Uint8Array(nt):new Uint16Array(nt);H=new Float32Array(H.buffer,0,Le*F);let je=0;for(w=0;w<Le-2;++w)rt[je++]=Ne,rt[je++]=w,rt[je++]=w+1;rt[je++]=Ne,rt[je++]=w,rt[je++]=0;let st=[];for(w=W;w>=$;--w)st.push(w);let ft=[];for(w=K;w>=W;--w)ft.push(w);let St=[];for(w=Z;w>=K;--w)St.push(w);let be=[];for(be.push(0),w=Ne-1;w>=Z;--w)be.push(w);r.mesh=new bc(O.center,H,rt,nt,Le,I,x,a,le.fromOrientedBoundingBox(pe),jyt(e,pe.center,a,I,x),O.stride,pe,O,st,ft,St,be)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=nm._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let b=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let T=o._findAncestorTileWithTerrainData(n);l(T)&&l(T.data.waterMaskTexture)&&(r.waterMaskTexture=T.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,T,r.waterMaskTranslationAndScale))}l(b)&&(--b.referenceCount,b.referenceCount===0&&b.destroy())}function T8(e,t,n,i,o,r,a,s,c,u,f){let h=k0;h.longitude=D.lerp(t.west,t.east,r),h.latitude=D.lerp(t.south,t.north,a),h.height=s;let p=e.cartographicToCartesian(h,wS),A;n.hasGeodeticSurfaceNormals&&(A=e.geodeticSurfaceNormal(p,D$));let m=w$;return m.x=r,m.y=a,n.encode(i,o*n.stride,p,m,s,c,u,A),f.minimumHeight=Math.min(f.minimumHeight,s),f.maximumHeight=Math.max(f.maximumHeight,s),o+1}var D8=new ce;function XP(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,D8),o.west-=D.TWO_PI,o.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,D8),o.west+=D.TWO_PI,o.east+=D.TWO_PI);let a=o.east-o.west,s=(r.west-o.west)/a,c=(r.east-o.west)/a,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-s)/(c-s),A=(n.y-f)/(h-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(A)<Math.EPSILON5?A=0:Math.abs(A-1)<Math.EPSILON5&&(A=1),i.x=p,i.y=A,i}var Uyt=new Q;function B$(e,t,n,i,o){let r=e.encoding,a=e.vertices;if(o.height=r.decodeHeight(a,t),r.hasVertexNormals)r.getOctEncodedNormal(a,t,o.encodedNormal);else{let s=o.encodedNormal;s.x=0,s.y=0}}var zyt=new Q,Gyt=new d;function Vyt(e,t,n,i,o,r,a,s,c,u){let f=i.encoding,h=i.vertices,p=XP(t,n,f.decodeTextureCoordinates(h,o,If),If),A=XP(t,n,f.decodeTextureCoordinates(h,r,w$),w$),m;c?m=(a-p.x)/(A.x-p.x):m=(s-p.y)/(A.y-p.y);let _=f.decodeHeight(h,o),y=f.decodeHeight(h,r),C=n.rectangle;k0.longitude=D.lerp(C.west,C.east,a),k0.latitude=D.lerp(C.south,C.north,s),u.height=k0.height=D.lerp(_,y,m);let E;if(f.hasVertexNormals){let I=f.getOctEncodedNormal(h,o,Uyt),x=f.getOctEncodedNormal(h,r,zyt),S=tn.octDecode(I.x,I.y,wS),w=tn.octDecode(x.x,x.y,Gyt);E=d.lerp(S,w,m,wS),d.normalize(E,E),tn.octEncode(E,u.encodedNormal)}else E=e.geodeticSurfaceNormalCartographic(k0,wS),tn.octEncode(E,u.encodedNormal)}function sxe(e,t,n,i,o,r){r.height=o;let a=t.geodeticSurfaceNormalCartographic(k0,wS);tn.octEncode(a,r.encodedNormal)}function S8(e,t,n,i,o,r,a,s,c,u,f){if(rxe(e,t,s,a,!1,n,i,f)||rxe(e,t,u,c,!0,n,i,f))return f;let p;if(v$(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],B$(r,p,n,i,f),f;let A;if(n===0?i===0?A=w8(e.westMeshes,e.westTiles,Tn.EAST,e.southMeshes,e.southTiles,Tn.NORTH,n,i):A=w8(e.northMeshes,e.northTiles,Tn.SOUTH,e.westMeshes,e.westTiles,Tn.EAST,n,i):i===0?A=w8(e.southMeshes,e.southTiles,Tn.NORTH,e.eastMeshes,e.eastTiles,Tn.WEST,n,i):A=w8(e.eastMeshes,e.eastTiles,Tn.WEST,e.northMeshes,e.northTiles,Tn.SOUTH,n,i),l(A))return sxe(e,t,n,i,A,f),f}function w8(e,t,n,i,o,r,a,s){let c=oxe(e,t,!1,n,a,s),u=oxe(i,o,!0,r,a,s);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function B8(e,t,n,i,o,r,a,s,c){for(let u=0;u<r.length;++u)o=Hyt(e,t,n,i,o,r[u],a[u],s,c);return o}function Hyt(e,t,n,i,o,r,a,s,c){let u=r.rectangle;s===Tn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,D8),u.west-=D.TWO_PI,u.east-=D.TWO_PI):s===Tn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,D8),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,If),h=If.x,p=If.y);let A,m;switch(s){case Tn.WEST:A=a.westIndicesSouthToNorth,m=!1;break;case Tn.NORTH:A=a.northIndicesWestToEast,m=!0;break;case Tn.EAST:A=a.eastIndicesNorthToSouth,m=!1;break;case Tn.SOUTH:A=a.southIndicesEastToWest,m=!0;break}let _=r,y=e.tile,C=a.encoding,E=a.vertices,I=n.stride,x,S;C.hasWebMercatorT&&(x=mi.geodeticLatitudeToMercatorAngle(f.south),S=1/(mi.geodeticLatitudeToMercatorAngle(f.north)-x));for(let w=0;w<A.length;++w){let v=A[w],R=C.decodeTextureCoordinates(E,v,If);XP(_,y,R,R);let N=R.x,L=R.y,g=m?N:L;if(g<0||g>1||Math.abs(N-h)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let b=Math.abs(N)<D.EPSILON5||Math.abs(N-1)<D.EPSILON5,T=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(b&&T)continue;let B=C.decodePosition(E,v,wS),M=C.decodeHeight(E,v),O;C.hasVertexNormals?O=C.getOctEncodedNormal(E,v,S$):(O=S$,O.x=0,O.y=0);let G=L;if(C.hasWebMercatorT){let z=D.lerp(f.south,f.north,L);G=(mi.geodeticLatitudeToMercatorAngle(z)-x)*S}let k;n.hasGeodeticSurfaceNormals&&(k=t.geodeticSurfaceNormal(B,D$)),n.encode(i,o*I,B,R,M,O,G,k),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++o}return o}function oxe(e,t,n,i,o,r){let a,s,c;n?(a=0,s=e.length,c=1):(a=e.length-1,s=-1,c=-1);for(let u=a;u!==s;u+=c){let f=e[u],h=t[u];if(!v$(h,f))continue;let p;switch(i){case Tn.WEST:p=f.westIndicesSouthToNorth;break;case Tn.SOUTH:p=f.southIndicesEastToWest;break;case Tn.EAST:p=f.eastIndicesNorthToSouth;break;case Tn.NORTH:p=f.northIndicesWestToEast;break}let A=p[n?0:p.length-1];if(l(A))return f.encoding.decodeHeight(f.vertices,A)}}function v$(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function rxe(e,t,n,i,o,r,a,s){let c,u,f,h,p,A=i[o?0:n.length-1],m=n[o?0:n.length-1];if(v$(A,m)&&(r===0?a===0?(c=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(c=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):a===0?(c=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(c=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),c.length>0)){h=o?0:c.length-1,p=c[h],m.encoding.decodeTextureCoordinates(m.vertices,p,If);let _=XP(A,e.tile,If,If);if(_.x===r&&_.y===a)return B$(m,p,r,a,s),!0;if(h=Io(c,u?r:a,function(y,C){m.encoding.decodeTextureCoordinates(m.vertices,y,If);let E=XP(A,e.tile,If,If);return f?u?E.x-r:E.y-a:u?r-E.x:a-E.y}),h<0){if(h=~h,h>0&&h<c.length)return Vyt(t,A,e.tile,m,c[h-1],c[h],r,a,u,s),!0}else return B$(m,c[h],r,a,s),!0}return!1}var Wyt=[new d,new d,new d,new d];function jyt(e,t,n,i,o,r){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=Wyt;return d.fromRadians(n.west,n.south,o,s,c[0]),d.fromRadians(n.east,n.south,o,s,c[1]),d.fromRadians(n.west,n.north,o,s,c[2]),d.fromRadians(n.east,n.north,o,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var JP=BS;function Sr(e){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Bn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new _e,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(Sr.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(Sr.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(Sr.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(Sr.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new _e,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new U(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=oe.SCENE3D,this._initByMars3D&&this._initByMars3D(e)}Object.defineProperties(Sr.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){this._baseColor=e,this._firstPassInitialColor=ie.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){this._quadtree=e}},tilingScheme:{get:function(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ca.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){jm.setOwner(e,this,"_clippingPolygons")}}});function Yyt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}Sr.prototype.update=function(e){this._imageryLayers._update()};function qyt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,a=o.length;r<a;++r){let s=o.get(r);s.ready&&s.show&&l(s.imageryProvider.credit)&&n.addCreditToNextFrame(s.imageryProvider.credit)}}Sr.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(Yyt)})),qyt(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)nm._freeVertexArray(t[i]);t.length=0};Sr.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let a=t[o];l(a)&&(a.length=0)}let n=this._clippingPlanes;l(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;l(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};Sr.prototype.endUpdate=function(e){if(!l(this._renderState)){this._renderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:hc.LESS}}),this._blendRenderState=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:hc.LESS_OR_EQUAL},blending:sn.ALPHA_BLEND});let s=Ye(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=Ve.fromCache(s),s=Ye(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=Ve.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&JP.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._oldSceneMode!==e.mode;this._oldSceneMode=e.mode,r&&t.forEachLoadedTile(function(s){s.data.updateSceneMode(e.mode)});let a=this._tilesToRenderByTextureCount;for(let s=0,c=a.length;s<c;++s){let u=a[s];if(l(u))for(let f=0,h=u.length;f<h;++f){let p=u[f],A=p.data.tileBoundingRegion;dxe(this,p,e,!1);let m=this.marsOptions?.uplift;if(m&&m.enabled&&m.height!==0&&m.rectangles){for(let _=0;_<m.rectangles.length;_++)if(ce.intersection(A.rectangle,m.rectangles[_])){dxe(this,p,e,!0);break}}e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,A.minimumHeight)}}};function hxe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}Sr.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)hxe(t[n],e)};Sr.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};Sr.prototype.getLevelMaximumGeometricError=function(e){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};Sr.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;l(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===li.CULLED_BUT_NEEDED,o=n.terrainState),nm.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)!==qr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,nm.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var Kyt=new le,mxe=new ce,Xyt=new ce,Jyt=new me;function R8(e,t){if(t.west<t.east)return t;let n=ce.clone(t,Xyt);return ce.center(e,Jyt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function pxe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}Sr.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=pxe(this,t);if(t.fog.enabled&&!o&&D.fog(i,t.fog.density)>=1)return qr.NONE;let r=e.data,a=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return qr.PARTIAL;let s=t.cullingVolume,c=a.boundingVolume;l(c)||(c=a.boundingSphere),r.clippedByBoundaries=!1;let u=R8(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,mxe);if(!l(f))return qr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(c=Kyt,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,a.minimumHeight,a.maximumHeight,c),d.fromElements(c.center.z,c.center.x,c.center.y,c.center),t.mode===oe.MORPHING&&l(r.renderedMesh)&&(c=le.union(a.boundingSphere,c,c))),!l(c))return qr.PARTIAL;let h=this._clippingPlanes;if(l(h)&&h.enabled){let y=h.computeIntersectionWithBoundingVolume(c);if(e.isClipped=y!==Xt.INSIDE,y===Xt.OUTSIDE)return qr.NONE}let p=this._clippingPolygons;if(l(p)&&p.enabled){let y=p.computeIntersectionWithBoundingVolume(a);e.isClipped=y!==Xt.OUTSIDE}let A,m=s.computeVisibility(c);if(m===Xt.OUTSIDE?A=qr.NONE:m===Xt.INTERSECTING?A=qr.PARTIAL:m===Xt.INSIDE&&(A=qr.FULL),A===qr.NONE)return A;let _=t.mode===oe.SCENE3D&&t.camera.frustum instanceof An;if(t.mode===oe.SCENE3D&&!_&&l(n)&&!o){let y=r.occludeePointInScaledSpace;return!l(y)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(y,a.minimumHeight)?A:qr.NONE}return A};Sr.prototype.canRefine=function(e){return l(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var Zyt=[],$yt=[];Sr.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=Zyt;i.length=this._imageryLayers.length;let o=!1,r=!1,a;l(n)&&(o=n.terrainState===Lo.READY,r=!0,a=n.imagery);let s,c;for(s=0,c=i.length;s<c;++s)i[s]=r;if(l(a))for(s=0,c=a.length;s<c;++s){let h=a[s],p=h.loadingImagery,A=!l(p)||p.state===Hn.FAILED||p.state===Hn.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=A&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=$yt;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:li.NONE;if(p===li.RENDERED){let A=h.data;if(!l(A))continue;if(!o&&h.data.terrainState===Lo.READY)return!1;let m=h.data.imagery;for(s=0,c=m.length;s<c;++s){let _=m[s],y=_.loadingImagery,C=!l(y)||y.state===Hn.FAILED||y.state===Hn.INVALID,E=(_.loadingImagery||_.readyImagery).imageryLayer._layerIndex;if(C&&!i[E])return!1}}else p===li.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var eCt=new d;Sr.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,a=d.subtract(i.center,o,eCt),s=d.magnitude(a);return s<D.EPSILON5?0:(d.divideByScalar(a,s,a),(1-d.dot(a,r))*e._distance)};var cxe=new P,P8=new P,tCt=new ie,nCt=new ie,iCt=new ie,oCt=new d,lxe=new d,rCt=new d,aCt=new d;Sr.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let s=0,c=i.length;s<c;++s){let u=i[s];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];l(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=n};var sCt=[new d,new d,new d,new d];function uxe(e,t,n,i,o,r){let a=e.quadtree._occluders.ellipsoid,s=a.ellipsoid,c=sCt;return d.fromRadians(n.west,n.south,o,s,c[0]),d.fromRadians(n.east,n.south,o,s,c[1]),d.fromRadians(n.west,n.north,o,s,c[2]),d.fromRadians(n.east,n.north,o,s,c[3]),a.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}Sr.prototype.computeDistanceToTile=function(e,t){cCt(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,a=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let c=t.camera.positionCartographic.height,u=Math.abs(c-r),f=Math.abs(c-a);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=a,o.maximumHeight=a)}let s=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=a,s};function cCt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new nm);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new yd({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,a=r.minimumHeight,s=r.maximumHeight,c=!1,u=e,f=0,h=t.marsOptions?.flat;if(h&&h.enabled&&h.rectangles){for(let y=0;y<h.rectangles.length;y++)if(ce.intersection(e.rectangle,h.rectangles[y])){f=h.rectangles[y]._flatHeight??h.heights[y];break}}let p=t.marsOptions?.uplift,A=0;if(p&&p.enabled&&p.height!==0&&p.rectangles){for(let y=0;y<p.rectangles.length;y++)if(ce.intersection(r.rectangle,p.rectangles[y])){A=p.height;break}}let m=i.mesh,_=i.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0)r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight,c=!0;else if(_!==void 0&&_._minimumHeight!==void 0&&_._maximumHeight!==void 0)r.minimumHeight=_._minimumHeight,r.maximumHeight=_._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let y=e.parent;for(;y!==void 0;){let C=y.data;if(C!==void 0){let E=C.mesh,I=C.terrainData;if(E!==void 0&&E.minimumHeight!==void 0&&E.maximumHeight!==void 0){r.minimumHeight=E.minimumHeight,r.maximumHeight=E.maximumHeight;break}else if(I!==void 0&&I._minimumHeight!==void 0&&I._maximumHeight!==void 0){r.minimumHeight=I._minimumHeight,r.maximumHeight=I._maximumHeight;break}}y=y.parent}u=y}if(r.maximumHeight+=A,r.minimumHeight-=f,u!==void 0){let y=n.verticalExaggeration,C=n.verticalExaggerationRelativeHeight;if((y!==1||f!==0)&&(c=!1,r.minimumHeight=To.getHeight(r.minimumHeight,y,C),r.maximumHeight=To.getHeight(r.maximumHeight,y,C)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=en.clone(m.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(m.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(m.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=uxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let I=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==a||r.maximumHeight!==s||I)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=uxe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}Sr.prototype.isDestroyed=function(){return!1};Sr.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),fe(this)};function lCt(e,t,n){return function(i){let o,r,a=-1,s=i.data.imagery,c=s.length,u;for(u=0;u<c;++u)if(o=s[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){a=u;break}if(a!==-1){let f=a+e;if(o=s[f],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=a;u<f;++u)s[u].freeResources();s.splice(a,e)}return!0}}Sr.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(a){if(l(a._loadedCallbacks[e._layerIndex]))return;let s,c=a.data.imagery,u=c.length,f=-1,h=0;for(s=0;s<u;++s){let A=c[s];if((A.readyImagery??A.loadingImagery).imageryLayer===e)f===-1&&(f=s),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(a,n,p)&&(a._loadedCallbacks[e._layerIndex]=lCt(h,e,n),a.state=sc.LOADING)})};if(e.ready){let a=e.imageryProvider;a._reload=r}this._quadtree.forEachLoadedTile(function(a){e._createTileImagerySkeletons(a,n)&&(a.state=sc.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==li.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};Sr.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let a=0,s=i.length;a<s;++a){let c=i[a],u=c.loadingImagery;if(l(u)||(u=c.readyImagery),u.imageryLayer===e)o===-1&&(o=a),c.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),l(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};Sr.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};Sr.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var uCt=new P,fCt=new P;function fxe(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=P.multiplyByPoint(i,this.properties.rtc,lxe);return P.setTranslation(i,o,cxe),cxe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=P.multiplyByPoint(i,this.properties.rtc,lxe);return P.setTranslation(i,r,P8),P.multiply(o,P8,P8),P8},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?P.multiply(e.context.uniformState.view,i.modelMatrix,uCt):P.IDENTITY;return P.inverseTranspose(o,fCt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return l(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return l(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_mars3dTextureInvertColor:function(){return this.properties.mars3dTextureInvertColor},u_mars3dTextureFilterColor:function(){return this.properties.mars3dTextureFilterColor},u_mars_inverseTileWidth:function(){return this.properties.mars_inverseTileWidth},u_mars_cartographicTileRectangle:function(){return this.properties.mars_cartographicTileRectangle},u_mars_flat_enabled:function(){return this.properties.mars_flat_enabled},u_mars_flat_rectangle:function(){return this.properties.mars_flat_rectangle},u_mars_flat_texture:function(){return l(this.properties.mars_flat_texture)?this.properties.mars_flat_texture:e.context.defaultTexture},u_mars_uplift_enabled:function(){return this.properties.mars_uplift_enabled},u_mars_uplift_hideInsideOrOutside:function(){return this.properties.mars_uplift_hideInsideOrOutside},u_mars_uplift_rectangle:function(){return this.properties.mars_uplift_rectangle},u_mars_uplift_texture:function(){return l(this.properties.mars_uplift_texture)?this.properties.mars_uplift_texture:e.context.defaultTexture},u_mars_clip_enabled:function(){return this.properties.mars_clip_enabled},u_mars_clip_rectangle:function(){return this.properties.mars_clip_rectangle},u_mars_clip_texture:function(){return l(this.properties.mars_clip_texture)?this.properties.mars_clip_texture:e.context.defaultTexture},u_mars_clip_only:function(){return this.properties.mars_clip_only},u_mars_flood_enabled:function(){return this.properties.mars_flood_enabled},u_mars_flood_rectangle:function(){return this.properties.mars_flood_rectangle},u_mars_flood_texture:function(){return l(this.properties.mars_flood_texture)?this.properties.mars_flood_texture:e.context.defaultTexture},u_mars_flood_only:function(){return this.properties.mars_flood_only},properties:{initialColor:new ie(0,0,.5,1),fillHighlightColor:new U(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Q(65e5,9e6),nightFadeDistance:new Q(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new P,tileRectangle:new ie,verticalExaggerationAndRelativeHeight:new Q(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Q,southMercatorYAndOneOverHeight:new Q,waterMask:void 0,waterMaskTranslationAndScale:new ie,minMaxHeight:new Q,scaleAndBias:new P,clippingPlanesEdgeColor:U.clone(U.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ie,frontFaceAlphaByDistance:new ie,backFaceAlphaByDistance:new ie,localizedTranslucencyRectangle:new ie,undergroundColor:U.clone(U.TRANSPARENT),undergroundColorAlphaByDistance:new ie,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,mars3dTextureInvertColor:[],mars3dTextureFilterColor:[],mars_inverseTileWidth:0,mars_cartographicTileRectangle:void 0,mars_flat_enabled:!1,mars_flat_rectangle:new ie,mars_flat_texture:void 0,mars_uplift_enabled:!1,mars_uplift_hideInsideOrOutside:!1,mars_uplift_rectangle:new ie,mars_uplift_texture:void 0,mars_clip_enabled:!1,mars_clip_rectangle:new ie,mars_clip_texture:void 0,mars_clip_only:!1,mars_flood_enabled:!1,mars_flood_rectangle:new ie,mars_flood_texture:void 0,mars_flood_only:!1}};return l(t.materialUniformMap)?Pt(n,t.materialUniformMap):n}function dCt(e,t,n){let i=n.data,o,r;if(l(i.vertexArray)?(o=i.mesh,r=i.vertexArray):l(i.fill)&&l(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!l(o)||!l(r))){if(l(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=hCt(e,r,o),i.wireframeVertexArray.mesh=o}}function hCt(e,t,n){let o={indices:n.indices,primitiveType:Pe.TRIANGLES};jn.toWireframe(o);let r=o.indices,a=tt.createIndexBuffer({context:e,typedArray:r,usage:Re.STATIC_DRAW,indexDatatype:Ue.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Vn({context:e,attributes:t._attributes,indexBuffer:a})}var Axe,gxe,M8;(function(){let e=new Lt({geometry:Sm.fromDimensions({dimensions:new d(2,2,2)})}),t=new Lt({geometry:new fy({radius:1})}),n=new P,i,o;function r(a){return new Ln({geometryInstances:a,appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})}Axe=function(a,s){return a===i||(M8(),i=a,n=P.fromRotationTranslation(a.halfAxes,a.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(s),o=r(e)),o},gxe=function(a,s){return a===i||(M8(),i=a,n=P.fromTranslation(a.center,n),n=P.multiplyByUniformScale(n,a.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(s),o=r(t)),o},M8=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var mCt=new ie(0,0,0,0),pCt={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},ACt=U.TRANSPARENT,gCt=new Ht;function dxe(e,t,n,i){let o=t.data;l(o.vertexArray)||(o.fill===void 0&&(o.fill=new JP(t)),o.fill.update(e,n));let r=n.creditDisplay,a=o.terrainData;if(l(a)&&l(a.credits)){let mt=a.credits;for(let Ut=0,Gn=mt.length;Ut<Gn;++Ut)r.addCreditToNextFrame(mt[Ut])}let s=Nt.maximumTextureImageUnits,c=o.waterMaskTexture,u=o.waterMaskTranslationAndScale;!l(c)&&l(o.fill)&&(c=o.fill.waterMaskTexture,u=o.fill.waterMaskTranslationAndScale);let f=n.cameraUnderground,h=n.globeTranslucencyState,p=h.translucent,A=h.frontFaceAlphaByDistance,m=h.backFaceAlphaByDistance,_=h.rectangle,y=e.undergroundColor??ACt,C=e.undergroundColorAlphaByDistance??gCt,E=pxe(e,n)&&n.mode===oe.SCENE3D&&y.alpha>0&&(C.nearValue>0||C.farValue>0),I=e.lambertDiffuseMultiplier,x=e.vertexShadowDarkness,S=e.hasWaterMask&&l(c),w=S&&e.showWaterEffect,v=e.oceanNormalMap,R=w&&l(v),N=e.terrainProvider,L=l(N)&&e.terrainProvider.hasVertexNormals,g=n.fog.enabled&&n.fog.renderable&&!f,b=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,T=Bn.castShadows(e.shadows)&&!p,B=Bn.receiveShadows(e.shadows)&&!p,M=e.hueShift,O=e.saturationShift,G=e.brightnessShift,k=!(D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(O,0,D.EPSILON7)&&D.equalsEpsilon(G,0,D.EPSILON7)),z=!1;if(b){let mt=d.magnitude(n.camera.positionWC),Ut=e.nightFadeOutDistance;z=mt>Ut}S&&--s,R&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=h.numberOfTextureUniforms;let F=o.renderedMesh,H=F.center,Y=F.encoding,$=o.tileBoundingRegion,W=n.verticalExaggeration,K=n.verticalExaggerationRelativeHeight,Z=e.marsOptions?.uplift;i&&Z&&(K=n.verticalExaggerationRelativeHeight-Z.height/(W-1)),e.marsOptions?.uplift?.enabled&&--s,e.marsOptions?.clip?.enabled&&--s,e.marsOptions?.flat?.enabled&&--s,e.marsOptions?.flood?.enabled&&--s;let pe=W!==1,ge=Y.hasGeodeticSurfaceNormals,re=tCt,ye=0,Ce=0,ve=0,Ne=0,Le=!1;if(n.mode!==oe.SCENE3D){let mt=n.mapProjection,Ut=mt.project(ce.southwest(t.rectangle),rCt),Gn=mt.project(ce.northeast(t.rectangle),aCt);if(re.x=Ut.x,re.y=Ut.y,re.z=Gn.x,re.w=Gn.y,n.mode!==oe.MORPHING&&(H=oCt,H.x=0,H.y=(re.z+re.x)*.5,H.z=(re.w+re.y)*.5,re.x-=H.y,re.y-=H.z,re.z-=H.y,re.w-=H.z),n.mode===oe.SCENE2D&&Y.quantization===rc.BITS12){let Xe=1/(Math.pow(2,12)-1)*.5,ro=(re.z-re.x)*Xe,Vt=(re.w-re.y)*Xe;re.x-=ro,re.y-=Vt,re.z+=ro,re.w+=Vt}mt instanceof mi&&(ye=t.rectangle.south,Ce=t.rectangle.north,ve=mi.geodeticLatitudeToMercatorAngle(ye),Ne=1/(mi.geodeticLatitudeToMercatorAngle(Ce)-ve),Le=!0)}let Oe=pCt;Oe.frameState=n,Oe.surfaceTile=o,Oe.hasWaterMask=S,Oe.showReflectiveOcean=w,Oe.showOceanWaves=R,Oe.enableLighting=e.enableLighting,Oe.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Oe.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Oe.showGroundAtmosphere=b,Oe.atmosphereLightIntensity=e.atmosphereLightIntensity,Oe.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Oe.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Oe.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Oe.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Oe.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Oe.perFragmentGroundAtmosphere=z,Oe.hasVertexNormals=L,Oe.useWebMercatorProjection=Le,Oe.clippedByBoundaries=o.clippedByBoundaries,Oe.hasGeodeticSurfaceNormals=ge,Oe.hasExaggeration=pe;let nt=o.imagery,Fe=0,_t=nt.length,rt=e.showSkirts&&!f&&!p,je=e.backFaceCulling&&!f&&!p,st=je?e._renderState:e._disableCullingRenderState,ft=je?e._blendRenderState:e._disableCullingBlendRenderState,St=st,be=e._firstPassInitialColor,Se=n.context;if(l(e._debug.boundingSphereTile)||M8(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let Ut=0;Ut<mt;++Ut)e._uniformMaps[Ut]=fxe(n,e)}do{let mt=0,Ut,Gn;if(e._drawCommands.length<=e._usedDrawCommands?(Ut=new it,Ut.owner=t,Ut.cull=!1,Ut.boundingVolume=new le,Ut.orientedBoundingBox=void 0,Gn=fxe(n,e),e._drawCommands.push(Ut),e._uniformMaps.push(Gn)):(Ut=e._drawCommands[e._usedDrawCommands],Gn=e._uniformMaps[e._usedDrawCommands]),Ut.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Za=$.boundingVolume,on=$.boundingSphere;l(Za)?Axe(Za,U.RED).update(n):l(on)&&gxe(on,U.RED).update(n)}let Xe=Gn.properties;ie.clone(be,Xe.initialColor),Xe.oceanNormalMap=v,Xe.lightingFadeDistance.x=e.lightingFadeOutDistance,Xe.lightingFadeDistance.y=e.lightingFadeInDistance,Xe.nightFadeDistance.x=e.nightFadeOutDistance,Xe.nightFadeDistance.y=e.nightFadeInDistance,Xe.atmosphereLightIntensity=e.atmosphereLightIntensity,Xe.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Xe.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Xe.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Xe.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Xe.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Xe.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ro=f?m:A,Vt=f?A:m;l(ro)&&(ie.fromElements(ro.near,ro.nearValue,ro.far,ro.farValue,Xe.frontFaceAlphaByDistance),ie.fromElements(Vt.near,Vt.nearValue,Vt.far,Vt.farValue,Xe.backFaceAlphaByDistance)),ie.fromElements(C.near,C.nearValue,C.far,C.farValue,Xe.undergroundColorAlphaByDistance),U.clone(y,Xe.undergroundColor),Xe.lambertDiffuseMultiplier=I,Xe.vertexShadowDarkness=x;let Do=!l(o.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Do&&U.clone(e.fillHighlightColor,Xe.fillHighlightColor),Xe.verticalExaggerationAndRelativeHeight.x=W,Xe.verticalExaggerationAndRelativeHeight.y=K,Xe.center3D=F.center,d.clone(H,Xe.rtc),ie.clone(re,Xe.tileRectangle),Xe.southAndNorthLatitude.x=ye,Xe.southAndNorthLatitude.y=Ce,Xe.southMercatorYAndOneOverHeight.x=ve,Xe.southMercatorYAndOneOverHeight.y=Ne;let ji=nCt,Mi=R8(t.rectangle,e.cartographicLimitRectangle),zo=iCt,ii=R8(t.rectangle,_);d.fromElements(M,O,G,Xe.hsbShift);let qn=t.rectangle,Yi=1/qn.width,vo=1/qn.height;ji.x=(Mi.west-qn.west)*Yi,ji.y=(Mi.south-qn.south)*vo,ji.z=(Mi.east-qn.west)*Yi,ji.w=(Mi.north-qn.south)*vo,ie.clone(ji,Xe.localizedCartographicLimitRectangle),zo.x=(ii.west-qn.west)*Yi,zo.y=(ii.south-qn.south)*vo,zo.z=(ii.east-qn.west)*Yi,zo.w=(ii.north-qn.south)*vo,Xe.mars_inverseTileWidth=Yi,Xe.mars_cartographicTileRectangle=new Q(qn.west,qn.south);let mo=e.marsOptions?.clip;mo?(mo.rectangle?Xe.mars_clip_rectangle=new ie(mo.rectangle.west,mo.rectangle.south,mo.rectangle.width,mo.rectangle.height):Xe.mars_clip_rectangle=new ie,Xe.mars_clip_texture=mo.texture,Xe.mars_clip_only=mo.onlySelf,Xe.mars_clip_enabled=mo.enabled):(Xe.mars_clip_enabled=!1,Xe.mars_clip_rectangle=new ie,Xe.mars_clip_texture=void 0,Xe.mars_clip_only=!1);let Xo=e.marsOptions?.flood;Xo?(Xo.rectangle?Xe.mars_flood_rectangle=new ie(Xo.rectangle.west,Xo.rectangle.south,Xo.rectangle.width,Xo.rectangle.height):Xe.mars_flood_rectangle=new ie,Xe.mars_flood_texture=Xo.texture,Xe.mars_flood_only=Xo.onlySelf,Xe.mars_flood_enabled=Xo.enabled):(Xe.mars_flood_enabled=!1,Xe.mars_flood_rectangle=new ie,Xe.mars_flood_texture=void 0);let Go=e.marsOptions?.flat;Go?(Go.rectangle?Xe.mars_flat_rectangle=new ie(Go.rectangle.west,Go.rectangle.south,Go.rectangle.width,Go.rectangle.height):Xe.mars_flat_rectangle=new ie,Xe.mars_flat_texture=Go.texture,Xe.mars_flat_enabled=Go.enabled):(Xe.mars_flat_enabled=!1,Xe.mars_flat_rectangle=new ie,Xe.mars_flat_texture=void 0);let yn=e.marsOptions?.uplift;yn?(yn.rectangle?Xe.mars_uplift_rectangle=new ie(yn.rectangle.west,yn.rectangle.south,yn.rectangle.width,yn.rectangle.height):Xe.mars_uplift_rectangle=new ie,Xe.mars_uplift_texture=yn.texture,Xe.mars_uplift_enabled=(!yn.showUp||yn.enabled&&yn.height!==0)&&l(yn.rectangles)&&yn.rectangles.length>0,Xe.mars_uplift_hideInsideOrOutside=!i):(Xe.mars_uplift_enabled=!1,Xe.mars_uplift_rectangle=new ie,Xe.mars_uplift_texture=void 0,Xe.mars_uplift_hideInsideOrOutside=!1),ie.clone(zo,Xe.localizedTranslucencyRectangle);let Ei=g&&D.fog(t._distance,n.fog.density)>D.EPSILON3;k=k&&(Ei||b);let Nn=!1,Vo=!1,Ho=!1,Xa=!1,Ui=!1,Eo=!1,ps=!1,da=!1,wr=!1,As=!1,Ru=!1,Mu=!1;for(;mt<s&&Fe<_t;){let Za=nt[Fe],on=Za.readyImagery;if(++Fe,!l(on)||on.imageryLayer.alpha===0)continue;let we=Za.useWebMercatorT?on.textureWebMercator:on.texture,lt=on.imageryLayer;l(Za.textureTranslationAndScale)||(Za.textureTranslationAndScale=lt._calculateTextureTranslationAndScale(t,Za)),Xe.dayTextures[mt]=we,Xe.dayTextureTranslationAndScale[mt]=Za.textureTranslationAndScale,Xe.dayTextureTexCoordsRectangle[mt]=Za.textureCoordinateRectangle,Xe.dayTextureUseWebMercatorT[mt]=Za.useWebMercatorT,Xe.dayTextureAlpha[mt]=lt.alpha,Eo=Eo||Xe.dayTextureAlpha[mt]!==1,Xe.dayTextureNightAlpha[mt]=lt.nightAlpha,ps=ps||Xe.dayTextureNightAlpha[mt]!==1,Xe.dayTextureDayAlpha[mt]=lt.dayAlpha,ps=ps||Xe.dayTextureDayAlpha[mt]!==1,Xe.dayTextureBrightness[mt]=lt.brightness,Nn=Nn||Xe.dayTextureBrightness[mt]!==Ta.DEFAULT_BRIGHTNESS,Xe.dayTextureContrast[mt]=lt.contrast,Vo=Vo||Xe.dayTextureContrast[mt]!==Ta.DEFAULT_CONTRAST,Xe.dayTextureHue[mt]=lt.hue,Ho=Ho||Xe.dayTextureHue[mt]!==Ta.DEFAULT_HUE,Xe.dayTextureSaturation[mt]=lt.saturation,Xa=Xa||Xe.dayTextureSaturation[mt]!==Ta.DEFAULT_SATURATION,Xe.dayTextureOneOverGamma[mt]=1/lt.gamma,Ui=Ui||Xe.dayTextureOneOverGamma[mt]!==1/Ta.DEFAULT_GAMMA,Xe.dayTextureSplit[mt]=lt.splitDirection,da=da||Xe.dayTextureSplit[mt]!==0,Ru=Ru||!!lt.invertColor,Xe.mars3dTextureInvertColor[mt]=!!lt.invertColor,Mu=Mu||!!lt.filterColor,lt.filterColor?Xe.mars3dTextureFilterColor[mt]=new d(lt.filterColor.red,lt.filterColor.green,lt.filterColor.blue):Xe.mars3dTextureFilterColor[mt]=new d(1,1,1);let an=Xe.dayTextureCutoutRectangles[mt];if(l(an)||(an=Xe.dayTextureCutoutRectangles[mt]=new ie),ie.clone(ie.ZERO,an),l(lt.cutoutRectangle)){let ao=R8(qn,lt.cutoutRectangle),ha=ce.simpleIntersection(ao,qn,mxe);wr=l(ha)||wr,an.x=(ao.west-qn.west)*Yi,an.y=(ao.south-qn.south)*vo,an.z=(ao.east-qn.west)*Yi,an.w=(ao.north-qn.south)*vo}let fo=Xe.colorsToAlpha[mt];l(fo)||(fo=Xe.colorsToAlpha[mt]=new ie);let Ma=l(lt.colorToAlpha)&<.colorToAlphaThreshold>0;if(As=As||Ma,Ma){let ao=lt.colorToAlpha;fo.x=ao.red,fo.y=ao.green,fo.z=ao.blue,fo.w=lt.colorToAlphaThreshold}else fo.w=-1;if(l(on.credits)){let ao=on.credits;for(let ha=0,il=ao.length;ha<il;++ha)r.addCreditToNextFrame(ao[ha])}++mt}Xe.dayTextures.length=mt,Xe.waterMask=c,ie.clone(u,Xe.waterMaskTranslationAndScale),Xe.minMaxHeight.x=Y.minimumHeight,Xe.minMaxHeight.y=Y.maximumHeight,P.clone(Y.matrix,Xe.scaleAndBias);let Nu=e._clippingPlanes,Kd=l(Nu)&&Nu.enabled&&t.isClipped;Kd&&(Xe.clippingPlanesEdgeColor=U.clone(Nu.edgeColor,Xe.clippingPlanesEdgeColor),Xe.clippingPlanesEdgeWidth=Nu.edgeWidth);let Fs=e._clippingPolygons,Pg=l(Fs)&&Fs.enabled&&t.isClipped;Oe.numberOfDayTextures=mt,Oe.applyBrightness=Nn,Oe.applyContrast=Vo,Oe.applyHue=Ho,Oe.applySaturation=Xa,Oe.applyGamma=Ui,Oe.applyAlpha=Eo,Oe.applyDayNightAlpha=ps,Oe.applySplit=da,Oe.enableFog=Ei,Oe.enableClippingPlanes=Kd,Oe.clippingPlanes=Nu,Oe.enableClippingPolygons=Pg,Oe.clippingPolygons=Fs,Oe.hasImageryLayerCutout=wr,Oe.colorCorrect=k,Oe.highlightFillTile=Do,Oe.colorToAlpha=As,Oe.showUndergroundColor=E,Oe.translucent=p,Oe.marsOptions={invertColor:Ru,filterColor:Mu,enableUplift:e?._marsOptions?.uplift?.enabled,enableFlat:e?._marsOptions?.flat?.enabled,enableClip:e?._marsOptions?.clip?.enabled,enableFlood:e?._marsOptions?.flood?.enabled};let dm=o.renderedMesh.indices.length;rt||(dm=o.renderedMesh.indexCountWithoutSkirts),Ut.shaderProgram=e._surfaceShaderSet.getShaderProgram(Oe),Ut.castShadows=T,Ut.receiveShadows=B,Ut.renderState=St,Ut.primitiveType=Pe.TRIANGLES,Ut.vertexArray=o.vertexArray||o.fill.vertexArray,Ut.count=dm,Ut.uniformMap=Gn,Ut.pass=Be.GLOBE,e._debug.wireframe&&(dCt(Se,e,t),l(o.wireframeVertexArray)&&(Ut.vertexArray=o.wireframeVertexArray,Ut.primitiveType=Pe.LINES,Ut.count=dm*2));let pr=Ut.boundingVolume,Ja=Ut.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,$.minimumHeight,$.maximumHeight,pr),d.fromElements(pr.center.z,pr.center.x,pr.center.y,pr.center),n.mode===oe.MORPHING&&(pr=le.union($.boundingSphere,pr,pr))):(Ut.boundingVolume=le.clone($.boundingSphere,pr),Ut.orientedBoundingBox=en.clone($.boundingVolume,Ja)),Ut.dirty=!0,p&&h.updateDerivedCommands(Ut,n),hxe(Ut,n),St=ft,be=mCt}while(Fe<_t)}var N8=Sr;function _xe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(_xe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Ht.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Ht.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var L8=_xe;function yxe(e){this._ellipsoid=new dp(e.ellipsoid,d.ZERO)}Object.defineProperties(yxe.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var O8=yxe;var P$=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()}},_Ct=1e3;function Ns(e){this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=li.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new P$(_Ct),this.state=sc.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Ns.createLevelZeroTiles=function(e){let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let a=0;a<t;++a)i[o++]=new Ns({tilingScheme:e,x:a,y:r,level:0});return i};var yCt=256;function CCt(e,t,n,i){let o=n.width/yCt*i,r=Math.floor(e/o)*o,a=Math.floor(t/o)*o;return`${r.toFixed(10)},${a.toFixed(10)}`}Ns.prototype._getCacheKey=function(e,t){return CCt(e.longitude,e.latitude,this._rectangle,t)};Ns.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};Ns.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};Ns.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};Ns.prototype.updateCustomData=function(){let e=this._addedCustomData,t=this._removedCustomData;if(e.length===0&&t.length===0)return;let n=this.customData;for(let i=0;i<e.length;++i){let o=e[i];n.add(o),Cxe(this,o.positionCartographic)._addedCustomData.push(o)}this._addedCustomData.length=0;for(let i=0;i<t.length;++i){let o=t[i];n.has(o)&&n.delete(o),Cxe(this,o.positionCartographic)._removedCustomData.push(o)}this._removedCustomData.length=0};var ECt=new me;function Cxe(e,t){let n=e.northwestChild.rectangle,i=ce.southeast(n,ECt),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}Object.defineProperties(Ns.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return l(this._southwestChild)||(this._southwestChild=new Ns({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return l(this._southeastChild)||(this._southeastChild=new Ns({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return l(this._northwestChild)||(this._northwestChild=new Ns({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return l(this._northeastChild)||(this._northeastChild=new Ns({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<sc.DONE}},eligibleForUnloading:{get:function(){let e=!0;return l(this.data)&&(e=this.data.eligibleForUnloading,l(e)||(e=!0)),e}}});Ns.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]};Ns.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};Ns.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};Ns.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};Ns.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};Ns.prototype.freeResources=function(){this.clearPositionCache(),this.state=sc.START,this.renderable=!1,this.upsampledFromParent=!1,l(this.data)&&l(this.data.freeResources)&&this.data.freeResources(),F8(this._southwestChild),this._southwestChild=void 0,F8(this._southeastChild),this._southeastChild=void 0,F8(this._northwestChild),this._northwestChild=void 0,F8(this._northeastChild),this._northeastChild=void 0};function F8(e){l(e)&&e.freeResources()}var Q8=Ns;function k8(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}k8.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};k8.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Exe(this,t)),t=i}};function Exe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}k8.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&Exe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var U8=k8;function Od(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new U8,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new O8({ellipsoid:n}),this._tileLoadProgressEvent=new _e,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Od.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Od.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function ICt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,bxe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let a of r)a.level=0,e._addHeightCallbacks.push(a);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Od.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==sc.START&&e(t),t=t.replacementNext};Od.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Od.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 a=0;a<r;++a)if(o[a]===i){o.splice(a,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Od.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function bxe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Od.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(ICt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),bxe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Od.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),SCt(this,e),OCt(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=_e.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Od.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(RCt(this,e),LCt(this,e),bCt(this,e))};Od.prototype.isDestroyed=function(){return!1};Od.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var $P,Ixe=new me;function xCt(e,t){let n=ce.center(e.rectangle,Ixe),i=n.longitude-$P.longitude,o=n.latitude-$P.latitude;n=ce.center(t.rectangle,Ixe);let r=n.longitude-$P.longitude,a=n.latitude-$P.latitude;return i*i+o*o-(r*r+a*a)}var TCt=new d,ZP=[];function SCt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let h=o.tilingScheme;if(l(h)){let p=o.tilingScheme;e._levelZeroTiles=Q8.createLevelZeroTiles(p);let A=e._levelZeroTiles.length;if(ZP.length<A){ZP=new Array(A);for(let m=0;m<A;++m)ZP[m]===void 0&&(ZP[m]=new eR)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,a=r.length>1?e._occluders:void 0;$P=t.camera.positionCartographic,r.sort(xCt);let s=e._addHeightCallbacks,c=e._removeHeightCallbacks;s.forEach(h=>{let p=r.find(A=>ce.contains(A.rectangle,h.positionCartographic));p&&p._addedCustomData.push(h)}),c.forEach(h=>{let p=r.find(A=>ce.contains(A.rectangle,h.positionCartographic));p&&p._removedCustomData.push(h)}),r.forEach(h=>h.updateCustomData()),s.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=P.getTranslation(u.transform,TCt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let h=0;h<r.length;++h){let p=r[h];e._tileReplacementQueue.markTileRendered(p),p.renderable?Tc(e,p,o,t,a,!1,ZP[h]):(gg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function gg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function eR(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function xxe(){this.southwest=new eR,this.southeast=new eR,this.northwest=new eR,this.northeast=new eR}xxe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var M$=new Array(31);for(let e=0;e<M$.length;++e)M$[e]=new xxe;function wCt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let a=vCt(e,t,n)<e.maximumScreenSpaceError,s=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:li.NONE,A=e.tileProvider;if(a||i){let m=li.originalResult(p)===li.RENDERED,_=li.originalResult(p)===li.CULLED||p===li.NONE,y=n.state===sc.DONE,C=m||_||y;if(C||l(A.canRenderWithoutLosingDetail)&&(C=A.canRenderWithoutLosingDetail(n)),C){a&&gg(e,e._tileLoadQueueMedium,n,t),z8(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===li.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=li.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,a&&gg(e,e._tileLoadQueueHigh,n,t)}if(A.canRefine(n)){if(s.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){z8(e,n),gg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(s),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===li.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=li.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=li.REFINED;let _=e._tilesToRender.length,y=e._tileLoadQueueLow.length,C=e._tileLoadQueueMedium.length,E=e._tileLoadQueueHigh.length,I=e._tileToUpdateHeights.length;if(BCt(e,s,c,u,f,t,i,o),_!==e._tilesToRender.length){let x=o.allAreRenderable,S=o.anyWereRenderedLastFrame,w=o.notYetRenderableCount,v=!1;if(!x&&!S){let R=e._tilesToRender;for(let L=_;L<R.length;++L){let g=R[L];for(;g!==void 0&&g._lastSelectionResult!==li.KICKED&&g!==n;)g._lastSelectionResult=li.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=_,e._tileToUpdateHeights.length=I,z8(e,n),n._lastSelectionResult=li.RENDERED;let N=p===li.RENDERED;!N&&w>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=y,e._tileLoadQueueMedium.length=C,e._tileLoadQueueHigh.length=E,gg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,v=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=N,N||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!v&&gg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=li.RENDERED,z8(e,n),gg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===li.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function BCt(e,t,n,i,o,r,a,s){let c=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=M$[t.level],p=h.southwest,A=h.southeast,m=h.northwest,_=h.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Tc(e,t,u,r,f,a,p),Tc(e,n,u,r,f,a,A),Tc(e,i,u,r,f,a,m),Tc(e,o,u,r,f,a,_)):(Tc(e,i,u,r,f,a,m),Tc(e,t,u,r,f,a,p),Tc(e,o,u,r,f,a,_),Tc(e,n,u,r,f,a,A)):c.latitude<t.rectangle.north?(Tc(e,n,u,r,f,a,A),Tc(e,t,u,r,f,a,p),Tc(e,o,u,r,f,a,_),Tc(e,i,u,r,f,a,m)):(Tc(e,o,u,r,f,a,_),Tc(e,i,u,r,f,a,m),Tc(e,n,u,r,f,a,A),Tc(e,t,u,r,f,a,p)),h.combine(s)}function DCt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function Tc(e,t,n,i,o,r,a){if(n.computeTileVisibility(t,i,o)!==qr.NONE)return wCt(e,i,t,r,a);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),a.allAreRenderable=!0,a.anyWereRenderedLastFrame=!1,a.notYetRenderableCount=0,DCt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&gg(e,e._tileLoadQueueMedium,t,i);let s=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===s?t._lastSelectionResult:li.NONE;c!==li.CULLED_BUT_NEEDED&&c!==li.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=li.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(gg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=li.CULLED):t._lastSelectionResult=li.CULLED;t._lastSelectionResultFrame=i.frameNumber}function vCt(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof An||t.camera.frustum instanceof Aa)return PCt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,a=t.camera.frustum.sseDenominator,s=i*r/(o*a);return t.fog.enabled&&(s-=D.fog(o,t.fog.density)*t.fog.sse),s/=t.pixelRatio,s}function PCt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let a=t.context,s=a.drawingBufferWidth,c=a.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(s,c),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=D.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function z8(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function RCt(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=ki()+e._loadQueueTimeSlice,a=e._tileProvider,s=R$(e,t,a,r,n,!1);s=R$(e,t,a,r,i,s),R$(e,t,a,r,o,s)}function MCt(e,t){return e._loadPriority-t._loadPriority}function R$(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(MCt);for(let a=0,s=o.length;a<s&&(ki()<i||!r);++a){let c=o[a];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var DS=new In,G8=new me,uC=new d,NCt=[];function LCt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=NCt;n.length=0;let i=e._tileToUpdateHeights,o=ki(),r=e._updateHeightsTimeSlice,a=o+r,s=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!l(h.data)||!l(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:li.NONE;(y===li.RENDERED||y===li.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift();continue}let p=h.customData;l(h._customDataIterator)||(h._customDataIterator=p.values());let A=h._customDataIterator,m=!1,_;for(;!(_=A.next()).done;){let y=_.value,C=h.data.terrainData,E=l(C)&&C.wasCreatedByUpsampling();if(h.level>y.level&&!E){let I,x=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(l(x))I=x;else{if(l(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=d.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),s===oe.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,DS.direction),w=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,DS.origin);if(!l(w)){let v=0;l(h.data.tileBoundingRegion)&&(v=h.data.tileBoundingRegion.minimumHeight);let R=Math.min(v,-11500),N=d.multiplyByScalar(S,Math.abs(R)+1,uC);d.subtract(y.positionOnEllipsoidSurface,N,DS.origin)}}else me.clone(y.positionCartographic,G8),G8.height=-11500,c.project(G8,uC),d.fromElements(uC.z,uC.x,uC.y,uC),d.clone(uC,DS.origin),d.clone(d.UNIT_X,DS.direction);I=h.data.pick(DS,s,c,!1,uC),l(I)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,I)}if(l(I)){if(l(y.callback)){let S=u.cartesianToCartographic(I,G8);y.callback(S)}y.level=h.level}}if(ki()>=a){m=!0;break}}if(m){h._customDataIterator=A;break}else h._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function OCt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let a=i[o];n.showTileThisFrame(a,t)}}var V8=Od;function im(e){e=e??te.default;let t=new gS({ellipsoid:e}),n=new Kx;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new b8,this._material=void 0,this._surface=new V8({tileProvider:new N8({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new _e,this._undergroundColor=U.clone(U.BLACK),this._undergroundColorAlphaByDistance=new Ht(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new L8,L$(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=te.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Bn.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(im.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),l(this._material)&&L$(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,L$(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=U.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Ht.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function L$(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Ym,qP];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(h8),e._surfaceShaderSet.baseVertexShaderSource=new We({sources:[Ym,qP,m8],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new We({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function FCt(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var QCt=[],kCt={start:0,stop:0};im.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,a=QCt;a.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let h=f.pickBoundingSphere;if(o!==oe.SCENE3D)f.pickBoundingSphere=h=le.fromRectangleWithHeights2D(u.rectangle,r,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,h),d.fromElements(h.center.z,h.center.x,h.center.y,h.center);else if(l(f.renderedMesh))le.clone(f.tileBoundingRegion.boundingSphere,h);else continue;let p=di.raySphere(e,h,kCt);l(p)&&a.push(f)}a.sort(FCt(e.origin));let s,c=a.length;for(let u=0;u<c&&(s=a[u].pick(e,t.mode,t.mapProjection,n,i),!l(s));++u);return s};var UCt=new me;im.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,UCt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var zCt=new d,Txe=new d,GCt=new me,VCt=new In;function N$(e,t){return l(e)&&ce.contains(e.rectangle,t)?e:void 0}im.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=N$(n._southwestChild,e)||N$(n._southeastChild,e)||N$(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let a=this._surface._tileProvider.tilingScheme.projection,s=this._surface._tileProvider.tilingScheme.ellipsoid,c=d.fromRadians(e.longitude,e.latitude,0,s,zCt),u=VCt,f=s.geodeticSurfaceNormal(c,u.direction),h=s.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(h)){let A;l(n.data.tileBoundingRegion)&&(A=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(A??0,-11500),_=d.multiplyByScalar(f,Math.abs(m)+1,Txe);d.subtract(c,_,u.origin)}let p=n.data.pick(u,oe.SCENE3D,a,!1,Txe);if(l(p))return s.cartesianToCartographic(p,GCt).height};im.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};im.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let s=this._oceanNormalMapResource,c=s.url;if(l(c)){let u=this;s.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new vt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,a=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=a===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};im.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};im.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),fe(this)};var H8=im;var O$={position:0};function W8(e){e=e??V.EMPTY_OBJECT,this.center=d.clone(e.center??d.ZERO),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new le,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this._computedModelMatrix=new P,this.show=e.show??!0,this.material=e.material??Xi.fromType(Xi.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 it({owner:e._owner??this}),this._pickCommand=new it({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 HCt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Nc.createGeometry(Nc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:ke.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:O$,bufferUsage:Re.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}W8.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?sn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=HCt(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let _=this._oneOverEllipsoidRadiiSquared;_.x=1/(r.x*r.x),_.y=1/(r.y*r.y),_.z=1/(r.z*r.z),o=!0}(!P.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(P.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),P.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.maximumComponent(r),le.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let a=this._material!==this.material;this._material=this.material,this._material.update(t);let s=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,h,p;(a||s||i||u)&&(h=new We({sources:[YP]}),p=new We({sources:[this.material.shaderSource,jP]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:O$}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Pt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let A=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Be.TRANSLUCENT:Be.OPAQUE,A.push(f)),m.pick){let _=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(a||s||!l(this._pickSP)||u)&&(h=new We({sources:[YP]}),p=new We({sources:[this.material.shaderSource,jP],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=$t.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:O$}),_.vertexArray=this._va,_.renderState=this._rs,_.shaderProgram=this._pickSP,_.uniformMap=Pt(Pt(this._uniforms,this._pickUniforms),this.material._uniforms),_.executeInClosestFrustum=n),_.boundingVolume=this._boundingSphere,_.modelMatrix=this._computedModelMatrix,_.pass=n?Be.TRANSLUCENT:Be.OPAQUE,A.push(_)}};W8.prototype.isDestroyed=function(){return!1};W8.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),fe(this)};var j8=W8;function tR(e){e=e??V.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??te.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new j8({radii:this.ellipsoid.radii,material:Xi.fromType(Xi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new GV}Object.defineProperties(tR.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Y8=new J,WCt=new J,jCt=new d,q8=[];tR.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(At.computeIcrfToFixedMatrix(n,Y8))||At.computeTemeToPseudoFixedMatrix(n,Y8);let i=this._axes.evaluate(n,WCt);J.transpose(i,i),J.multiply(Y8,i,i);let o=GC.computeMoonPositionInEarthInertialFrame(n,jCt);J.multiplyByVector(Y8,o,o),P.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=q8,q8.length=0,t.update(e),e.commandList=r,q8.length===1?q8[0]:void 0};tR.prototype.isDestroyed=function(){return!1};tR.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),fe(this)};var K8=tR;function nR(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(nR.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function YCt(e,t,n){let i=t.createViewportQuadCommand(n8,{framebuffer:n,renderState:Ve.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}nR.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new vt({context:t,width:256,height:256,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST});this._colorTexture=n;let i=new pa({context:t,colorTextures:[n],destroyAttachments:!1});YCt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};nR.prototype.isDestroyed=function(){return!1};nR.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),fe(this)};var X8=nR;var Dxe={};function qCt(e,t,n){let i,o,r;if(e instanceof Wi){let a=Math.tan(.5*e.fovy);return i=e.near,o=e.near*a,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof Su)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var KCt=new d,Sxe=new d;function vxe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),a=n(.5),s=a-o,c=a-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/s;return D.lerp(e,-D.PI_OVER_TWO,p)}let h=(f-r)/c;return D.lerp(-D.PI_OVER_TWO,t,1-h)}}return function(o){return D.lerp(e,t,o)}}function Q$(e,t,n,i,o){let r=o,a=Math.max(n,i);if(!l(r)){let s=e.position,c=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(s,c,KCt),A=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),Sxe)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),Sxe));r=Math.min(qCt(h,A,m)*.2,1e9)}if(a<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(s){return D.lerp(n,i,s)}}function iR(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var Pxe=new d;function XCt(e,t,n,i,o,r,a,s){let c=e.camera,u=d.clone(c.position,Pxe),f=c.pitch,h=iR(c.heading,i),p=iR(c.roll,r),A=Q$(c,n,u.z,n.z,a),m=vxe(f,o,A,s);function _(y){let C=y.time/t;c.setView({orientation:{heading:D.lerp(h,i,C),pitch:m(C),roll:D.lerp(p,r,C)}}),Q.lerp(u,n,C,c.position),c.position.z=A(C)}return _}function JCt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function ZCt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var $Ct=new me,eEt=new me;function tEt(e,t,n,i,o,r,a,s,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,A=me.clone(f.positionCartographic,$Ct),m=f.pitch,_=iR(f.heading,i),y=iR(f.roll,r),C=p.cartesianToCartographic(n,eEt);A.longitude=D.zeroToTwoPi(A.longitude),C.longitude=D.zeroToTwoPi(C.longitude);let E=!1;if(l(s)){let w=D.zeroToTwoPi(s),v=Math.min(A.longitude,C.longitude),R=Math.max(A.longitude,C.longitude),N=w>=v&&w<=R;if(l(c)){let L=Math.abs(A.longitude-C.longitude),g=D.TWO_PI-L;(N?L:g)<(N?g:L)*c&&!N&&(E=!0)}else N||(E=!0)}E?JCt(A,C):ZCt(A,C);let I=Q$(f,n,A.height,C.height,a),x=vxe(m,o,I,u);function S(){let w=A.longitude,v=C.longitude,R=A.latitude,N=C.latitude;return function(g){let b=g.time/t,T=d.fromRadians(D.lerp(w,v,b),D.lerp(R,N,b),I(b),p);f.setView({destination:T,orientation:{heading:D.lerp(_,i,b),pitch:x(b),roll:D.lerp(y,r,b)}})}}return S()}function nEt(e,t,n,i,o,r,a){let s=e.camera,c=d.clone(s.position,Pxe),u=iR(s.heading,i),f=s.frustum.right-s.frustum.left,h=Q$(s,n,f,n.z,a);function p(A){let m=A.time/t;s.setView({orientation:{heading:D.lerp(u,i,m)}}),Q.lerp(c,n,m,s.position);let _=h(m),y=s.frustum,C=y.top/y.right,E=(_-(y.right-y.left))*.5;y.right+=E,y.left-=E,y.top=C*y.right,y.bottom=-y.top}return p}var wxe=new me,iEt=new d;function F$(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function Bxe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}Dxe.createTween=function(e,t){t=t??V.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===oe.MORPHING)return F$();let o=t.convert??!0,r=e.mapProjection,a=r.ellipsoid,s=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(a.cartesianToCartographic(n,wxe),n=r.project(wxe,iEt));let p=e.camera,A=t.endTransform;l(A)&&p._setTransform(A);let m=t.duration;l(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let _=t.heading??0,y=t.pitch??-D.PI_OVER_TWO,C=t.roll??0,E=e.screenSpaceCameraController;E.enableInputs=!1;let I=Bxe(E,t.complete),x=Bxe(E,t.cancel),S=p.frustum,w=e.mode===oe.SCENE2D;if(w=w&&Q.equalsEpsilon(p.position,n,D.EPSILON6),w=w&&D.equalsEpsilon(Math.max(S.right-S.left,S.top-S.bottom),n.z,D.EPSILON6),w=w||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,p.position,D.EPSILON10),w=w&&D.equalsEpsilon(D.negativePiToPi(_),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(C),D.negativePiToPi(p.roll),D.EPSILON10),w)return F$(I,x);let v=new Array(4);if(v[oe.SCENE2D]=nEt,v[oe.SCENE3D]=tEt,v[oe.COLUMBUS_VIEW]=XCt,m<=0)return F$(function(){v[i](e,1,n,_,y,C,s,c,u,f)({time:1}),typeof I=="function"&&I()},x);let R=v[i](e,m,n,_,y,C,s,c,u,f);if(!l(h)){let N=p.positionCartographic.height,L=i===oe.SCENE3D?a.cartesianToCartographic(n).height:n.z;N>L&&N>11500?h=Pa.CUBIC_OUT:h=Pa.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:I,cancel:x}};var J8=Dxe;var oEt={ROTATE:0,INFINITE_SCROLL:1},Bu=Object.freeze(oEt);function ln(e){this._scene=e,this._transform=P.clone(P.IDENTITY),this._invTransform=P.clone(P.IDENTITY),this._actualTransform=P.clone(P.IDENTITY),this._actualInvTransform=P.clone(P.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new me,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new Wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new _e,this._moveEnd=new _e,this._changed=new _e,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new P,this._invViewMatrix=new P,kxe(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new me(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,Jxe(this,ln.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*ln.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}ln.TRANSFORM_2D=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ln.TRANSFORM_2D_INVERSE=P.inverseTransformation(ln.TRANSFORM_2D,new P);ln.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);ln.DEFAULT_VIEW_FACTOR=.5;ln.DEFAULT_OFFSET=new Vh(0,-D.PI_OVER_FOUR,0);function kxe(e){P.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),P.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),P.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function rEt(e){if(!l(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=ki()):e.timeSinceMoved=Math.max(ki()-e._lastMovedTimestamp,0)/1e3}}ln.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==oe.SCENE2D};ln.prototype._updateCameraChanged=function(){let e=this;if(rEt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%D.TWO_PI;i=i>D.PI?D.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let a=Math.abs(e._changedRoll-r)%D.TWO_PI;a=a>D.PI?D.TWO_PI-a:a;let s=a/Math.PI;if(s>t&&(e._changedRoll=r),(s>t||o>t)&&e._changed.raiseEvent(Math.max(s,o)),e._mode===oe.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,A=e._changedPosition,m=e.frustum,_=e._changedFrustum,y=p.x+m.left,C=p.x+m.right,E=A.x+_.left,I=A.x+_.right,x=p.y+m.bottom,S=p.y+m.top,w=A.y+_.bottom,v=A.y+_.top,R=Math.max(y,E),N=Math.min(C,I),L=Math.max(x,w),g=Math.min(S,v),b;if(R>=N||L>=S)b=1;else{let T=_;y<E&&C>I&&x<w&&S>v&&(T=m),b=1-(N-R)*(g-L)/((T.right-T.left)*(T.top-T.bottom))}b>t&&(e._changed.raiseEvent(b),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function aEt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var sEt=new me,cEt=new d,Z8=new d,lEt=new ie,uEt=new ie,fEt=new ie,dEt=new ie,hEt=new ie;function mEt(e){let t=e._projection,n=t.ellipsoid,i=P.getColumn(e._transform,3,lEt),o=n.cartesianToCartographic(i,sEt),r=t.project(o,cEt),a=uEt;a.x=r.z,a.y=r.x,a.z=r.y,a.w=1;let s=ie.clone(ie.UNIT_X,hEt),c=ie.add(P.getColumn(e._transform,0,Z8),i,Z8);n.cartesianToCartographic(c,o),t.project(o,r);let u=fEt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,a,u),u.x=0;let f=dEt;if(d.magnitudeSquared(u)>D.EPSILON10)d.cross(s,u,f);else{let h=ie.add(P.getColumn(e._transform,1,Z8),i,Z8);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,a,f),f.x=0,d.magnitudeSquared(f)<D.EPSILON10&&(ie.clone(ie.UNIT_Y,u),ie.clone(ie.UNIT_Z,f))}d.cross(f,s,u),d.normalize(u,u),d.cross(s,u,f),d.normalize(f,f),P.setColumn(e._actualTransform,0,u,e._actualTransform),P.setColumn(e._actualTransform,1,f,e._actualTransform),P.setColumn(e._actualTransform,2,s,e._actualTransform),P.setColumn(e._actualTransform,3,a,e._actualTransform)}var k$=new d;function $c(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let a=e._direction,s=!d.equals(a,e.direction);s&&(d.normalize(e.direction,e.direction),a=d.clone(e.direction,e._direction));let c=e._up,u=!d.equals(c,e.up);u&&(d.normalize(e.up,e.up),c=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(P.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?P.equals(P.IDENTITY,e._transform)?P.clone(ln.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?aEt(e):mEt(e):P.clone(e._transform,e._actualTransform),P.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let A=e._actualTransform;if(r||p)if(e._positionWC=P.multiplyByPoint(A,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=k$;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===oe.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(s||u||h){let m=d.dot(a,d.cross(c,f,k$));if(Math.abs(1-m)>D.EPSILON2){let _=1/d.magnitudeSquared(c),y=d.dot(c,a)*_,C=d.multiplyByScalar(a,y,k$);c=d.normalize(d.subtract(c,C,e._up),e._up),d.clone(c,e.up),f=d.cross(a,c,e._right),d.clone(f,e.right)}}(s||p)&&(e._directionWC=P.multiplyByPointAsVector(A,a,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=P.multiplyByPointAsVector(A,c,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=P.multiplyByPointAsVector(A,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||s||u||h||p)&&kxe(e)}function Uxe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function zxe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function Gxe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var tH=new P,nH=new P;Object.defineProperties(ln.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return $c(this),this._invTransform}},viewMatrix:{get:function(){return $c(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return $c(this),this._invViewMatrix}},positionCartographic:{get:function(){return $c(this),this._positionCartographic}},positionWC:{get:function(){return $c(this),this._positionWC}},directionWC:{get:function(){return $c(this),this._directionWC}},upWC:{get:function(){return $c(this),this._upWC}},rightWC:{get:function(){return $c(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,tH),n=At.eastNorthUpToFixedFrame(this.positionWC,e,nH);this._setTransform(n);let i=Uxe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,tH),n=At.eastNorthUpToFixedFrame(this.positionWC,e,nH);this._setTransform(n);let i=zxe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,tH),n=At.eastNorthUpToFixedFrame(this.positionWC,e,nH);this._setTransform(n);let i=Gxe(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}}});ln.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===oe.SCENE2D&&jxe(this,this.position)};var pEt=new d,AEt=new d,gEt=new d;ln.prototype._setTransform=function(e){let t=d.clone(this.positionWC,pEt),n=d.clone(this.upWC,AEt),i=d.clone(this.directionWC,gEt);P.clone(e,this._transform),this._transformChanged=!0,$c(this);let o=this._actualInvTransform;P.multiplyByPoint(o,t,this.position),P.multiplyByPointAsVector(o,i,this.direction),P.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),$c(this)};var _Et=new Q,yEt=new In,CEt=new d,EEt=new d;function Vxe(e){if(!P.equals(P.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=_Et;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let s=e.getPickRay(i,yEt);o=n.pickWorldCoordinates(s,t,!0,CEt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,EEt));let a;if(l(o)||l(r)){let s=l(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;a=Math.min(s,c)}else a=Math.max(e.positionCartographic.height,0);return a}ln.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof An&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Vxe(this)))};var iH=new d,H$=new P,IEt=new P,W$=new Qe,j$=new J,Hxe=new me;function bEt(e,t,n){let i=P.clone(e.transform,H$),o=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,IEt);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let r=Qe.fromHeadingPitchRoll(n,W$),a=J.fromQuaternion(r,j$);J.getColumn(a,0,e.direction),J.getColumn(a,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function xEt(e,t,n,i){let o=P.clone(e.transform,H$);if(e._setTransform(P.IDENTITY),!d.equals(t,e.positionWC)){if(i){let s=e._projection,c=s.ellipsoid.cartesianToCartographic(t,Hxe);t=s.project(c,iH)}d.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let r=Qe.fromHeadingPitchRoll(n,W$),a=J.fromQuaternion(r,j$);J.getColumn(a,0,e.direction),J.getColumn(a,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function TEt(e,t,n,i){let o=P.clone(e.transform,H$);if(e._setTransform(P.IDENTITY),!d.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,Hxe);t=c.project(u,iH)}Q.clone(t,e.position);let r=-t.z*.5,a=-r,s=e.frustum;if(a>r){let c=s.top/s.right;s.right=a,s.left=r,s.top=s.right*c,s.bottom=-s.top}}if(e._scene.mapMode2D===Bu.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let r=Qe.fromHeadingPitchRoll(n,W$),a=J.fromQuaternion(r,j$);J.getColumn(a,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var SEt=new d,wEt=new d,BEt=new d;function Wxe(e,t,n,i){let o=d.clone(n.direction,SEt),r=d.clone(n.up,wEt);if(e._scene.mode===oe.SCENE3D){let s=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,s,tH),u=P.inverseTransformation(c,nH);P.multiplyByPointAsVector(u,o,o),P.multiplyByPointAsVector(u,r,r)}let a=d.cross(o,r,BEt);return i.heading=Uxe(o,r),i.pitch=zxe(o),i.roll=Gxe(o,r,a),i}var V$={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},vS=new Rc;ln.prototype.setView=function(e){e=e??V.EMPTY_OBJECT;let t=e.orientation??V.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,iH);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,iH),i=!1),l(t.direction)&&(t=Wxe(this,o,t,V$.orientation)),vS.heading=t.heading??0,vS.pitch=t.pitch??-D.PI_OVER_TWO,vS.roll=t.roll??0,n===oe.SCENE3D?bEt(this,o,vS):n===oe.SCENE2D?TEt(this,o,vS,i):xEt(this,o,vS,i)};var DEt=new d;ln.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:ln.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:P.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(ln.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*ln.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:P.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,DEt).z),roll:0},endTransform:P.IDENTITY,convert:!1})}};ln.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ie),$c(this),P.multiplyByVector(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new d),$c(this),P.multiplyByPoint(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new d),$c(this),P.multiplyByPointAsVector(this._actualInvTransform,e,t)};ln.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ie),$c(this),P.multiplyByVector(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new d),$c(this),P.multiplyByPoint(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new d),$c(this),P.multiplyByPointAsVector(this._actualTransform,e,t)};function jxe(e,t){let n=e._scene.mapMode2D===Bu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,a;n?(a=i,r=-a):(a=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=a),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Rxe=new d;ln.prototype.move=function(e,t){let n=this.position;d.multiplyByScalar(e,t,Rxe),d.add(n,Rxe,n),this._mode===oe.SCENE2D&&jxe(this,n),this._adjustOrthographicFrustum(!0)};ln.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?oH(this,e):this.move(this.direction,e)};ln.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?oH(this,-e):this.move(this.direction,-e)};ln.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};ln.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};ln.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};ln.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};ln.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};ln.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};ln.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};ln.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var vEt=new Qe,PEt=new J;ln.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Qe.fromAxisAngle(e,-n,vEt),o=J.fromQuaternion(i,PEt),r=this.direction,a=this.up,s=this.right;J.multiplyByVector(o,r,r),J.multiplyByVector(o,a,a),J.multiplyByVector(o,s,s)};ln.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};ln.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var REt=new Qe,MEt=new J;ln.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Qe.fromAxisAngle(e,-n,REt),o=J.fromQuaternion(i,MEt);J.multiplyByVector(o,this.position,this.position),J.multiplyByVector(o,this.direction,this.direction),J.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};ln.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,Yxe(this,e)};ln.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,Yxe(this,-e)};var NEt=new d,LEt=new d,OEt=new d,Mxe=new d;function Yxe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,D.EPSILON2)){let i=d.normalize(n,NEt),o=d.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,Mxe),D.EPSILON2);if(!o&&!r){let a=d.normalize(e.constrainedAxis,LEt),s=d.dot(i,a),c=D.acosClamped(s);t>0&&t>c&&(t=c-D.EPSILON4),s=d.dot(i,d.negate(a,Mxe)),c=D.acosClamped(s),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=d.cross(a,i,OEt);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}ln.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,qxe(this,-e)};ln.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,qxe(this,e)};function qxe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function oH(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,a=e._maxCoord.y;e._scene.mapMode2D===Bu.ROTATE&&(a*=e.maximumZoomFactor),r>a&&(r=a,o=-a),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,a=e._maxCoord.x;e._scene.mapMode2D===Bu.ROTATE&&(a*=e.maximumZoomFactor),o>a&&(o=a,r=-a),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Kxe(e,t){e.move(e.direction,t)}ln.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?oH(this,e):Kxe(this,e)};ln.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?oH(this,-e):Kxe(this,-e)};ln.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return d.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var FEt=new P;ln.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??te.default,o=At.eastNorthUpToFixedFrame(e,i,FEt);this.lookAtTransform(o,t)};var QEt=new d,kEt=new Qe,UEt=new Qe,zEt=new J;function Xxe(e,t,n){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let i=Qe.fromAxisAngle(d.UNIT_Y,-t,kEt),o=Qe.fromAxisAngle(d.UNIT_Z,-e,UEt),r=Qe.multiply(o,i,o),a=J.fromQuaternion(r,zEt),s=d.clone(d.UNIT_X,QEt);return J.multiplyByVector(a,s,s),d.negate(s,s),d.multiplyByScalar(s,n,s),s}ln.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=Xxe(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){Q.clone(Q.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<D.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(P.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<D.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var oR=new me,GEt=new me,VEt=new d,HEt=new d,WEt=new d,jEt=new d,YEt=new d,qEt=new d,KEt=new d,U$=new d,XEt={direction:new d,right:new d,up:new d},Nxe;function Zc(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function Jxe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:XEt,{north:a,south:s,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,h;if(s<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&a>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)h=0;else{let N=oR;N.longitude=f,N.latitude=a,N.height=0;let L=GEt;L.longitude=f,L.latitude=s,L.height=0;let g=Nxe;(!l(g)||g.ellipsoid!==o)&&(Nxe=g=new i_(void 0,void 0,o)),g.setEndPoints(N,L),h=g.interpolateUsingFraction(.5,oR).latitude}let p=oR;p.longitude=f,p.latitude=h,p.height=0;let A=o.cartographicToCartesian(p,KEt),m=oR;m.longitude=u,m.latitude=a;let _=o.cartographicToCartesian(m,VEt);m.longitude=c;let y=o.cartographicToCartesian(m,WEt);m.longitude=f;let C=o.cartographicToCartesian(m,YEt);m.latitude=s;let E=o.cartographicToCartesian(m,qEt);m.longitude=u;let I=o.cartographicToCartesian(m,jEt);m.longitude=c;let x=o.cartographicToCartesian(m,HEt);d.subtract(y,A,y),d.subtract(I,A,I),d.subtract(_,A,_),d.subtract(x,A,x),d.subtract(C,A,C),d.subtract(E,A,E);let S=o.geodeticSurfaceNormal(A,r.direction);d.negate(S,S);let w=d.cross(S,d.UNIT_Z,r.right);d.normalize(w,w);let v=d.cross(w,S,r.up),R;if(e.frustum instanceof An){let N=Math.max(d.distance(_,y),d.distance(I,x)),L=Math.max(d.distance(_,I),d.distance(y,x)),g,b,T=e.frustum._offCenterFrustum,B=T.right/T.top,M=L*B;N>M?(g=N,b=g/B):(b=L,g=M),R=Math.max(g,b)}else{let N=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*N;if(R=Math.max(Zc(S,v,y,N),Zc(S,v,I,N),Zc(S,v,_,N),Zc(S,v,x,N),Zc(S,v,C,N),Zc(S,v,E,N),Zc(S,w,y,L),Zc(S,w,I,L),Zc(S,w,_,L),Zc(S,w,x,L),Zc(S,w,C,L),Zc(S,w,E,L)),s<0&&a>0){let g=oR;g.longitude=c,g.latitude=0,g.height=0;let b=o.cartographicToCartesian(g,U$);d.subtract(b,A,b),R=Math.max(R,Zc(S,v,b,N),Zc(S,w,b,L)),g.longitude=u,b=o.cartographicToCartesian(g,U$),d.subtract(b,A,b),R=Math.max(R,Zc(S,v,b,N),Zc(S,w,b,L))}}return d.add(A,d.multiplyByScalar(S,-R,U$),n)}var JEt=new me,ZEt=new d,$Et=new d;function e0t(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,a=JEt;a.longitude=t.east,a.latitude=t.north;let s=i.project(a,ZEt);P.multiplyByPoint(o,s,s),P.multiplyByPoint(r,s,s),a.longitude=t.west,a.latitude=t.south;let c=i.project(a,$Et);if(P.multiplyByPoint(o,c,c),P.multiplyByPoint(r,c,c),n.x=(s.x-c.x)*.5+c.x,n.y=(s.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((s.x-c.x)/f,(s.y-c.y)/u)*.5}else{let u=s.x-c.x,f=s.y-c.y;n.z=Math.max(u,f)}return n}var t0t=new me,n0t=new d,i0t=new d;function o0t(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Bu.INFINITE_SCROLL?o+=D.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=t0t;r.longitude=o,r.latitude=t.north;let a=i.project(r,n0t);r.longitude=t.west,r.latitude=t.south;let s=i.project(r,i0t),c=Math.abs(a.x-s.x)*.5,u=Math.abs(a.y-s.y)*.5,f,h,p=e.frustum.right/e.frustum.top,A=u*p;return c>A?(f=c,h=f/p):(h=u,f=A),u=Math.max(2*f,2*h),n.x=(a.x-s.x)*.5+s.x,n.y=(a.y-s.y)*.5+s.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}ln.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new d),n===oe.SCENE3D)return Jxe(this,e,t);if(n===oe.COLUMBUS_VIEW)return e0t(this,e,t);if(n===oe.SCENE2D)return o0t(this,e,t)};var r0t=new In;function a0t(e,t,n,i){n=n??te.default;let o=e.getPickRay(t,r0t),r=di.rayEllipsoid(o,n);if(!r)return;let a=r.start>0?r.start:r.stop;return In.getPoint(o,a,i)}var s0t=new In;function c0t(e,t,n,i){let r=e.getPickRay(t,s0t).origin;r=d.fromElements(r.y,r.z,0,r);let a=n.unproject(r);if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(a,i)}var l0t=new In;function u0t(e,t,n,i){let o=e.getPickRay(t,l0t),r=-o.origin.x/o.direction.x;In.getPoint(o,r,i);let a=n.unproject(new d(i.y,i.z,0));if(!(a.latitude<-D.PI_OVER_TWO||a.latitude>D.PI_OVER_TWO||a.longitude<-Math.PI||a.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(a,i)}ln.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new d),t=t??te.default,this._mode===oe.SCENE3D)n=a0t(this,e,t,n);else if(this._mode===oe.SCENE2D)n=c0t(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=u0t(this,e,this._projection,n);else return;return n}};var f0t=new d,d0t=new d,h0t=new d;function m0t(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,a=Math.tan(e.frustum.fovy*.5),s=e.frustum.aspectRatio*a,c=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,c,f0t);d.add(h,p,p);let A=d.multiplyByScalar(e.rightWC,u*c*s,d0t),m=d.multiplyByScalar(e.upWC,f*c*a,h0t),_=d.add(p,A,n.direction);return d.add(_,m,_),d.subtract(_,h,_),d.normalize(_,_),n}var $8=new d;function p0t(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,a=e.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2/o*t.x-1;c*=(a.right-a.left)*.5;let u=2/r*(r-t.y)-1;u*=(a.top-a.bottom)*.5;let f=n.origin;if(d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,c,$8),d.add($8,f,f),d.multiplyByScalar(e.upWC,u,$8),d.add($8,f,f),d.clone(e.directionWC,n.direction),e._mode===oe.SCENE2D&&e._scene.mapMode2D===Bu.INFINITE_SCROLL){let h=e._maxCoord.x;f.y=D.mod(f.y+h,2*h)-h}return n}ln.prototype.getPickRay=function(e,t){l(t)||(t=new In);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?m0t(this,e,t):p0t(this,e,t)};var A0t=new d,g0t=new d;ln.prototype.distanceToBoundingSphere=function(e){let t=d.subtract(this.positionWC,e.center,A0t),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),g0t);return Math.max(0,d.magnitude(n)-e.radius)};var _0t=new Q;ln.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,_0t);return Math.max(o.x,o.y)};function y0t(e,t,n,i,o,r){let a=d.clone(t);n.y>i?a.y-=n.y-i:n.y<-i&&(a.y+=-i-n.y),n.z>o?a.z-=n.z-o:n.z<-o&&(a.z+=-o-n.z);function s(c){let u=d.lerp(t,a,c.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Pa.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:s}}var C0t=new d,Lxe=new d,E0t=new d,I0t=new d;function b0t(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,C0t),r=-d.dot(o,n)/d.dot(o,i),a=d.add(n,d.multiplyByScalar(i,r,Lxe),Lxe);e.cameraToWorldCoordinatesPoint(a,a),n=e.cameraToWorldCoordinatesPoint(e.position,E0t);let s=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*s,u=d.magnitude(d.subtract(n,a,I0t)),f=c*u,h=s*u,p=e._maxCoord.x,A=e._maxCoord.y,m=Math.max(f-p,p),_=Math.max(h-A,A);if(n.z<-m||n.z>m||n.y<-_||n.y>_){let y=a.y<-m||a.y>m,C=a.z<-_||a.z>_;if(y||C)return y0t(e,n,a,m,_,t)}}ln.prototype.createCorrectPositionTween=function(e){if(this._mode===oe.COLUMBUS_VIEW)return b0t(this,e)};var x0t=new d,Ls={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};ln.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};ln.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ls.destination,e.orientation.heading=Ls.heading,e.orientation.pitch=Ls.pitch,e.orientation.roll=Ls.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};ln.prototype.flyTo=function(e){e=e??V.EMPTY_OBJECT;let t=e.destination;if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,x0t));let o=e.orientation??V.EMPTY_OBJECT;if(l(o.direction)&&(o=Wxe(this,t,o,V$.orientation)),l(e.duration)&&e.duration<=0){let f=V$;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,a;Ls.destination=t,Ls.heading=o.heading,Ls.pitch=o.pitch,Ls.roll=o.roll,Ls.duration=e.duration,Ls.complete=function(){a===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},Ls.cancel=e.cancel,Ls.endTransform=e.endTransform,Ls.convert=i?!1:e.convert,Ls.maximumHeight=e.maximumHeight,Ls.pitchAdjustHeight=e.pitchAdjustHeight,Ls.flyOverLongitude=e.flyOverLongitude,Ls.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ls.easingFunction=e.easingFunction;let s=this._scene,c=J8.createTween(s,Ls);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}a=s.tweens.add(c),this._currentFlight=a;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(l(u)||(u=ln.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function T0t(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function S0t(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,a=n.right/n.top,s=t*a;return t>s?(o=t,r=o/a):(r=t,o=s),Math.max(o,r)*1.5}var w0t=100;function Zxe(e,t,n){n=Vh.clone(l(n)?n:ln.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let a=t.radius;a===0?n.range=w0t:e.frustum instanceof An||e._mode===oe.SCENE2D?n.range=S0t(e,a):n.range=T0t(e,a),n.range=D.clamp(n.range,i,o)}return n}ln.prototype.viewBoundingSphere=function(e,t){t=Zxe(this,e,t),this.lookAt(e.center,t)};var B0t=new P,D0t=new d,v0t=new d,P0t=new d,R0t=new d,M0t=new ie,N0t=new Qe,L0t=new J;ln.prototype.flyToBoundingSphere=function(e,t){t=t??V.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(P.IDENTITY);let i=Zxe(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,D0t):o=Xxe(i.heading,i.pitch,i.range);let a=this._scene.ellipsoid??te.default,s=At.eastNorthUpToFixedFrame(e.center,a,B0t);P.multiplyByPoint(s,o,o);let c,u;if(!n){if(c=d.subtract(e.center,o,v0t),d.normalize(c,c),u=P.multiplyByPointAsVector(s,d.UNIT_Z,P0t),1-Math.abs(d.dot(c,u))<D.EPSILON6){let h=Qe.fromAxisAngle(c,i.heading,N0t),p=J.fromQuaternion(h,L0t);d.fromCartesian4(P.getColumn(s,1,M0t),u),J.multiplyByVector(p,u,u)}let f=d.cross(c,u,R0t);d.cross(f,c,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var Oxe=new d,Fxe=new d,z$=new d,Qxe=new d,rR=[new d,new d,new d,new d];function O0t(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,Oxe),r=d.magnitude(o),a=d.normalize(o,Fxe),s,c;d.equalsEpsilon(a,d.UNIT_Z,D.EPSILON10)?(s=new d(0,1,0),c=new d(0,0,1)):(s=d.normalize(d.cross(d.UNIT_Z,a,z$),z$),c=d.normalize(d.cross(a,s,Qxe),Qxe));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(a,1/r,Oxe),h=u/r,p=d.multiplyByScalar(s,h,Fxe),A=d.multiplyByScalar(c,h,z$),m=d.add(f,A,rR[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let _=d.subtract(f,A,rR[1]);d.subtract(_,p,_),d.multiplyComponents(n,_,_);let y=d.subtract(f,A,rR[2]);d.add(y,p,y),d.multiplyComponents(n,y,y);let C=d.add(f,A,rR[3]);return d.add(C,p,C),d.multiplyComponents(n,C,C),rR}var G$=new Q,F0t=new d,fC=[new me,new me,new me,new me];function eH(e,t,n,i,o,r){G$.x=e,G$.y=t;let a=i.pickEllipsoid(G$,o,F0t);return l(a)?(fC[n]=o.cartesianToCartographic(a,fC[n]),1):(fC[n]=o.cartesianToCartographic(r[n],fC[n]),0)}ln.prototype.computeViewRectangle=function(e,t){e=e??te.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Xt.OUTSIDE)return;let r=this._scene.canvas,a=r.clientWidth,s=r.clientHeight,c=0,u=O0t(this,e);if(c+=eH(0,0,0,this,e,u),c+=eH(0,s,1,this,e,u),c+=eH(a,s,2,this,e,u),c+=eH(a,0,3,this,e,u),c<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(fC,t);let f=0,h=fC[3].longitude;for(let p=0;p<4;++p){let A=fC[p].longitude,m=Math.abs(A-h);m>D.PI?f+=D.TWO_PI-m:f+=m,h=A}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,fC[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};ln.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof Wi)return;let e=this._scene;this.frustum=new Wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};ln.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof An)return;let e=Vxe(this),t=this._scene;this.frustum=new An,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};ln.clone=function(e,t){return l(t)||(t=new ln(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),P.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Bo=ln;function Q0t(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var om=Q0t;var iTe=Na(Fu(),1),$xe=576,k0t=100,aR="#ffffff",rH="#48b";function oTe(e,t){this.credit=e,this.count=t??1}function U0t(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Et.equals(o,t))return!0}return!1}function z0t(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Et.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var rTe="cesium-credit-delimiter";function eTe(e){let t=document.createElement("span");return t.textContent=e,t.className=rTe,t}function tTe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function nTe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(a,s){return s.count-a.count});for(let a=0;a<t.length;++a){let s=t[a].credit;if(l(s)){if(r=a,l(n)&&(r*=2,a>0)){let u=r-1;if(o.length<=u)e.appendChild(eTe(n));else{let f=o[u];f.className!==rTe&&e.replaceChild(eTe(n),f)}}let c=s.element;if(o.length<=r)e.appendChild(tTe(c,i));else{let u=o[r];u._creditId!==s._id&&e.replaceChild(tTe(c,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function G0t(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<$xe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=$xe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function V0t(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: ${aR};
|
|
position: relative;
|
|
min-height: ${k0t}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: ${aR};
|
|
}
|
|
.cesium-credit-lightbox > ul > li a:hover {
|
|
color: ${rH};
|
|
}
|
|
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
|
|
border: 1px solid #444;
|
|
border-radius: 5px;
|
|
max-width: 470px;
|
|
}
|
|
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
.cesium-credit-lightbox-title {
|
|
padding: 20px 20px 0 20px;
|
|
}
|
|
.cesium-credit-lightbox-close {
|
|
font-size: 18pt;
|
|
cursor: pointer;
|
|
position: absolute;
|
|
top: 0;
|
|
right: 6px;
|
|
color: ${aR};
|
|
}
|
|
.cesium-credit-lightbox-close:hover {
|
|
color: ${rH};
|
|
}
|
|
.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: ${aR};
|
|
}
|
|
.cesium-credit-expand-link:hover {
|
|
color: ${rH};
|
|
}
|
|
|
|
.cesium-credit-text {
|
|
color: ${aR};
|
|
}
|
|
|
|
.cesium-credit-delimiter {
|
|
padding: 0 5px;
|
|
}
|
|
|
|
.cesium-credit-textContainer *,
|
|
.cesium-credit-logoContainer * {
|
|
display: inline;
|
|
}
|
|
|
|
.cesium-credit-textContainer a:hover {
|
|
color: ${rH}
|
|
}
|
|
|
|
.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 a=r.getRootNode();if(a instanceof ShadowRoot)return a}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Lr(e,t,n){let i=this;n=n??document.body;let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function a(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",a,!1);let s=document.createElement("div");s.className="cesium-credit-lightbox-title",s.textContent="Data provided by:",r.appendChild(s);let c=document.createElement("a");c.onclick=this.hideLightbox.bind(this),c.innerHTML="×",c.className="cesium-credit-lightbox-close",r.appendChild(c);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),V0t(e);let A=Et.clone(Lr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=a,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=A,this._previousCesiumCredit=void 0,this._currentCesiumCredit=A,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ft,lightboxCredits:new Ft},this._defaultCredit=void 0,this.viewport=n,this.container=e}function aTe(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,a=e._creditDisplayElementPoolIndex;a<r.length?(o=r[a],o.credit=n,o.count=i):(o=new oTe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Lr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Et.clone(sTe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,aTe(this,t,e)};Lr.prototype.addStaticCredit=function(e){let t=this._staticCredits;U0t(t,e)||t.push(e)};Lr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Lr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};Lr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};Lr.prototype.update=function(){this._expanded&&G0t(this)};Lr.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],a=r.showOnScreen?t:n;r.isIon()&&Et.equals(Lr.cesiumCredit,this._cesiumCredit)||aTe(this,a,r,Number.MAX_VALUE)}Et.equals(Lr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Et.clone(Lr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Lr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;nTe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",nTe(this._creditList,t,void 0,"li"),z0t(this)};Lr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),fe(this)};Lr.prototype.isDestroyed=function(){return!1};Lr._cesiumCredit=void 0;Lr._cesiumCreditInitialized=!1;var aH;function sTe(){if(!l(aH)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new iTe.default(e).path()),aH=new Et(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Lr._cesiumCreditInitialized||(Lr._cesiumCredit=aH,Lr._cesiumCreditInitialized=!0),aH}Object.defineProperties(Lr,{cesiumCredit:{get:function(){return sTe(),Lr._cesiumCredit},set:function(e){Lr._cesiumCredit=e,Lr._cesiumCreditInitialized=!0}}});Lr.CreditDisplayElement=oTe;var sH=Lr;function cH(e){e=e??V.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??U.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var H0t=new d,W0t=new J,j0t=new Qe,Y0t=new Wi,q0t=new Su,K0t=new An,X0t=new Aa,J0t=new U,Z0t=[1,1e5];cH.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,a=r.frustum,s;a instanceof Wi?s=Y0t:a instanceof Su?s=q0t:a instanceof An?s=K0t:s=X0t,s=a.clone(s);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=Z0t,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,A=r.rightWC;A=d.negate(A,H0t);let m=W0t;J.setColumn(m,0,A,m),J.setColumn(m,1,p,m),J.setColumn(m,2,h,m);let _=Qe.fromRotationMatrix(m,j0t);for(t.length=n.length=c,i=0;i<c;++i)s.near=u[i],s.far=u[i+1],t[i]=new Ln({geometryInstances:new Lt({geometry:new yS({origin:f,orientation:_,frustum:s,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(U.fromAlpha(this._color,.1,J0t))},id:this.id,pickPrimitive:this}),appearance:new gn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Ln({geometryInstances:new Lt({geometry:new MV({origin:f,orientation:_,frustum:s,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};cH.prototype.isDestroyed=function(){return!1};cH.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return fe(this)};var _g=cH;function cR(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 sR=hn.supportsTypedArrays()?new Float32Array(12):[],cTe=new d,lTe=new d,Y$=new d,uTe=new d,lH=new d;function $0t(e,t){let n=e.radii,i=t.camera,o,r,a;if(i.frustum instanceof An)o=d.ZERO,r=i.rightWC,a=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,cTe),A=d.normalize(p,lTe),m=d.normalize(d.cross(d.UNIT_Z,p,Y$),Y$),_=d.normalize(d.cross(A,m,uTe),uTe),y=d.magnitude(p),C=Math.sqrt(y*y-1);o=d.multiplyByScalar(A,1/y,cTe);let E=C/y;r=d.multiplyByScalar(m,E,lTe),a=d.multiplyByScalar(_,E,Y$)}let s=d.add(o,a,lH);d.subtract(s,r,s),d.multiplyComponents(n,s,s),d.pack(s,sR,0);let c=d.subtract(o,a,lH);d.subtract(c,r,c),d.multiplyComponents(n,c,c),d.pack(c,sR,3);let u=d.add(o,a,lH);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,sR,6);let f=d.subtract(o,a,lH);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,sR,9),sR}cR.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new te(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=Ve.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new it({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:Be.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let a=new We({sources:[f8]}),s=new We({sources:[u8]});o&&(s.defines.push("LOG_DEPTH"),a.defines.push("LOG_DEPTH")),this._sp=$t.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=$0t(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let a=new yt({attributes:{position:new Me({componentDatatype:j.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Pe.TRIANGLES});this._va=Vn.fromGeometry({context:t,geometry:a,attributeLocations:{position:0},bufferUsage:Re.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};cR.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};cR.prototype.isDestroyed=function(){return!1};cR.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var uH=cR;function RS(){}var eIt=/\bgl_FragDepth\b/,tIt=/\bdiscard\b/;function nIt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let s=0;s<r.length;++s)if(eIt.test(r[s])||tIt.test(r[s])){o=!0;break}let a=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!a){let s=`void main()
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
}
|
|
`;i=new We({sources:[s]})}else if(!o&&a){let s=`void main()
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
czm_writeLogDepth();
|
|
}
|
|
`;i=new We({defines:["LOG_DEPTH"],sources:[s]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function iIt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=Ve.fromCache(o);return n[t.id]=r,r}RS.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=it.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=nIt(n,t.shaderProgram),i.depthOnlyCommand.renderState=iIt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var oIt=/\s+czm_writeLogDepth\(/,rIt=/\s+czm_vertexLogDepth\(/;function aIt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),a=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),a.defines=l(a.defines)?a.defines.slice(0):[],a.defines.push("LOG_DEPTH");let s=!1,c=r.sources;for(let f=0;f<c.length;++f)if(rIt.test(c[f])){s=!0;break}if(!s){for(let h=0;h<c.length;++h)c[h]=We.replaceMain(c[h],"czm_log_depth_main");c.push(`
|
|
|
|
void main()
|
|
{
|
|
czm_log_depth_main();
|
|
czm_vertexLogDepth();
|
|
}
|
|
`)}c=a.sources,s=!1;for(let f=0;f<c.length;++f)oIt.test(c[f])&&(s=!0);a.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(s=!0);let u="";if(!s){for(let f=0;f<c.length;f++)c[f]=We.replaceMain(c[f],"czm_log_depth_main");u=`
|
|
void main()
|
|
{
|
|
czm_log_depth_main();
|
|
czm_writeLogDepth();
|
|
}
|
|
`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:o})}RS.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=it.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=aIt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function sIt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;Object.prototype.toString.call(n)==="[object Object]"&&(n.color?n=`vec4(${U.floatToByte(n.color.red)}, ${U.floatToByte(n.color.green)}, ${U.floatToByte(n.color.blue)}, ${U.floatToByte(n.color.alpha)})`:n="vec4(1.0)");let o=t._attributeLocations,{sources:r,defines:a}=t.fragmentShaderSource,c=r.some(A=>A.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main ()
|
|
{
|
|
czm_non_pick_main();
|
|
if (${c}.a == 0.0) {
|
|
discard;
|
|
}
|
|
${c} = ${n};
|
|
} `,f=r.length,h=new Array(f+1);for(let A=0;A<f;++A)h[A]=We.replaceMain(r[A],"czm_non_pick_main");h[f]=u;let p=new We({sources:h,defines:a});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function fTe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=Ve.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=Ve.fromCache(o);return n[t.id]=r,r}RS.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=it.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=sIt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=fTe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function PS(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 cIt(e){return e.isArray?e.arrayLength:It.getComponentCount(e.type)}function dTe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function hTe(e,t){let n=Qt.getMaximum(t);return`(${e}) / float(${n})`}function lIt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=dTe(n,i,o)}return e.normalized||(n=hTe(n,e.componentType)),n}function uIt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],a=t.scale[n];o=dTe(o,r,a)}return e.normalized||(o=hTe(o,e.componentType)),o}function fIt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,a=`pickMetadata-${i}-${o}-${r}`,s=e.shaderCache.getDerivedShaderProgram(t,a);if(l(s))return s;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),h=["0.0","0.0","0.0","0.0"],p=cIt(u);if(p===1)h[0]=lIt(u,c);else{let y=["x","y","z","w"];for(let C=0;C<p;C++)h[C]=uIt(u,c,y[C])}let A=t.fragmentShaderSource.defines.slice();A.push(rd.METADATA_PICKING_ENABLED),PS(A,rd.METADATA_PICKING_VALUE_TYPE,f),PS(A,rd.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),PS(A,rd.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),PS(A,rd.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),PS(A,rd.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),PS(A,rd.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new We({sources:t.fragmentShaderSource.sources,defines:A});return e.shaderCache.createDerivedShaderProgram(t,a,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}RS.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=it.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=fIt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=fTe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function dIt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}RS.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=it.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=dIt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var yg=RS;function fH(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=D.toRadians(o),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var hIt=new Qe,mTe=new Qe,mIt=new J;function pIt(e,t,n,i){let o=e.direction,r=e.right,a=e.up,s=Qe.fromAxisAngle(o,n,mTe),c=Qe.fromAxisAngle(r,i,hIt),u=Qe.multiply(c,s,c),f=Qe.fromAxisAngle(a,t,mTe);Qe.multiply(f,u,u);let h=J.fromQuaternion(u,mIt);J.multiplyByVector(h,r,r),J.multiplyByVector(h,a,a),J.multiplyByVector(h,o,o)}fH.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;pIt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};fH.prototype.isDestroyed=function(){return!1};fH.prototype.destroy=function(){return this._removeListener(),fe(this)};var dH=fH;function q$(){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(q$.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var AIt=new d;q$.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,D.EPSILON4),-Math.max(this._heightFalloff,0)),a=d.normalize(n.positionWC,AIt),s=Math.abs(d.dot(n.directionWC,a));r*=1-s,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var hH=q$;function gIt(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1}var mH=gIt;var cc={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},U0=cc.DERIVED_COMMANDS_MAXIMUM_LENGTH,xTe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function z0(){this._frontFaceAlphaByDistance=new Ht(0,1,0,1),this._backFaceAlphaByDistance=new Ht(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(U0),this._derivedBlendCommandTypes=new Array(U0),this._derivedPickCommandTypes=new Array(U0),this._derivedCommandTypesToUpdate=new Array(U0),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(z0.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}}});z0.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=pTe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=pTe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=ATe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=ATe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=EIt(this,e,t),this._sunVisibleThroughGlobe=_It(this,e),this._environmentVisible=yIt(this,e),this._useDepthPlane=CIt(this,e),this._numberOfTextureUniforms=IIt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),bIt(this,e)};function pTe(e,t,n,i){return e?l(n)?(Ht.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function ATe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function _It(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function yIt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function CIt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function EIt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function IIt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function bIt(e,t){e._derivedCommandsLength=K$(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=K$(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=K$(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<U0;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=QIt())}function K$(e,t,n,i,o){let r=0,a=e._frontFaceTranslucent,s=e._backFaceTranslucent;if(!a)return r;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?cc.PICK_FRONT_FACE:u?cc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:cc.TRANSLUCENT_FRONT_FACE,h=i?cc.PICK_BACK_FACE:u?cc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:cc.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=cc.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(s?(n||(o[r++]=cc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):c?(n||(o[r++]=cc.DEPTH_ONLY_BACK_FACE),o[r++]=cc.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=cc.DEPTH_ONLY_FRONT_FACE),o[r++]=cc.OPAQUE_BACK_FACE,o[r++]=f),r)}function Fd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function gTe(e,t){return e.indexOf(t)>-1}function xIt(e,t){Fd(e.defines,"TRANSLUCENT"),Fd(t.defines,"TRANSLUCENT")}function TIt(e,t){Fd(e.defines,"GROUND_ATMOSPHERE"),Fd(t.defines,"GROUND_ATMOSPHERE"),Fd(e.defines,"FOG"),Fd(t.defines,"FOG"),Fd(e.defines,"TRANSLUCENT"),Fd(t.defines,"TRANSLUCENT")}function X$(e,t){if(gTe(t.defines,"TILE_LIMIT_RECTANGLE")||gTe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
}
|
|
`;t.sources=[n]}function J$(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=We.replaceMain(n[r],"czm_globe_translucency_main");n.push(`
|
|
|
|
uniform sampler2D u_classificationTexture;
|
|
void main()
|
|
{
|
|
vec2 st = gl_FragCoord.xy / czm_viewport.zw;
|
|
#ifdef MANUAL_DEPTH_TEST
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
|
|
if (logDepthOrDepth != 0.0)
|
|
{
|
|
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
|
|
float depthEC = eyeCoordinate.z / eyeCoordinate.w;
|
|
if (v_positionEC.z < depthEC)
|
|
{
|
|
discard;
|
|
}
|
|
}
|
|
#endif
|
|
czm_globe_translucency_main();
|
|
vec4 classificationColor = texture(u_classificationTexture, st);
|
|
if (classificationColor.a > 0.0)
|
|
{
|
|
// Reverse premultiplication process to get the correct composited result of the classification primitives
|
|
classificationColor.rgb /= classificationColor.a;
|
|
}
|
|
out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a);
|
|
}
|
|
`)}function TTe(e,t){J$(e,t),Fd(e.defines,"GROUND_ATMOSPHERE"),Fd(t.defines,"GROUND_ATMOSPHERE"),Fd(e.defines,"FOG"),Fd(t.defines,"FOG")}function SIt(e,t){J$(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function wIt(e,t){TTe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function _Te(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 BIt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let a=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(a)){let s=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],o(c,u),a=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:s})}return a}function DIt(e){e.cull.face=Li.BACK,e.cull.enabled=!0}function vIt(e){e.cull.face=Li.FRONT,e.cull.enabled=!0}function PIt(e){e.cull.face=Li.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function RIt(e){e.cull.face=Li.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function MIt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function yTe(e){e.cull.face=Li.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=sn.ALPHA_BLEND}function CTe(e){e.cull.face=Li.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=sn.ALPHA_BLEND}function NIt(e){e.cull.face=Li.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function LIt(e){e.cull.face=Li.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function OIt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let a=Ve.getState(e);i(a),r=Ve.fromCache(a),o[e.id]=r}return r}function MS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function FIt(e,t,n,i,o){return l(o)?!i&&l(n)?n:Pt(t,o(e),!1):t}function rm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function QIt(){return[new rm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:xIt,getRenderStateFunction:DIt,getUniformMapFunction:void 0}),new rm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:TIt,getRenderStateFunction:vIt,getUniformMapFunction:void 0}),new rm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:X$,getRenderStateFunction:PIt,getUniformMapFunction:void 0}),new rm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:X$,getRenderStateFunction:RIt,getUniformMapFunction:void 0}),new rm({pass:Be.GLOBE,pickOnly:!1,getShaderProgramFunction:X$,getRenderStateFunction:MIt,getUniformMapFunction:void 0}),new rm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:J$,getRenderStateFunction:yTe,getUniformMapFunction:MS}),new rm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:TTe,getRenderStateFunction:CTe,getUniformMapFunction:MS}),new rm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:SIt,getRenderStateFunction:yTe,getUniformMapFunction:MS}),new rm({pass:Be.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wIt,getRenderStateFunction:CTe,getUniformMapFunction:MS}),new rm({pass:Be.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:_Te,getRenderStateFunction:NIt,getUniformMapFunction:MS}),new rm({pass:Be.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:_Te,getRenderStateFunction:LIt,getUniformMapFunction:MS})]}var ETe=new Array(U0),ITe=new Array(U0);z0.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)ITe[o]=this._derivedCommandPacks[n[o]],ETe[o]=xTe[n[o]];kIt(this,e,i,n,ETe,ITe,t)}};function kIt(e,t,n,i,o,r,a){let s=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(s)||c){t.dirty=!1,l(s)||(s={},t.derivedCommands.globeTranslucency=s);let u=a.frameNumber,f=s.uniformMapDirtyFrame??0,h=s.shaderProgramDirtyFrame??0,p=s.renderStateDirtyFrame??0,A=s.uniformMap!==t.uniformMap,m=s.shaderProgramId!==t.shaderProgram.id,_=s.renderStateId!==t.renderState.id;A&&(s.uniformMapDirtyFrame=u),m&&(s.shaderProgramDirtyFrame=u),_&&(s.renderStateDirtyFrame=u),s.uniformMap=t.uniformMap,s.shaderProgramId=t.shaderProgram.id,s.renderStateId=t.renderState.id;for(let y=0;y<n;++y){let C=r[y],E=i[y],I=o[y],x=s[I],S,w,v;l(x)?(S=x.uniformMap,w=x.shaderProgram,v=x.renderState):(S=void 0,w=void 0,v=void 0),x=it.shallowClone(t,x),s[I]=x;let R=x.derivedCommands.uniformMapDirtyFrame??0,N=x.derivedCommands.shaderProgramDirtyFrame??0,L=x.derivedCommands.renderStateDirtyFrame??0,g=A||R<f,b=m||N<h,T=_||L<p;g&&(x.derivedCommands.uniformMapDirtyFrame=u),b&&(x.derivedCommands.shaderProgramDirtyFrame=u),T&&(x.derivedCommands.renderStateDirtyFrame=u),x.derivedCommands.type=E,x.pass=C.pass,x.pickOnly=C.pickOnly,x.uniformMap=FIt(e,t.uniformMap,S,g,C.getUniformMapFunction),x.shaderProgram=BIt(a.context,t.shaderProgram,w,b,C.getShaderProgramFunction,I),x.renderState=OIt(t.renderState,v,T,C.getRenderStateFunction,C.renderStateCache)}}}z0.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 a=e.derivedCommands.globeTranslucency;for(let s=0;s<r;++s){let c=xTe[o[s]];n.commandList.push(a[c])}};function STe(e,t,n,i,o,r){for(let a=0;a<t;++a){let s=e[a],c=s.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(s,i,o)}}function bTe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var UIt=[cc.OPAQUE_FRONT_FACE,cc.OPAQUE_BACK_FACE],zIt=[cc.DEPTH_ONLY_FRONT_FACE,cc.DEPTH_ONLY_BACK_FACE,cc.DEPTH_ONLY_FRONT_AND_BACK_FACE];z0.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,a=e.commands[Be.GLOBE],s=e.indices[Be.GLOBE];s!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),STe(a,s,t,i,o,UIt))};z0.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:a}=r,s=e.commands[Be.GLOBE],c=e.indices[Be.GLOBE],u=e.commands[Be.TERRAIN_CLASSIFICATION],f=e.indices[Be.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&bTe(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let A=a.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,STe(s,c,t,i,o,zIt),r.depthTexture){let _=n.packDepth(r,o);a.globeDepthTexture=_}bTe(u,f,t,i,o),a.globeDepthTexture=A,o.framebuffer=m};var pH=z0;var bf=`uniform sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = texture(colorTexture, v_textureCoordinates);
|
|
}
|
|
`;function Up(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new bi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new bi({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 ui({color:new U(0,0,0,0),owner:this}),this._clearCommand=new ui({color:new U(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(Up.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Up.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var GIt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:sn.ALPHA_BLEND},VIt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:sn.ALPHA_BLEND},HIt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:sn.ALPHA_BLEND},WIt=`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;
|
|
}
|
|
`,jIt=`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
|
|
}
|
|
`;Up.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,a=e.drawingBufferWidth,s=e.drawingBufferHeight,c=!l(i)||i.width!==a||i.height!==s;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new vt({context:e,width:a,height:s,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Gf({context:e,width:a,height:s,format:Kl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,a,s,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,a,s))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ve.fromCache(GIt),this._rsClassified=Ve.fromCache(VIt),this._rsDefault=Ve.fromCache(HIt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?jIt:WIt,f=new We({defines:["UNCLASSIFIED"],sources:[u]}),h=new We({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(bf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Up.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Up.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Up.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Up.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Up.prototype.isDestroyed=function(){return!1};Up.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),fe(this)};var lR=Up;function AH(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(AH.prototype,{total:{get:function(){return this._total}}});function dC(e){let t=new Array(Uc.NUMBER_OF_JOB_TYPES);t[Uc.TEXTURE]=new AH(l(e)?e[Uc.TEXTURE]:10),t[Uc.PROGRAM]=new AH(l(e)?e[Uc.PROGRAM]:10),t[Uc.BUFFER]=new AH(l(e)?e[Uc.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}dC.getTimestamp=ki;Object.defineProperties(dC.prototype,{totalBudget:{get:function(){return this._totalBudget}}});dC.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};dC.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};dC.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let a=dC.getTimestamp();e.execute();let s=dC.getTimestamp()-a;return this._totalUsedThisFrame+=s,r?r.stolenFromMeThisFrame+=s:i.usedThisFrame+=s,this._executedThisFrame[t]=!0,!0};var gH=dC;function _H(e){e=e??V.EMPTY_OBJECT;let t=zn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=ki(),this._lastMsSampleTime=ki(),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(_H.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});_H.prototype.update=function(e){let t=ki(),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}};_H.prototype.destroy=function(){return fe(this)};var hC=_H;var lc={};lc.decodeRawMetadataValue=function(e,t,n){switch(e){case Qt.INT8:return t.getInt8(n);case Qt.UINT8:return t.getUint8(n);case Qt.INT16:return t.getInt16(n,!0);case Qt.UINT16:return t.getUint16(n,!0);case Qt.INT32:return t.getInt32(n,!0);case Qt.UINT32:return t.getUint32(n,!0);case Qt.INT64:return t.getBigInt64(n,!0);case Qt.UINT64:return t.getBigUint64(n,!0);case Qt.FLOAT32:return t.getFloat32(n,!0);case Qt.FLOAT64:return t.getFloat64(n,!0)}throw new ue(`Invalid component type: ${e}`)};lc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=lc.decodeRawMetadataValue(i,t,n);return e.normalized?Qt.normalize(o,i):o};lc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Qt.getSizeInBytes(i),r=e.type,a=It.getComponentCount(r),s=o*a;if(a>1){let f=Array(a);for(let h=0;h<a;h++){let p=n*s+h*o,A=lc.decodeRawMetadataValueComponent(e,t,p);f[h]=A}return f}let c=n*s;return lc.decodeRawMetadataValueComponent(e,t,c)};lc.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 a=0;a<o;a++){let s=lc.decodeRawMetadataValueElement(e,n,a);r[a]=s}return r}return lc.decodeRawMetadataValueElement(e,n,0)};lc.convertToObjectType=function(e,t){if(!l(t)||e===It.SCALAR||e===It.STRING||e===It.BOOLEAN||e===It.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case It.VEC2:return Q.unpack(n,0,new Q);case It.VEC3:return d.unpack(n,0,new d);case It.VEC4:return ie.unpack(n,0,new ie);case It.MAT2:return Ki.unpack(n,0,new Ki);case It.MAT3:return J.unpack(n,0,new J);case It.MAT4:return P.unpack(n,0,new P)}throw new ue(`Invalid metadata object type: ${e}`)};lc.convertFromObjectType=function(e,t){if(!l(t)||e===It.SCALAR||e===It.STRING||e===It.BOOLEAN||e===It.ENUM)return t;switch(e){case It.VEC2:return Q.pack(t,Array(2));case It.VEC3:return d.pack(t,Array(3));case It.VEC4:return ie.pack(t,Array(4));case It.MAT2:return Ki.pack(t,Array(4));case It.MAT3:return J.pack(t,Array(9));case It.MAT4:return P.pack(t,Array(16))}throw new ue(`Invalid metadata object type: ${e}`)};lc.decodeMetadataValues=function(e,t,n){let i=lc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=lc.convertFromObjectType(e.type,t.offset),a=lc.convertFromObjectType(e.type,t.scale);i=IA.valueTransformInPlace(i,r,a,Qt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,a=Array(r);for(let s=0;s<r;s++){let c=i[s],u=lc.convertToObjectType(e.type,c);a[s]=u}return a}return lc.convertToObjectType(e.type,i)};var yH=Object.freeze(lc);function G0(){this._framebuffer=new bi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(G0.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function YIt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function qIt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
|
|
float globeDepth = czm_unpackDepth(globeDepthPacked);
|
|
float depth = texture(colorTexture, v_textureCoordinates).r;
|
|
out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
|
|
czm_packDepth(depth), globeDepthPacked);
|
|
}
|
|
`,{renderState:Ve.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}G0.prototype.update=function(e,t){YIt(this,e,t),qIt(this,e,t)};var KIt=new ie,XIt=new ie(1,1/255,1/65025,1/16581375);G0.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ie.unpack(i,0,KIt);return ie.divideByScalar(o,255,o),ie.dot(o,XIt)};G0.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};G0.prototype.isDestroyed=function(){return!1};G0.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),fe(this)};var CH=G0;function mC(e){e=e||{},this._framebufferManager=new bi({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(mC.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});mC.prototype.update=function(e,t,n,i,o){let r=t.width,a=t.height,s=n?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,a,1,s,Ke.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};mC.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};mC.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};mC.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};mC.prototype.isDestroyed=function(){return!1};mC.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,fe(this)};var EH=mC;function JIt(e,t){this.near=e??0,this.far=t??0;let n=Be.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 IH=JIt;var V0=`uniform highp sampler2D u_depthTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
|
|
}
|
|
`;function zp(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new bi,this._tempCopyDepthFramebuffer=new bi,this._updateDepthFramebuffer=new bi({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 et,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(zp.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function wTe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let a=!et.equals(r,o.viewport),s=a!==e._useScissorTest;e._useScissorTest=a,et.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=et.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._rs)||!et.equals(r,e._rs.viewport)||s)&&(e._rs=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:sn.ALPHA_BLEND}),e._rsUpdate=Ve.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:wt.KEEP,zFail:wt.KEEP,zPass:wt.KEEP},backFunction:ti.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(V0,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(bf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(V0,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(bf,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ui({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}zp.prototype.update=function(e,t,n,i,o,r){let{width:a,height:s}=n,c=o?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,a,s):this._outputFramebuffer.update(e,a,s,i,c),this._copyDepthFramebuffer.update(e,a,s),wTe(this,e,a,s,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};zp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};zp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};zp.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:a,height:s}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,a,s),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,a,s),wTe(this,e,a,s,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};zp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};zp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};zp.prototype.isDestroyed=function(){return!1};zp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),fe(this)};var bH=zp;function H0(){this._framebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new bi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(H0.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 ZIt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function $It(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function ebt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!et.equals(e._viewport,o.viewport),a=r!==e._useScissorTest;e._useScissorTest=r,et.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=et.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||a)&&(e._renderState=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(V0,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({color:new U(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}H0.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;$It(this,n,o,r,e),ebt(this,n,o,r,i),this._useHdr=e};H0.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};H0.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};H0.prototype.isDestroyed=function(){return!1};H0.prototype.destroy=function(){return ZIt(this),fe(this)};var xH=H0;function Cg(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 bi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new bi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new bi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new bi({createColorAttachments:!1}),this._opaqueClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({color:new U(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 et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function BTe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Z$(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function DTe(e){BTe(e),Z$(e)}function tbt(e,t,n,i){BTe(e),e._accumulationTexture=new vt({context:t,width:n,height:i,pixelFormat:Ke.RGBA,pixelDatatype:He.FLOAT}),e._revealageTexture=new vt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:He.FLOAT,width:n,height:i,flipY:!1})}function nbt(e,t){Z$(e);let n=ee.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Z$(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 a=e._translucentFBO.status===n,s=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!a||!s||!c||!u)&&(DTe(e),e._translucentMultipassSupport=!1,i=!1)}return i}Cg.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:a}=this._opaqueTexture,s=this._accumulationTexture,c=!l(s)||s.width!==r||s.height!==a||i!==this._useHDR,u=this._numSamples!==o;if((c||u)&&(this._numSamples=o,tbt(this,e,r,a)),(!l(this._translucentFBO.framebuffer)||c||u)&&!nbt(this,e))return;this._useHDR=i;let f=this,h,p;l(this._compositeCommand)||(h=new We({sources:[c8]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new We({defines:["MRT"],sources:[WP]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new We({sources:[WP]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=a;let A=!et.equals(this._viewport,t.viewport),m=A!==this._useScissorTest;this._useScissorTest=A,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ve.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var ibt={enabled:!0,color:new U(0,0,0,0),equationRgb:Lc.ADD,equationAlpha:Lc.ADD,functionSourceRgb:Zo.ONE,functionDestinationRgb:Zo.ONE,functionSourceAlpha:Zo.ZERO,functionDestinationAlpha:Zo.ONE_MINUS_SOURCE_ALPHA},obt={enabled:!0,color:new U(0,0,0,0),equationRgb:Lc.ADD,equationAlpha:Lc.ADD,functionSourceRgb:Zo.ONE,functionDestinationRgb:Zo.ONE,functionSourceAlpha:Zo.ONE,functionDestinationAlpha:Zo.ONE},rbt={enabled:!0,color:new U(0,0,0,0),equationRgb:Lc.ADD,equationAlpha:Lc.ADD,functionSourceRgb:Zo.ZERO,functionDestinationRgb:Zo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Zo.ZERO,functionDestinationAlpha:Zo.ONE_MINUS_SOURCE_ALPHA};function $$(e,t,n,i){let o=n[i.id];if(!l(o)){let r=Ve.getState(i);r.depthMask=!1,r.blending=t,o=Ve.fromCache(r),n[i.id]=o}return o}function abt(e,t,n){return $$(t,ibt,e._translucentRenderStateCache,n)}function sbt(e,t,n){return $$(t,obt,e._translucentRenderStateCache,n)}function cbt(e,t,n){return $$(t,rbt,e._alphaRenderStateCache,n)}var lbt=` 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);
|
|
`,ubt=` 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;
|
|
`,fbt=` float ai = czm_out_FragColor.a;
|
|
out_FragColor = vec4(ai);
|
|
`;function eee(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let a=t._attributeLocations,s=t.fragmentShaderSource.clone();s.sources=s.sources.map(function(f){return We.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),s.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT
|
|
vec4 czm_out_FragColor;
|
|
bool czm_discard = false;
|
|
`);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let h=c[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]};
|
|
${u}`}return s.sources.push(u),s.sources.push(`void main()
|
|
{
|
|
czm_translucent_main();
|
|
if (czm_discard)
|
|
{
|
|
discard;
|
|
}
|
|
${i}}
|
|
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:s,attributeLocations:a})}function dbt(e,t){return eee(e,t,"translucentMRT",lbt)}function hbt(e,t){return eee(e,t,"translucentMultipass",ubt)}function mbt(e,t){return eee(e,t,"alphaMultipass",fbt)}Cg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let s,c;return l(n.translucentCommand)&&(s=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=it.shallowClone(e,n.translucentCommand),!l(s)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=dbt(t,e.shaderProgram),n.translucentCommand.renderState=abt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=s,n.translucentCommand.renderState=c),n}let i,o,r,a;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,a=n.alphaCommand.renderState),n.translucentCommand=it.shallowClone(e,n.translucentCommand),n.alphaCommand=it.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=hbt(t,e.shaderProgram),n.translucentCommand.renderState=sbt(this,t,e.renderState),n.alphaCommand.shaderProgram=mbt(t,e.shaderProgram),n.alphaCommand.renderState=cbt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=a),n};function pbt(e,t,n,i,o,r){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(a,i);let A=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let _=o[m];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let y=p&&_.receiveShadows?_.derivedCommands.oit.shadows.translucentCommand:_.derivedCommands.oit.translucentCommand;n(y,t,i,A)}if(l(r)){let m=r.unclassifiedCommand,_=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(_,t,i,A)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let _=o[m];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let y=p&&_.receiveShadows?_.derivedCommands.oit.shadows.alphaCommand:_.derivedCommands.oit.alphaCommand;n(y,t,i,A)}if(l(r)){let m=r.unclassifiedCommand,_=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(_,t,i,A)}i.framebuffer=h}function Abt(e,t,n,i,o,r){let{context:a,frameState:s}=t,{useLogDepth:c,shadowState:u}=s,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(a,i);let A=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let _=o[m];_=c?_.derivedCommands.logDepth.command:_,_=f?_.derivedCommands.hdr.command:_;let y=p&&_.receiveShadows?_.derivedCommands.oit.shadows.translucentCommand:_.derivedCommands.oit.translucentCommand;n(y,t,i,A)}if(l(r)){let m=r.unclassifiedCommand,_=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(_,t,i,A)}i.framebuffer=h}Cg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Abt(this,e,t,n,i,o);return}pbt(this,e,t,n,i,o)};Cg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Cg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,U.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};Cg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return DTe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),fe(this)};var TH=Cg;function uR(){this._framebuffer=new bi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(uR.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function gbt(e){e._framebuffer.destroy()}function _bt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new ll(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new et},o.viewport=new et,e._passState=o}uR.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&_bt(this,e);let r=this.framebuffer,a=this._passState;return a.framebuffer=r,a.viewport.width=i,a.viewport.height=o,a.scissorTest.rectangle.x=t.x,a.scissorTest.rectangle.y=o-t.y,a.scissorTest.rectangle.width=1,a.scissorTest.rectangle.height=1,a};uR.prototype.isDestroyed=function(){return!1};uR.prototype.destroy=function(){return gbt(this),fe(this)};var SH=uR;function W0(e){let t=new ll(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new bi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function vTe(e,t,n,i,o=1){let r=Math.max(n,i),a=r*r,s=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,h=0,p=-1,A=new Set;for(let m=0;m<a;++m){if(-s<=u&&u<=s&&-c<=f&&f<=c){let _=4*((c-f)*n+u+s),y=U.bytesToRgba(t[_],t[_+1],t[_+2],t[_+3]),C=e.getObjectByPickColor(y);if(l(C)&&(A.add(C),A.size>=o))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let _=h;h=-p,p=_}u+=h,f+=p}return[...A]}W0.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return et.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};W0.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,a=this._fb.framebuffer,s=He.UNSIGNED_BYTE,c=Ke.RGBA;l(a)&&a.numberOfColorAttachments>0&&(s=a.getColorTexture(0).pixelDatatype,c=a.getColorTexture(0).pixelFormat);let u=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:a}),f=h1.create({context:r});try{await f.waitForSignal(A=>t.afterRender.push(A));let h=Ke.createTypedArray(c,s,i,o);return u.getBufferData(h),vTe(r,h,i,o,n)}catch{throw new ue("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};W0.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return vTe(o,r,n,i,t)};W0.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),s=4*(Math.floor(n*.5)*t+r);return o.slice(s,s+4)};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){return this._fb.destroy(),fe(this)};var wH=W0;function Eg(){this._numSamples=1,this._colorFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new bi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new U(0,0,0,0),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,owner:this})}function ybt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Eg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Eg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,a=n?e.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,a),this._idFramebuffer.update(e,o,r)};Eg.prototype.clear=function(e,t,n){U.clone(n,this._clearCommand.color),U.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};Eg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Eg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Eg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Eg.prototype.isDestroyed=function(){return!1};Eg.prototype.destroy=function(){return ybt(this),fe(this)};var NS=Eg;function j0(){}j0.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};j0.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=We.findPositionVarying(e),a=l(r);if(t&&!a){let s=o.length;for(let u=0;u<s;++u)o[u]=We.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC;
|
|
void main()
|
|
{
|
|
czm_shadow_cast_main();
|
|
v_positionEC = (czm_inverseProjection * gl_Position).xyz;
|
|
}`)}return new We({defines:i,sources:o})};j0.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let a=We.findPositionVarying(e),s=l(a);s||(a="v_positionEC");let c=r.length;for(let f=0;f<c;++f)r[f]=We.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(s||(u+=`in vec3 v_positionEC;
|
|
`),u+=`uniform vec4 shadowMap_lightPositionEC;
|
|
`),i?u+=`void main()
|
|
{
|
|
`:u+=`void main()
|
|
{
|
|
czm_shadow_cast_main();
|
|
if (out_FragColor.a == 0.0)
|
|
{
|
|
discard;
|
|
}
|
|
`,t?u+=` float distance = length(${a});
|
|
if (distance >= shadowMap_lightPositionEC.w)
|
|
{
|
|
discard;
|
|
}
|
|
distance /= shadowMap_lightPositionEC.w; // radius
|
|
out_FragColor = czm_packDepth(distance);
|
|
`:n?u+=` out_FragColor = vec4(1.0);
|
|
`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
|
|
`,u+=`}
|
|
`,r.push(u),new We({defines:o,sources:r})};j0.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,a=e._isPointLight,s=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${a}${s}${c}${u}${f}${t}${n}${i}`};j0.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new We({defines:i,sources:o})};j0.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=We.findNormalVarying(e),a=!i&&l(r)||i&&o,s=We.findPositionVarying(e),c=l(s),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,A=t._numberOfCascades>1,m=t.debugCascadeColors,_=t.softShadows,y=h?t._pointBias:i?t._terrainBias:t._primitiveBias,C=e.defines.slice(0),E=e.sources.slice(0),I=E.length;for(let w=0;w<I;++w)E[w]=We.replaceMain(E[w],"czm_shadow_receive_main");h?C.push("USE_CUBE_MAP_SHADOW"):u&&C.push("USE_SHADOW_DEPTH_TEXTURE"),_&&!h&&C.push("USE_SOFT_SHADOWS"),A&&n&&i&&(a?C.push("ENABLE_VERTEX_LIGHTING"):C.push("ENABLE_DAYNIGHT_SHADING")),n&&y.normalShading&&a&&(C.push("USE_NORMAL_SHADING"),y.normalShadingSmooth>0&&C.push("USE_NORMAL_SHADING_SMOOTH"));let x="";h?x+=`uniform samplerCube shadowMap_textureCube;
|
|
`:x+=`uniform sampler2D shadowMap_texture;
|
|
`;let S;return c?S=` return vec4(${s}, 1.0);
|
|
`:S=`#ifndef LOG_DEPTH
|
|
return czm_windowToEyeCoordinates(gl_FragCoord);
|
|
#else
|
|
return vec4(v_logPositionEC, 1.0);
|
|
#endif
|
|
`,x+=`uniform mat4 shadowMap_matrix;
|
|
uniform vec3 shadowMap_lightDirectionEC;
|
|
uniform vec4 shadowMap_lightPositionEC;
|
|
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
|
|
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
|
|
#ifdef LOG_DEPTH
|
|
in vec3 v_logPositionEC;
|
|
#endif
|
|
vec4 getPositionEC()
|
|
{
|
|
${S}}
|
|
vec3 getNormalEC()
|
|
{
|
|
${a?` return normalize(${r});
|
|
`:` return vec3(1.0);
|
|
`}}
|
|
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
|
|
{
|
|
${y.normalOffset&&a?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
|
|
float normalOffsetScale = 1.0 - nDotL;
|
|
vec3 offset = normalOffset * normalOffsetScale * normalEC;
|
|
positionEC.xyz += offset;
|
|
`:""}}
|
|
`,x+=`void main()
|
|
{
|
|
czm_shadow_receive_main();
|
|
vec4 positionEC = getPositionEC();
|
|
vec3 normalEC = getNormalEC();
|
|
float depth = -positionEC.z;
|
|
`,x+=` czm_shadowParameters shadowParameters;
|
|
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
|
|
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
|
|
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
|
|
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
|
|
`,i?x+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
|
|
`:f||(x+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
|
|
`),h?x+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;
|
|
float distance = length(directionEC);
|
|
directionEC = normalize(directionEC);
|
|
float radius = shadowMap_lightPositionEC.w;
|
|
// Stop early if the fragment is beyond the point light radius
|
|
if (distance > radius)
|
|
{
|
|
return;
|
|
}
|
|
vec3 directionWC = czm_inverseViewRotation * directionEC;
|
|
shadowParameters.depth = distance / radius;
|
|
shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
|
|
shadowParameters.texCoords = directionWC;
|
|
float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);
|
|
`:p?x+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
|
|
float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
|
|
applyNormalOffset(positionEC, normalEC, nDotL);
|
|
vec4 shadowPosition = shadowMap_matrix * positionEC;
|
|
// Spot light uses a perspective projection, so perform the perspective divide
|
|
shadowPosition /= shadowPosition.w;
|
|
// Stop early if the fragment is not in the shadow bounds
|
|
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
|
|
{
|
|
return;
|
|
}
|
|
shadowParameters.texCoords = shadowPosition.xy;
|
|
shadowParameters.depth = shadowPosition.z;
|
|
shadowParameters.nDotL = nDotL;
|
|
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
|
|
`:A?x+=` float maxDepth = shadowMap_cascadeSplits[1].w;
|
|
// Stop early if the eye depth exceeds the last cascade
|
|
if (depth > maxDepth)
|
|
{
|
|
return;
|
|
}
|
|
// Get the cascade based on the eye-space depth
|
|
vec4 weights = czm_cascadeWeights(depth);
|
|
// Apply normal offset
|
|
float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
|
|
applyNormalOffset(positionEC, normalEC, nDotL);
|
|
// Transform position into the cascade
|
|
vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
|
|
// Get visibility
|
|
shadowParameters.texCoords = shadowPosition.xy;
|
|
shadowParameters.depth = shadowPosition.z;
|
|
shadowParameters.nDotL = nDotL;
|
|
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
|
|
// Fade out shadows that are far away
|
|
float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
|
|
float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
|
|
visibility = mix(visibility, 1.0, fade);
|
|
${m?` // Draw cascade colors for debugging
|
|
out_FragColor *= czm_cascadeColor(weights);
|
|
`:""}`:x+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
|
|
applyNormalOffset(positionEC, normalEC, nDotL);
|
|
vec4 shadowPosition = shadowMap_matrix * positionEC;
|
|
// Stop early if the fragment is not in the shadow bounds
|
|
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
|
|
{
|
|
return;
|
|
}
|
|
shadowParameters.texCoords = shadowPosition.xy;
|
|
shadowParameters.depth = shadowPosition.z;
|
|
shadowParameters.nDotL = nDotL;
|
|
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
|
|
`,x+=` out_FragColor.rgb *= visibility;
|
|
}
|
|
`,E.push(x),new We({defines:C,sources:E})};var Ig=j0;function Gp(e){e=e??V.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(hn.isEdge()||(hn.isChrome()||hn.isFirefox())&&hn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n;let i=e.depthBiasStep??1;this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4*i},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5*i},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4*i},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new P,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new ie,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new BH,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Q,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Aa:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ie,new ie],this._cascadeMatrices=[new P,new P,new P,new P],this._cascadeDistances=new ie;let o;this._isPointLight?o=6:this._cascadesEnabled?o=this._numberOfCascades:o=1,this._passes=new Array(o);for(let r=0;r<o;++r)this._passes[r]=new Cbt(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,nee(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new ll(t),this._size=e.size??2048,this.size=this._size}Gp.MAXIMUM_DISTANCE=2e4;function Cbt(e){this.camera=new BH,this.passState=new ll(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function tee(e,t){return Ve.fromCache({cull:{enabled:!0,face:Li.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 nee(e){let t=!e._usesDepthTexture;e._primitiveRenderState=tee(t,e._primitiveBias),e._terrainRenderState=tee(t,e._terrainBias),e._pointRenderState=tee(t,e._pointBias)}Gp.prototype.debugCreateRenderStates=function(){nee(this)};Object.defineProperties(Gp.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){Sbt(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 iee(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Ebt(e,t){let n=new Gf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Kl.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST}),o=new pa({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let a=0;a<r;++a){let s=e._passes[a];s.framebuffer=o,s.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Ibt(e,t){let n=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),i=new pa({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let a=e._passes[r];a.framebuffer=i,a.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function bbt(e,t){let n=new Gf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Kl.DEPTH_COMPONENT16}),i=new ta({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,sampler:jt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let a=new pa({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),s=e._passes[r];s.framebuffer=a,s.passState.framebuffer=a}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function MTe(e,t){e._isPointLight?bbt(e,t):e._usesDepthTexture?Ibt(e,t):Ebt(e,t)}function xbt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ee.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,nee(e),iee(e),MTe(e,t))}function Tbt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(iee(e),MTe(e,t),xbt(e,t),NTe(e,t))}function NTe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function Sbt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=Nt.maximumCubeMapSize>=t?t:Nt.maximumCubeMapSize,o.x=t,o.y=t;let r=new et(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=Nt.maximumTextureSize>=t?t:Nt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=Nt.maximumTextureSize>=t*2?t:Nt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,o.x,o.y);for(let r=0;r<i;++r){let a=n[r],s=a.passState.viewport,c=s.x/o.x,u=s.y/o.y,f=s.width/o.x,h=s.height/o.y;a.textureOffsets=new P(f,0,0,c,0,h,0,u,0,0,1,0,0,0,0,1)}}var wbt=new et;function Bbt(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=Be.OVERLAY,i}function Dbt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,a=wbt;a.x=i-r,a.y=0,a.width=r,a.height=r;let s=e._debugShadowViewCommand;l(s)||(s=Bbt(e,n),e._debugShadowViewCommand=s),(!l(s.renderState)||!et.equals(s.renderState.viewport,a))&&(s.renderState=Ve.fromCache({viewport:et.clone(a)})),t.commandList.push(e._debugShadowViewCommand)}var Vp=new Array(8);Vp[0]=new ie(-1,-1,-1,1);Vp[1]=new ie(1,-1,-1,1);Vp[2]=new ie(1,1,-1,1);Vp[3]=new ie(-1,1,-1,1);Vp[4]=new ie(-1,-1,1,1);Vp[5]=new ie(1,-1,1,1);Vp[6]=new ie(1,1,1,1);Vp[7]=new ie(-1,1,1,1);var pC=new P,oee=new Array(8);for(let e=0;e<8;++e)oee[e]=new ie;function vbt(e,t){let n=new Lt({geometry:new Sm({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Lt({geometry:new fy({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Ln({geometryInstances:[n,i],appearance:new gn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Pbt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],Rbt=new d;function Mbt(e,t){Dbt(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 _g({camera:e._sceneCamera,color:U.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new _g({camera:e._shadowMapCamera,color:U.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 _g({camera:e._passes[i].camera,color:Pbt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Qe.IDENTITY,r=e._pointLightRadius*2,a=d.fromElements(r,r,r,Rbt),s=P.fromTranslationQuaternionRotationScale(i,o,a,pC);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=vbt(s,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new _g({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function BH(){this.viewMatrix=new P,this.inverseViewMatrix=new P,this.frustum=void 0,this.positionCartographic=new me,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new P}BH.prototype.clone=function(e){P.clone(e.viewMatrix,this.viewMatrix),P.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),me.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var Nbt=new P(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);BH.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return P.multiply(t,e,this.viewProjectionMatrix),P.multiply(Nbt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Lbt=new Array(5),Obt=new Wi,Fbt=new Array(4),LTe=new d,OTe=new d;function Qbt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,a=e._numberOfCascades,s,c=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=Fbt,A=Lbt;for(A[0]=o,A[a]=r,s=0;s<a;++s){let L=(s+1)/a,g=o*Math.pow(u,L),b=o+c*L,T=D.lerp(b,g,f);A[s+1]=T,p[s]=T-A[s]}if(h){for(s=0;s<a;++s)p[s]=Math.min(p[s],e._maximumCascadeDistances[s]);let L=A[0];for(s=0;s<a-1;++s)L+=p[s],A[s+1]=L}ie.unpack(A,0,e._cascadeSplits[0]),ie.unpack(A,1,e._cascadeSplits[1]),ie.unpack(p,0,e._cascadeDistances);let m=n.frustum,_=m.left,y=m.right,C=m.bottom,E=m.top,I=m.near,x=m.far,S=n.positionWC,w=n.directionWC,v=n.upWC,R=i.frustum.clone(Obt),N=n.getViewProjection();for(s=0;s<a;++s){R.near=A[s],R.far=A[s+1];let L=P.multiply(R.projectionMatrix,i.viewMatrix,pC),g=P.inverse(L,pC),b=P.multiply(N,g,pC),T=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,LTe),B=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,OTe);for(let z=0;z<8;++z){let F=ie.clone(Vp[z],oee[z]);P.multiplyByVector(b,F,F),d.divideByScalar(F,F.w,F),d.minimumByComponent(F,T,T),d.maximumByComponent(F,B,B)}T.x=Math.max(T.x,0),T.y=Math.max(T.y,0),T.z=0,B.x=Math.min(B.x,1),B.y=Math.min(B.y,1),B.z=Math.min(B.z,1);let M=e._passes[s],O=M.camera;O.clone(n);let G=O.frustum;G.left=_+T.x*(y-_),G.right=_+B.x*(y-_),G.bottom=C+T.y*(E-C),G.top=C+B.y*(E-C),G.near=I+T.z*(x-I),G.far=I+B.z*(x-I),M.cullingVolume=O.frustum.computeCullingVolume(S,w,v);let k=e._cascadeMatrices[s];P.multiply(O.getViewProjection(),i.inverseViewMatrix,k),P.multiply(M.textureOffsets,k,k)}}var kbt=new P,Ubt=new d,zbt=new d,PTe=new d;function Gbt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=P.multiply(i.frustum.projectionMatrix,i.viewMatrix,pC),r=P.inverse(o,pC),a=n.directionWC,s=i.directionWC;d.equalsEpsilon(a,s,D.EPSILON10)&&(s=i.upWC);let c=d.cross(a,s,Ubt);s=d.cross(c,a,zbt),d.normalize(s,s),d.normalize(c,c);let u=d.fromElements(0,0,0,PTe),f=P.computeView(u,a,s,c,kbt),h=P.multiply(f,r,pC),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,LTe),A=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,OTe);for(let x=0;x<8;++x){let S=ie.clone(Vp[x],oee[x]);P.multiplyByVector(h,S,S),d.divideByScalar(S,S.w,S),d.minimumByComponent(S,p,p),d.maximumByComponent(S,A,A)}A.z+=1e3,p.z-=10;let m=PTe;m.x=-(.5*(p.x+A.x)),m.y=-(.5*(p.y+A.y)),m.z=-A.z;let _=P.fromTranslation(m,pC);f=P.multiply(_,f,f);let y=.5*(A.x-p.x),C=.5*(A.y-p.y),E=A.z-p.z,I=n.frustum;I.left=-y,I.right=y,I.bottom=-C,I.top=C,I.near=.01,I.far=E,P.clone(f,n.viewMatrix),P.inverse(f,n.inverseViewMatrix),P.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(a,n.directionWC),d.clone(s,n.upWC),d.clone(c,n.rightWC)}var Vbt=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],Hbt=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],Wbt=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function jbt(e,t){let n=new Wi;n.fov=D.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Vbt[i],o.upWC=Hbt[i],o.rightWC=Wbt[i],P.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),P.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Ybt=new d,qbt=new d,FTe=new le,RTe=FTe.center;function Kbt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=FTe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Ybt),a=d.negate(i.directionWC,qbt),s=d.dot(r,a);if(e.fadingEnabled){let c=D.clamp(s/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(s<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)===Xt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,a=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,RTe),RTe);o.center=a,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Xt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function Xbt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let a=e._lightDirectionEC;P.multiplyByPointAsVector(n.viewMatrix,r.directionWC,a),d.normalize(a,a),d.negate(a,a),P.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let s,c;e._fitNearFar?(s=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,s+1)):(s=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Bo.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=s,e._sceneCamera.frustum.far=c,e._distance=c-s,Kbt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}Gp.prototype.update=function(e){if(Xbt(this,e),this._needsUpdate)if(Tbt(this,e.context),this._isPointLight&&jbt(this,e),this._cascadesEnabled&&(Gbt(this,e),this._numberOfCascades>1&&Qbt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ns.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;P.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Mbt(this,e)};Gp.prototype.updatePass=function(e,t){NTe(this,e,t)};var Jbt=new Q;function QTe(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=Jbt;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ie.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ie.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ie,combinedUniforms2:new ie};return Pt(t,o,!1)}function Zbt(e,t,n,i,o,r){let a,s,c;if(l(r)&&(a=r.shaderProgram,s=r.renderState,c=r.uniformMap),r=it.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(a)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Be.GLOBE,h=n.pass!==Be.TRANSLUCENT,p=e._isPointLight,A=e._usesDepthTexture,m=Ig.getShadowCastShaderKeyword(p,f,A,h);if(a=i.shaderCache.getDerivedShaderProgram(u,m),!l(a)){let y=u.vertexShaderSource,C=u.fragmentShaderSource,E=Ig.createShadowCastVertexShader(y,p,f),I=Ig.createShadowCastFragmentShader(C,p,A,h);a=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:E,fragmentShaderSource:I,attributeLocations:u._attributeLocations})}s=e._primitiveRenderState,p?s=e._pointRenderState:f&&(s=e._terrainRenderState),n.renderState.cull.enabled||(s=Ye(s,!1),s.cull=Ye(s.cull,!1),s.cull.enabled=!1,s=Ve.fromCache(s)),c=QTe(e,n.uniformMap,f)}return r.shaderProgram=a,r.renderState=s,r.uniformMap=c,r}Gp.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,a=t.shaderProgram,s=a.vertexShaderSource,c=a.fragmentShaderSource,u=t.pass===Be.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;l(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=it.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let A=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(h)||m||n||A){let _=Ig.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(a,_),!l(h)){let y=Ig.createShadowReceiveVertexShader(s,u,f),C=Ig.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(a,_,{vertexShaderSource:y,fragmentShaderSource:C,attributeLocations:a._attributeLocations})}p=QTe(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};Gp.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let a=o.castShaderProgramId,s=e.length;r.length=s;for(let c=0;c<s;++c)r[c]=Zbt(e[c],n,t,i,a,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};Gp.prototype.isDestroyed=function(){return!1};Gp.prototype.destroy=function(){iee(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return fe(this)};var AC=Gp;var LS=`uniform sampler2D colorTexture;
|
|
|
|
#ifdef DEBUG_SHOW_DEPTH
|
|
uniform sampler2D u_packedTranslucentDepth;
|
|
#endif
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
#ifdef DEBUG_SHOW_DEPTH
|
|
if (v_textureCoordinates.x < 0.5)
|
|
{
|
|
out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
|
|
out_FragColor.a = 1.0;
|
|
}
|
|
#else
|
|
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
|
|
#ifdef PICK
|
|
if (color == vec4(0.0))
|
|
{
|
|
discard;
|
|
}
|
|
#else
|
|
// Reverse premultiplication process to get the correct composited result of the classification primitives
|
|
color.rgb /= color.a;
|
|
#endif
|
|
out_FragColor = color;
|
|
#endif
|
|
}
|
|
`;var $bt=!1;function gC(e){this._drawClassificationFBO=new bi({createDepthAttachments:!1}),this._accumulationFBO=new bi({createDepthAttachments:!1}),this._packFBO=new bi,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 ui({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,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(gC.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function kTe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function UTe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function ext(e,t,n,i){kTe(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:He.UNSIGNED_INT_24_8,sampler:jt.NEAREST})}function txt(e,t,n,i){UTe(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 nxt(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)&&(ext(e,t,o,r),txt(e,t,o,r));let a,s;if(l(e._packDepthCommand)||(a=new We({sources:[s8]}),s={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),!l(e._compositeCommand)){a=new We({sources:[LS]}),s={colorTexture:function(){return e._textureToComposite}},$bt&&(a.defines=["DEBUG_SHOW_DEPTH"],s.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new We({sources:a.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),A=it.shallowClone(f);A.shaderProgram=p,f.derivedCommands.pick=A}l(e._copyCommand)||(a=new We({sources:[LS]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),l(e._accumulateCommand)||(a=new We({sources:[LS]}),s={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(a,{uniformMap:s,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ve.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:sn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}gC.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,a=e.context,s=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){nxt(this,a,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(a,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(a,n)),n.framebuffer=s}};gC.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,a=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(Be.CESIUM_3D_TILE_CLASSIFICATION);let s=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Be.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Be.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);r.globeDepthTexture=s,n.framebuffer=a,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=a)};gC.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),ixt(this,e,t)};function ixt(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}gC.prototype.isSupported=function(){return this._supported};gC.prototype.isDestroyed=function(){return!1};gC.prototype.destroy=function(){return kTe(this),UTe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),fe(this)};var DH=gC;function oxt(){this.command=void 0,this.near=void 0,this.far=void 0}function vH(e,t,n){let i=e.context,o;i.depthTexture&&(o=new bH);let r;e._useOIT&&i.depthTexture&&(r=new TH(i));let a=new ll(i);a.viewport=et.clone(n),this.camera=t,this._cameraClone=Bo.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=a,this.pickFramebuffer=new wH(i),this.pickDepthFramebuffer=new SH,this.sceneFramebuffer=new NS,this.edgeFramebuffer=new EH,this.globeDepth=o,this.globeTranslucencyFramebuffer=new xH,this.oit=r,this.translucentTileClassification=new DH(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var ree=new d,aee=new d;function rxt(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,ree)),d.maximumComponent(d.abs(t.position,aee))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,ree),d.multiplyByScalar(t.position,o,aee),d.equalsEpsilon(ree,aee,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&P.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}vH.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return rxt(t,n,D.EPSILON15)?(this._cameraStartFired&&ki()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=ki(),Bo.clone(t,n),!0)};function axt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:a}=o,s=a?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n),isNaN(n)&&(n=r.frustum.near),isNaN(i)&&(i=r.frustum.far);let f;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(s));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let A,m;c?(A=Math.min(i-u,n+p*u),m=Math.min(i,A+u)):(A=Math.max(n,Math.pow(s,p)*n),m=Math.min(i,s*A));let _=h[p];l(_)?(_.near=A,_.far=m):_=h[p]=new IH(A,m)}}function sxt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:a}=e;for(let s=0;s<a.length;++s){let c=a[s];if(o>c.far)continue;if(r<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<s),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:s}=e,{debugOverlappingFrustums:c}=i,u=s.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++s.totalCommands}t.updateDerivedCommands(i)}var zTe=new ns,cxt=new ea;vH.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:a,frustum:s}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let N=0;N<f.length;++N)for(let L=0;L<Be.NUMBER_OF_PASSES;++L)f[N].indices[L]=0;c.length=0,u.length=0;let h=this._commandExtents,p=h.length,A=0,m=+Number.MAX_VALUE,_=-Number.MAX_VALUE,{shadowsEnabled:y}=o,C=+Number.MAX_VALUE,E=-Number.MAX_VALUE,I=Number.MAX_VALUE,x=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:S}=t,w=zTe.planes;for(let N=0;N<5;++N)w[N]=S.planes[N];S=zTe;for(let N=0;N<i.length;++N){let L=i[N],{pass:g,boundingVolume:b}=L;if(g===Be.COMPUTE)c.push(L);else if(g===Be.OVERLAY)u.push(L);else{let T,B;if(l(b)){if(!e.isVisible(S,L,x))continue;let O=b.computePlaneDistances(r,a,cxt);if(T=O.start,B=O.stop,m=Math.min(m,T),_=Math.max(_,B),y&&L.receiveShadows&&T<AC.MAXIMUM_DISTANCE&&!(g===Be.GLOBE&&T<-100&&B>100)){let G=B-T;g!==Be.GLOBE&&T<100&&(I=Math.min(I,G)),C=Math.min(C,T),E=Math.max(E,B)}}else L instanceof ui?(T=s.near,B=s.far):(T=s.near,B=s.far,m=Math.min(m,T),_=Math.max(_,B));let M=h[A];l(M)||(M=h[A]=new oxt),M.command=L,M.near=T,M.far=B,A++}}y&&(C=Math.min(Math.max(C,s.near),s.far),E=Math.max(Math.min(E,s.far),C),o.nearPlane=C,o.farPlane=E,o.closestObjectSize=I),axt(this,e,m,_);for(let N=0;N<A;N++)sxt(this,e,h[N]);if(A<p)for(let N=A;N<p;N++){let L=h[N];if(!l(L.command))break;L.command=void 0}let v=f.length,{frustumSplits:R}=t;R.length=v+1;for(let N=0;N<v;++N)R[N]=f[N].near,N===v-1&&(R[N+1]=f[N].far)};vH.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var OS=vH;var VTe=.1,lxt=new om({pass:ur.MOST_DETAILED_PRELOAD}),uxt=new om({pass:ur.MOST_DETAILED_PICK}),fR=new om({pass:ur.PICK});function ms(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Bo(e);n.frustum=new An({width:VTe,aspectRatio:1,near:.1}),this._pickOffscreenView=new OS(e,n,t)}ms.prototype.update=function(){this._pickPositionCacheDirty=!0};ms.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new CH,n[t]=i),i};var fxt=new Aa,dxt=new d,PH=new d,hxt=new Q,mxt=new P;function pxt(e,t,n,i,o){let r=e.camera,a=r.frustum,s=a.offCenterFrustum;l(s)&&(a=s);let c=2*(t.x-o.x)/o.width-1;c*=(a.right-a.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(a.top-a.bottom)*.5;let f=P.clone(r.transform,mxt);r._setTransform(P.IDENTITY);let h=d.clone(r.position,dxt);d.multiplyByScalar(r.right,c,PH),d.add(PH,h,h),d.multiplyByScalar(r.up,u,PH),d.add(PH,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=a.getPixelDimensions(o.width,o.height,1,1,hxt),A=fxt;return A.right=p.x*.5,A.left=-A.right,A.top=p.y*.5,A.bottom=-A.top,A.near=a.near,A.far=a.far,A.computeCullingVolume(h,r.directionWC,r.upWC)}var Axt=new Su,gxt=new Q;function _xt(e,t,n,i,o){let r=e.camera,a=r.frustum,s=a.near,c=Math.tan(a.fovy*.5),u=a.aspectRatio*c,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*s*u,A=h*s*c,m=a.getPixelDimensions(o.width,o.height,1,1,gxt),_=m.x*n*.5,y=m.y*i*.5,C=Axt;return C.top=A+y,C.bottom=A-y,C.right=p+_,C.left=p-_,C.near=s,C.far=a.far,C.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function RH(e,t,n,i,o){let r=e.camera.frustum;return r instanceof An||r instanceof Aa?pxt(e,t,n,i,o):_xt(e,t,n,i,o)}var dR=new et(0,0,3,3),MH=new Q,hR=new U(0,0,0,0);function see(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function HTe(e,t,n,i,o){let{context:r,frameState:a,defaultView:s}=e,{viewport:c,pickFramebuffer:u}=s;e.view=s,c.x=0,c.y=0,c.width=r.drawingBufferWidth,c.height=r.drawingBufferHeight;let f=s.passState;f.viewport=et.clone(c,f.viewport);let h=co.transformWindowToDrawingBuffer(e,t,MH);see(r.drawingBufferHeight,h,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=RH(e,h,n.width,n.height,c),a.invertClassification=!1,a.passes.pick=!0,a.tilesetPassState=fR,r.uniformState.update(a),e.updateEnvironment(),f=u.begin(n,c),e.updateAndExecuteCommands(f,hR),e.resolveFramebuffers(f)}function WTe(e){let{context:t}=e;t.endFrame()}ms.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:a,defaultView:s}=e,{pickFramebuffer:c}=s,u=dR;HTe(e,t,u,n,i);let f;return r.webgl2?f=c.endAsync(u,a,o):(f=c.end(u,o),f=Promise.resolve(f),bt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),WTe(e),f};ms.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:a}=r,s=dR;HTe(e,t,s,n,i);let c=a.end(s,o);return WTe(e),c};ms.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:a}=e,{viewport:s,pickFramebuffer:c}=a;e.view=a,s.x=0,s.y=0,s.width=o.drawingBufferWidth,s.height=o.drawingBufferHeight;let u=a.passState;u.viewport=et.clone(s,u.viewport);let f=co.transformWindowToDrawingBuffer(e,t,MH),h=see(o.drawingBufferHeight,f,n,i,dR);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=RH(e,f,h.width,h.height,s),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=fR,o.uniformState.update(r),e.updateEnvironment(),u=c.begin(h,s),e.updateAndExecuteCommands(u,hR),e.resolveFramebuffers(u);let p=c.readCenterPixel(h);return o.endFrame(),p};ms.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:a,pickFramebuffer:s}=r;e.view=r,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=r.passState;c.viewport=et.clone(a,c.viewport);let u=co.transformWindowToDrawingBuffer(e,t,MH),f=see(i.drawingBufferHeight,u,1,1,dR);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=RH(e,u,f.width,f.height,a),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=fR,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=s.begin(f,a),e.updateAndExecuteCommands(c,hR);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=h;let p=s.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,yH.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function yxt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:a,pickDepthFramebuffer:s}=n;e.view=n,a.x=0,a.y=0,a.width=i.drawingBufferWidth,a.height=i.drawingBufferHeight;let c=n.passState;c.viewport=et.clone(a,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=RH(e,t,1,1,a),o.tilesetPassState=fR,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=s.update(i,t,a),e.updateAndExecuteCommands(c,hR),e.resolveFramebuffers(c),i.endFrame()}var Cxt=new Wi,Ext=new Su,Ixt=new An,bxt=new Aa;ms.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:a,defaultView:s}=e,{uniformState:c}=o;e.view=s;let u=co.transformWindowToDrawingBuffer(e,t,MH);e.pickTranslucentDepth?yxt(e,u):(e.updateFrameState(),c.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(a.frustum.fov)?f=a.frustum.clone(Cxt):l(a.frustum.infiniteProjectionMatrix)?f=a.frustum.clone(Ext):l(a.frustum.width)?f=a.frustum.clone(Ixt):f=a.frustum.clone(bxt);let{frustumCommandsList:h}=s,p=h.length;for(let A=0;A<p;++A){let _=this.getPickDepth(e,A).getDepth(o,u.x,u.y);if(l(_)&&_>0&&_<1){let y=h[A],C;return e.mode===oe.SCENE2D?(C=a.position.z,a.position.z=C-y.near+1,f.far=Math.max(1,y.far-y.near),f.near=1,c.update(r),c.updateFrustum(f)):(f.near=y.near*(A!==0?e.opaqueFrustumNearOffset:1),f.far=y.far,c.updateFrustum(f)),n=co.drawingBufferToWorldCoordinates(e,u,_,n),e.mode===oe.SCENE2D&&(a.position.z=C,c.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var xxt=new me;ms.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==oe.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,xxt);o.cartographicToCartesian(r,n)}return n};function Txt(e,t,n,i,o,r){for(let a of e){let s=a.object,c=a.position,u=a.exclude;if(l(c)&&!l(s))return n.push(a),!0;if(!l(s)||!l(s.primitive)||!u&&(n.push(a),n.length>=t))return!0;let f=s.primitive,h=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(s.id)){let p=f.getGeometryInstanceAttributes(s.id);l(p)&&l(p.show)&&(h=!0,p.show=wn.toValue(!1,p.show),o.push(p))}s instanceof Vs&&(h=!0,s.show=!1,r.push(s)),h||(f.show=!1,i.push(f))}}function jTe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let a=e(t);for(;l(a)&&a.length>0&&!Txt(a,t,n,i,o,r);)a=e(t-n.length);for(let s=0;s<i.length;++s)i[s].show=!0;for(let s=0;s<o.length;++s){let c=o[s];c.show=wn.toValue(!0,c.show)}for(let s=0;s<r.length;++s)r[s].show=!0;return n}ms.prototype.drillPick=function(e,t,n,i,o){return jTe(s=>this.pick(e,t,i,o,s).map(u=>({object:u,position:void 0,exclude:!1})),n).map(s=>s.object)};var GTe=new d,Sxt=new d;function wxt(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 YTe(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,GTe),a=d.cross(o,r,GTe),s=d.cross(o,a,Sxt);return i.position=t.origin,i.direction=o,i.up=s,i.right=a,i.frustum.width=n??VTe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Bxt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:a}=n,s=e._pickOffscreenView.camera,c=YTe(e,o,r,s),u=lxt;u.camera=s,u.cullingVolume=c;let f=!0,h=a.length;for(let p=0;p<h;++p){let A=a[p];A.show&&t.primitives.contains(A)&&(A.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}ms.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Bxt(this,e,t[n])&&t.splice(n--,1)};function qTe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof yu&&qTe(o,t,n))}}function NH(e,t,n,i,o,r){let a=[];if(qTe(t.primitives,i,a),a.length===0)return Promise.resolve(r());let s=new wxt(n,o,a);return e._mostDetailedRayPicks.push(s),s.promise.then(function(){return r()})}function Dxt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function vxt(e,t,n,i,o,r,a){let{context:s,frameState:c}=t,u=s.uniformState,f=e._pickOffscreenView;t.view=f,YTe(e,n,o,f.camera);let h=et.clone(f.viewport,dR),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,a?c.tilesetPassState=uxt:c.tilesetPassState=fR,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,hR),t.resolveFramebuffers(p);let A,m=f.pickFramebuffer.end(h,1)[0];if(t.context.depthTexture){let{frustumCommandsList:_}=f,y=_.length;for(let C=0;C<y;++C){let I=e.getPickDepth(t,C).getDepth(s,0,0);if(l(I)&&I>0&&I<1){let x=_[C],S=x.near*(C!==0?t.opaqueFrustumNearOffset:1),w=x.far,v=S+I*(w-S);A=In.getPoint(n,v);break}}}if(t.view=t.defaultView,s.endFrame(),l(m)||l(A))return{object:m,position:A,exclude:!l(A)&&r||Dxt(m,i)}}function cee(e,t,n,i,o,r,a,s){return jTe(function(){let u=vxt(e,t,n,o,r,a,s);return u?[u]:void 0},i)}function FS(e,t,n,i,o,r,a){let s=cee(e,t,n,1,i,o,r,a);if(s.length>0)return s[0]}function LH(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)})})}ms.prototype.pickFromRay=function(e,t,n,i){return FS(this,e,t,n,i,!1,!1)};ms.prototype.drillPickFromRay=function(e,t,n,i,o){return cee(this,e,t,n,i,o,!1,!1)};ms.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=In.clone(t),n=l(n)?n.slice():n,LH(e,NH(o,e,t,n,i,function(){return FS(o,e,t,n,i,!1,!0)}))};ms.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=In.clone(t),i=l(i)?i.slice():i,LH(e,NH(r,e,t,i,o,function(){return cee(r,e,t,n,i,o,!1,!0)}))};var Pxt=new d,Rxt=new d,Mxt=new In,KTe=new me;function lee(e,t){let n=e.ellipsoid,i=vi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Rxt),r=me.toCartesian(t,n,Pxt),a=Mxt;a.origin=r,a.direction=o;let s=new In;return In.getPoint(a,i,s.origin),d.negate(o,s.direction),s}function XTe(e,t){let n=e.ellipsoid,i=me.fromCartesian(t,n,KTe);return lee(e,i)}function JTe(e,t){let n=e.ellipsoid;return me.fromCartesian(t,n,KTe).height}function Nxt(e,t,n,i,o){let r=lee(t,n);return NH(e,t,r,i,o,function(){let a=FS(e,t,r,i,o,!0,!0);if(l(a))return JTe(t,a.position)})}function Lxt(e,t,n,i,o,r){let a=XTe(t,n);return NH(e,t,a,i,o,function(){let s=FS(e,t,a,i,o,!0,!0);if(l(s))return d.clone(s.position,r)})}ms.prototype.sampleHeight=function(e,t,n,i){let o=lee(e,t),r=FS(this,e,o,n,i,!0,!1);if(l(r))return JTe(e,r.position)};ms.prototype.clampToHeight=function(e,t,n,i,o){let r=XTe(e,t),a=FS(this,e,r,n,i,!0,!1);if(l(a))return d.clone(a.position,o)};ms.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=Nxt(this,e,t[a],n,i);return LH(e,Promise.all(r).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c].height=a[c];return t}))};ms.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let a=0;a<o;++a)r[a]=Lxt(this,e,t[a],n,i,t[a]);return LH(e,Promise.all(r).then(function(a){let s=a.length;for(let c=0;c<s;++c)t[c]=a[c];return t}))};ms.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var OH=ms;var FH=`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 QH=`precision highp float;
|
|
|
|
uniform sampler2D randomTexture;
|
|
uniform sampler2D depthTexture;
|
|
uniform float intensity;
|
|
uniform float bias;
|
|
uniform float lengthCap;
|
|
uniform int stepCount;
|
|
uniform int directionCount;
|
|
|
|
vec4 pixelToEye(vec2 screenCoordinate)
|
|
{
|
|
vec2 uv = screenCoordinate / czm_viewport.zw;
|
|
float depth = czm_readDepth(depthTexture, uv);
|
|
vec2 xy = 2.0 * uv - vec2(1.0);
|
|
vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
|
|
posEC = posEC / posEC.w;
|
|
// Avoid numerical error at far plane
|
|
if (depth >= 1.0) {
|
|
posEC.z = czm_currentFrustum.y;
|
|
}
|
|
return posEC;
|
|
}
|
|
|
|
// Reconstruct surface normal in eye coordinates, avoiding edges
|
|
vec3 getNormalXEdge(vec3 positionEC)
|
|
{
|
|
// Find the 3D surface positions at adjacent screen pixels
|
|
vec2 centerCoord = gl_FragCoord.xy;
|
|
vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0)).xyz;
|
|
vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0)).xyz;
|
|
vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0)).xyz;
|
|
vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0)).xyz;
|
|
|
|
// Compute potential tangent vectors
|
|
vec3 dx0 = positionEC - positionLeft;
|
|
vec3 dx1 = positionRight - positionEC;
|
|
vec3 dy0 = positionEC - positionDown;
|
|
vec3 dy1 = positionUp - positionEC;
|
|
|
|
// The shorter tangent is more likely to be on the same surface
|
|
vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
|
|
vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;
|
|
|
|
return normalize(cross(dx, dy));
|
|
}
|
|
|
|
const float sqrtTwoPi = sqrt(czm_twoPi);
|
|
|
|
float gaussian(float x, float standardDeviation) {
|
|
float argument = x / standardDeviation;
|
|
return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation);
|
|
}
|
|
|
|
void main(void)
|
|
{
|
|
vec4 positionEC = pixelToEye(gl_FragCoord.xy);
|
|
|
|
// Exit if we are too close to the back of the frustum, where the depth value is invalid.
|
|
float maxValidDepth = czm_currentFrustum.y - lengthCap;
|
|
if (-positionEC.z > maxValidDepth)
|
|
{
|
|
out_FragColor = vec4(1.0);
|
|
return;
|
|
}
|
|
|
|
vec3 normalEC = getNormalXEdge(positionEC.xyz);
|
|
float gaussianVariance = lengthCap * sqrt(-positionEC.z);
|
|
// Choose a step length such that the marching stops just before 3 * variance.
|
|
float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
|
|
float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
|
|
// Minimum step is 1 pixel to avoid double sampling
|
|
float pixelsPerStep = max(stepLength / metersPerPixel, 1.0);
|
|
stepLength = pixelsPerStep * metersPerPixel;
|
|
|
|
float angleStepScale = 1.0 / float(directionCount);
|
|
float angleStep = angleStepScale * czm_twoPi;
|
|
float cosStep = cos(angleStep);
|
|
float sinStep = sin(angleStep);
|
|
mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);
|
|
|
|
// Initial sampling direction (different for each pixel)
|
|
const float randomTextureSize = 255.0;
|
|
vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
|
|
float randomVal = texture(randomTexture, randomTexCoord).x;
|
|
vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));
|
|
|
|
float ao = 0.0;
|
|
// Loop over sampling directions
|
|
#if __VERSION__ == 300
|
|
for (int i = 0; i < directionCount; i++)
|
|
{
|
|
#else
|
|
for (int i = 0; i < 16; i++)
|
|
{
|
|
if (i >= directionCount) {
|
|
break;
|
|
}
|
|
#endif
|
|
sampleDirection = rotateStep * sampleDirection;
|
|
|
|
float localAO = 0.0;
|
|
vec2 radialStep = pixelsPerStep * sampleDirection;
|
|
|
|
#if __VERSION__ == 300
|
|
for (int j = 0; j < stepCount; j++)
|
|
{
|
|
#else
|
|
for (int j = 0; j < 64; j++)
|
|
{
|
|
if (j >= stepCount) {
|
|
break;
|
|
}
|
|
#endif
|
|
// Step along sampling direction, away from output pixel
|
|
vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
|
|
|
|
// Exit if we stepped off the screen
|
|
if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
|
|
break;
|
|
}
|
|
|
|
// Compute step vector from output point to sampled point
|
|
vec4 samplePositionEC = pixelToEye(samplePixel);
|
|
vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;
|
|
|
|
// Estimate the angle from the surface normal.
|
|
float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
|
|
dotVal = czm_branchFreeTernary(dotVal > bias, dotVal, 0.0);
|
|
dotVal = czm_branchFreeTernary(-samplePositionEC.z <= maxValidDepth, dotVal, 0.0);
|
|
|
|
// Weight contribution based on the distance from the output point
|
|
float sampleDistance = length(stepVector);
|
|
float weight = gaussian(sampleDistance, gaussianVariance);
|
|
localAO += weight * dotVal;
|
|
}
|
|
ao += localAO;
|
|
}
|
|
|
|
ao *= angleStepScale * stepLength;
|
|
ao = 1.0 - clamp(ao, 0.0, 1.0);
|
|
ao = pow(ao, intensity);
|
|
out_FragColor = vec4(vec3(ao), 1.0);
|
|
}
|
|
`;var kH=`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 UH=`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 zH=`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 GH=`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 VH=`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 HH=`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 WH=`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 jH=`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 YH=`uniform sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
uniform sampler2D autoExposure;
|
|
#else
|
|
uniform float exposure;
|
|
#endif
|
|
|
|
// See slides 142 and 143:
|
|
// http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting
|
|
|
|
void main()
|
|
{
|
|
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
|
|
vec3 color = fragmentColor.rgb;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
float exposure = texture(autoExposure, vec2(0.5)).r;
|
|
color /= exposure;
|
|
#else
|
|
color *= vec3(exposure);
|
|
#endif
|
|
|
|
const float A = 0.22; // shoulder strength
|
|
const float B = 0.30; // linear strength
|
|
const float C = 0.10; // linear angle
|
|
const float D = 0.20; // toe strength
|
|
const float E = 0.01; // toe numerator
|
|
const float F = 0.30; // toe denominator
|
|
|
|
const float white = 11.2; // linear white point value
|
|
|
|
vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
|
|
float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;
|
|
|
|
c = czm_inverseGamma(c / w);
|
|
out_FragColor = vec4(c, fragmentColor.a);
|
|
}
|
|
`;var qH=`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 KH=`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 Y0=`#define SAMPLES 8
|
|
|
|
uniform float delta;
|
|
uniform float sigma;
|
|
uniform float direction; // 0.0 for x direction, 1.0 for y direction
|
|
|
|
uniform sampler2D colorTexture;
|
|
|
|
#ifdef USE_STEP_SIZE
|
|
uniform float stepSize;
|
|
#else
|
|
uniform vec2 step;
|
|
#endif
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
// Incremental Computation of the Gaussian:
|
|
// https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html
|
|
|
|
void main()
|
|
{
|
|
vec2 st = v_textureCoordinates;
|
|
vec2 dir = vec2(1.0 - direction, direction);
|
|
|
|
#ifdef USE_STEP_SIZE
|
|
vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
|
|
#else
|
|
vec2 step = step;
|
|
#endif
|
|
|
|
vec3 g;
|
|
g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
|
|
g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
|
|
g.z = g.y * g.y;
|
|
|
|
vec4 result = texture(colorTexture, st) * g.x;
|
|
for (int i = 1; i < SAMPLES; ++i)
|
|
{
|
|
g.xy *= g.yz;
|
|
|
|
vec2 offset = float(i) * dir * step;
|
|
result += texture(colorTexture, st - offset) * g.x;
|
|
result += texture(colorTexture, st + offset) * g.x;
|
|
}
|
|
|
|
out_FragColor = result;
|
|
}
|
|
`;var XH=`uniform sampler2D colorTexture;
|
|
uniform sampler2D dirtTexture;
|
|
uniform sampler2D starTexture;
|
|
uniform vec2 dirtTextureDimensions;
|
|
uniform float distortion;
|
|
uniform float ghostDispersal;
|
|
uniform float haloWidth;
|
|
uniform float dirtAmount;
|
|
uniform float earthRadius;
|
|
uniform float intensity;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
// whether it is in space or not
|
|
// 6500000.0 is empirical value
|
|
#define DISTANCE_TO_SPACE 6500000.0
|
|
|
|
// return ndc from world coordinate biased earthRadius
|
|
vec4 getNDCFromWC(vec3 WC, float earthRadius)
|
|
{
|
|
vec4 positionEC = czm_view * vec4(WC, 1.0);
|
|
positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
|
|
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
|
|
return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
|
|
}
|
|
|
|
// Check if current pixel is included Earth
|
|
// if then mask it gradually
|
|
float isInEarth(vec2 texcoord, vec2 sceneSize)
|
|
{
|
|
vec2 NDC = texcoord * 2.0 - 1.0;
|
|
vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
|
|
vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
|
|
NDC.xy -= earthPosSC.xy;
|
|
|
|
float X = abs(NDC.x) * sceneSize.x;
|
|
float Y = abs(NDC.y) * sceneSize.y;
|
|
|
|
return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
|
|
}
|
|
|
|
// For Chromatic effect
|
|
vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
|
|
{
|
|
vec2 sceneSize = czm_viewport.zw;
|
|
vec3 color;
|
|
if(isSpace)
|
|
{
|
|
color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
|
|
color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
|
|
color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
|
|
}
|
|
else
|
|
{
|
|
color.r = texture(tex, texcoord + direction * distortion.r).r;
|
|
color.g = texture(tex, texcoord + direction * distortion.g).g;
|
|
color.b = texture(tex, texcoord + direction * distortion.b).b;
|
|
}
|
|
return vec4(clamp(color, 0.0, 1.0), 0.0);
|
|
}
|
|
|
|
void main(void)
|
|
{
|
|
vec4 originalColor = texture(colorTexture, v_textureCoordinates);
|
|
vec3 rgb = originalColor.rgb;
|
|
bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;
|
|
|
|
// Sun position
|
|
vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
|
|
vec4 sunPositionEC = czm_view * sunPos;
|
|
vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
|
|
sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);
|
|
|
|
// If sun is not in the screen space, use original color.
|
|
if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
|
|
{
|
|
// Lens flare is disabled when not in space until #5932 is fixed.
|
|
// https://github.com/CesiumGS/cesium/issues/5932
|
|
out_FragColor = originalColor;
|
|
return;
|
|
}
|
|
|
|
vec2 texcoord = vec2(1.0) - v_textureCoordinates;
|
|
vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
|
|
vec2 invPixelSize = 1.0 / pixelSize;
|
|
vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);
|
|
|
|
// ghost vector to image centre:
|
|
vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
|
|
vec3 direction = normalize(vec3(ghostVec, 0.0));
|
|
|
|
// sample ghosts:
|
|
vec4 result = vec4(0.0);
|
|
vec4 ghost = vec4(0.0);
|
|
for (int i = 0; i < 4; ++i)
|
|
{
|
|
vec2 offset = fract(texcoord + ghostVec * float(i));
|
|
// Only bright spots from the centre of the source image
|
|
ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
|
|
}
|
|
result += ghost;
|
|
|
|
// sample halo
|
|
vec2 haloVec = normalize(ghostVec) * haloWidth;
|
|
float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
|
|
weightForHalo = pow(1.0 - weightForHalo, 5.0);
|
|
|
|
result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;
|
|
|
|
// dirt on lens
|
|
vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
|
|
if (dirtTexCoords.x > 1.0)
|
|
{
|
|
dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);
|
|
}
|
|
if (dirtTexCoords.y > 1.0)
|
|
{
|
|
dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);
|
|
}
|
|
result += dirtAmount * texture(dirtTexture, dirtTexCoords);
|
|
|
|
// Rotating starburst texture's coordinate
|
|
// dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0))
|
|
float camrot = czm_view[0].z + czm_view[1].y;
|
|
float cosValue = cos(camrot);
|
|
float sinValue = sin(camrot);
|
|
mat3 rotation = mat3(
|
|
cosValue, -sinValue, 0.0,
|
|
sinValue, cosValue, 0.0,
|
|
0.0, 0.0, 1.0
|
|
);
|
|
|
|
vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
|
|
vec3 st2 = vec3((rotation * st1).xy, 1.0);
|
|
vec3 st3 = st2 * 0.5 + vec3(0.5);
|
|
vec2 lensStarTexcoord = st3.xy;
|
|
float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
|
|
float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);
|
|
|
|
if (!isSpace)
|
|
{
|
|
result *= oneMinusWeightForLensFlare * intensity * 0.2;
|
|
}
|
|
else
|
|
{
|
|
result *= oneMinusWeightForLensFlare * intensity;
|
|
result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
|
|
}
|
|
|
|
result += texture(colorTexture, v_textureCoordinates);
|
|
|
|
out_FragColor = result;
|
|
}
|
|
`;var JH=`uniform sampler2D colorTexture;
|
|
uniform vec3 white;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
uniform sampler2D autoExposure;
|
|
#else
|
|
uniform float exposure;
|
|
#endif
|
|
|
|
// See equation 4:
|
|
// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
|
|
|
|
void main()
|
|
{
|
|
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
|
|
vec3 color = fragmentColor.rgb;
|
|
#ifdef AUTO_EXPOSURE
|
|
float exposure = texture(autoExposure, vec2(0.5)).r;
|
|
color /= exposure;
|
|
#else
|
|
color *= vec3(exposure);
|
|
#endif
|
|
color = (color * (1.0 + color / white)) / (1.0 + color);
|
|
color = czm_inverseGamma(color);
|
|
out_FragColor = vec4(color, fragmentColor.a);
|
|
}
|
|
`;var ZH=`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 $H=`uniform sampler2D colorTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
#ifdef AUTO_EXPOSURE
|
|
uniform sampler2D autoExposure;
|
|
#else
|
|
uniform float exposure;
|
|
#endif
|
|
|
|
// See equation 3:
|
|
// http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf
|
|
|
|
void main()
|
|
{
|
|
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
|
|
vec3 color = fragmentColor.rgb;
|
|
#ifdef AUTO_EXPOSURE
|
|
float exposure = texture(autoExposure, vec2(0.5)).r;
|
|
color /= exposure;
|
|
#else
|
|
color *= vec3(exposure);
|
|
#endif
|
|
color = color / (1.0 + color);
|
|
color = czm_inverseGamma(color);
|
|
out_FragColor = vec4(color, fragmentColor.a);
|
|
}
|
|
`;var e4=`uniform sampler2D colorTexture;
|
|
uniform sampler2D silhouetteTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main(void)
|
|
{
|
|
vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
|
|
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
|
|
}
|
|
`;function q0(){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 bi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new Q,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(q0.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function ZTe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Oxt(e,t){ZTe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),a=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),a[c]=new bi,a[c].update(t,n,i,1,o);let s=a[r-1].getColorTexture(0);e._previousLuminance.update(t,s.width,s.height,1,o),e._framebuffers=a}function $Te(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Fxt(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 Qxt(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 kxt(e,t){$Te(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Qxt(r,i),{framebuffer:n[r].framebuffer,uniformMap:Fxt(e,r)});e._commands=o}q0.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ui({color:new U(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};q0.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Oxt(this,e),kxt(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};q0.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};q0.prototype.isDestroyed=function(){return!1};q0.prototype.destroy=function(){return ZTe(this),$Te(this),fe(this)};var t4=q0;var Uxt={NEAREST:0,LINEAR:1},Qd=Uxt;function K0(e){e=e??V.EMPTY_OBJECT;let{name:t=Jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:a=Qd.NEAREST,pixelFormat:s=Ke.RGBA,pixelDatatype:c=He.UNSIGNED_BYTE,clearColor:u=U.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=a,this._pixelFormat=s,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new ll;h.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(K0.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var zxt=/uniform\s+sampler2D\s+depthTexture/g;K0.prototype._isSupported=function(e){return!zxt.test(this._fragmentShader)||e.depthTexture};function Gxt(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 a=e._actualUniforms,s=a[n];l(s)&&s!==r&&s instanceof vt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(s),delete a[n],delete a[`${n}Dimensions`]),r instanceof vt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):a[n]=o}}}function Vxt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Hxt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Wxt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=Vxt(e,r),n[r]=Gxt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let a=t[r]();(typeof a=="string"||a instanceof vt||a instanceof HTMLImageElement||a instanceof HTMLCanvasElement||a instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Hxt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Pt(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 jxt(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 Yxt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=jxt(n,o)}let i=new We({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function qxt(e){let t=e._sampleMode,n,i;t===Qd.LINEAR?(n=Wt.LINEAR,i=si.LINEAR):(n=Wt.NEAREST,i=si.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Kxt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Xxt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Jxt(e,t){let n=e._texturesToRelease;for(let s=0;s<n.length;++s){let c=n[s];c=c&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let s=0;s<i.length;++s){let{name:c,source:u}=i[s];e._actualUniforms[c]=new vt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,a=[];for(let s=0;s<o.length;++s){let c=o[s],u=r[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=Xxt(e,u);else if(typeof u=="string"){let h=new De({url:u});a.push(h.fetchImage().then(Kxt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}o.length=0,a.length>0?(e._ready=!1,e._texturePromise=Promise.all(a).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function eSe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof vt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function Zxt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function $xt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let a=0;a<n.length;++a){let s=n[a];l(s.pickIds)?i+=s.pickIds.length:l(s.pickId)&&++i}if(n.length===0||i===0){let a=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new vt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:a,width:1,height:1},sampler:jt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let a=0;a<n.length;++a){let s=n[a];if(l(s.pickIds)){let c=s.pickIds,u=c.length;for(let f=0;f<u;++f){let h=c[f].color;r[o]=U.floatToByte(h.red),r[o+1]=U.floatToByte(h.green),r[o+2]=U.floatToByte(h.blue),r[o+3]=U.floatToByte(h.alpha),o+=4}}else if(l(s.pickId)){let c=s.pickId.color;r[o]=U.floatToByte(c.red),r[o+1]=U.floatToByte(c.green),r[o+2]=U.floatToByte(c.blue),r[o+3]=U.floatToByte(c.alpha),o+=4}}e._selectedIdTexture=new vt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:jt.NEAREST})}K0.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&eSe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Zxt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,$xt(this,e),Wxt(this),Jxt(this,e),Yxt(this,e),qxt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=Ve.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=o};K0.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,jt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){return eSe(this),fe(this)};var Oo=K0;function X0(e){e=e??V.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Jn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(X0.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}}});X0.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};X0.prototype.get=function(e){return this._stages[e]};function eTt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}X0.prototype.update=function(e,t){this._selectedDirty=eTt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};X0.prototype.isDestroyed=function(){return!1};X0.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return fe(this)};var xf=X0;var Kr={};function uee(e){let o=`#define USE_STEP_SIZE
|
|
${Y0}`,r=new Oo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Qd.LINEAR}),a=new Oo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Qd.LINEAR}),s={};return Object.defineProperties(s,{delta:{get:function(){return r.uniforms.delta},set:function(c){let u=r.uniforms,f=a.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let u=r.uniforms,f=a.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let u=r.uniforms,f=a.uniforms;u.stepSize=f.stepSize=c}}}),new xf({name:e,stages:[r,a],uniforms:s})}Kr.createBlurStage=function(){return uee("czm_blur")};Kr.createDepthOfFieldStage=function(){let e=uee("czm_depth_of_field_blur"),t=new Oo({name:"czm_depth_of_field_composite",fragmentShader:HH,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 xf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Kr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};Kr.createEdgeDetectionStage=function(){let e=Jn();return new Oo({name:`czm_edge_detection_${e}`,fragmentShader:jH,uniforms:{length:.25,color:U.clone(U.BLACK)}})};Kr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function tTt(e){if(!l(e))return Kr.createEdgeDetectionStage();let t=new xf({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let s=0;s<e.length;++s)i+=`uniform sampler2D edgeTexture${s};
|
|
`,o+=` vec4 edge${s} = texture(edgeTexture${s}, v_textureCoordinates);
|
|
if (edge${s}.a > 0.0)
|
|
{
|
|
color = edge${s};
|
|
break;
|
|
}
|
|
`,n[`edgeTexture${s}`]=e[s].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;
|
|
}
|
|
`,a=new Oo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new xf({name:"czm_edge_detection_composite",stages:[t,a]})}Kr.createSilhouetteStage=function(e){let t=tTt(e),n=new Oo({name:"czm_silhouette_color_edges",fragmentShader:e4,uniforms:{silhouetteTexture:t.name}});return new xf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};Kr.isSilhouetteSupported=function(e){return e.context.depthTexture};Kr.createBloomStage=function(){let e=new Oo({name:"czm_bloom_contrast_bias",fragmentShader:VH,uniforms:{contrast:128,brightness:-.3}}),t=uee("czm_bloom_blur"),n=new xf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Oo({name:"czm_bloom_generate_composite",fragmentShader:zH,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 xf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};Kr.createAmbientOcclusionStage=function(){let e=new Oo({name:"czm_ambient_occlusion_generate",fragmentShader:QH,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Oo({name:"czm_ambient_occlusion_composite",fragmentShader:kH,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 xf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};Kr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var nTt=`#define FXAA_QUALITY_PRESET 39
|
|
${d8}
|
|
${KH}`;Kr.createFXAAStage=function(){return new Oo({name:"czm_FXAA",fragmentShader:nTt,sampleMode:Qd.LINEAR})};Kr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=FH,new Oo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Kr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=YH,new Oo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Kr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=qH,new Oo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Kr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=$H,new Oo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};Kr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
|
|
`:"";return t+=JH,new Oo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};Kr.createAutoExposureStage=function(){return new t4};Kr.createBlackAndWhiteStage=function(){return new Oo({name:"czm_black_and_white",fragmentShader:UH,uniforms:{gradations:5}})};Kr.createBrightnessStage=function(){return new Oo({name:"czm_brightness",fragmentShader:GH,uniforms:{brightness:.5}})};Kr.createNightVisionStage=function(){return new Oo({name:"czm_night_vision",fragmentShader:ZH})};Kr.createDepthViewStage=function(){return new Oo({name:"czm_depth_view",fragmentShader:WH})};Kr.createLensFlareStage=function(){return new Oo({name:"czm_lens_flare",fragmentShader:XH,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:te.WGS84.maximumRadius}})};var kd=Kr;function bg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function pR(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function fee(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let s=e.getStageByName(o);r[pR(s)]=!0}let a=i.uniforms;if(l(a)){let s=Object.getOwnPropertyNames(a),c=s.length;for(let u=0;u<c;++u){let f=a[s[u]];if(typeof f=="string"){let h=e.getStageByName(f);l(h)&&(r[pR(h)]=!0)}}}return i.name}function mR(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,a=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,s=o,c=i.length;for(let h=0;h<c;++h){let p=i.get(h);l(p.length)?s=mR(e,t,n,p,o):s=fee(e,t,n,p,o),a&&(o=s)}let u,f;if(a)for(u=1;u<c;++u)f=pR(i.get(u)),l(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<c;++u){f=pR(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[pR(i.get(p))]=!0}return s}function iTt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,a=e.fxaa,s=mR(e,t,n,i,void 0);s=mR(e,t,n,o,s),s=fee(e,t,n,r,s),s=mR(e,t,n,e,s),fee(e,t,n,a,s)}else mR(e,t,n,e,void 0);return n}function oTt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,a=o._forcePowerOfTwo,s=o._pixelFormat,c=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,A=p.length;for(f=0;f<A;++f){if(h=p[f],r!==h.textureScale||a!==h.forcePowerOfTwo||s!==h.pixelFormat||c!==h.pixelDatatype||!U.equals(u,h.clearColor))continue;let m=h.stages,_=m.length,y=!1;for(let C=0;C<_;++C)if(n[m[C]]){y=!0;break}if(!y)break}return l(h)&&f<A?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:a,pixelFormat:s,pixelDatatype:c,clearColor:u,stages:[t],buffer:new bi({pixelFormat:s,pixelDatatype:c}),clear:void 0},p.push(h),h)}function rTt(e,t){let n=iTt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=oTt(e,i,n[i]))}function dee(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function aTt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let a=0;a<r;++a){let s=o[a],c=s.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),h=Math.min(u,f);s.forcePowerOfTwo&&(D.isPowerOfTwo(h)||(h=D.nextPowerOfTwo(h)),u=h,f=h),s.buffer.update(t,u,f),s.clear=new ui({color:s.clearColor,framebuffer:s.buffer.framebuffer})}}bg.prototype.updateDependencies=function(){this._updateDependencies=!0};bg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),a=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),s=!l(t._activeStages)||t._activeStages.length>0||i||o||r||a;if((n||!s&&this._framebuffers.length>0)&&(dee(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!s)return;this._framebuffers.length===0&&rTt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,dee(this),aTt(this,e))};bg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};bg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};bg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};bg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return dee(this),fe(this)};var QS=bg;var sTt={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};var _C=Object.freeze(sTt);var hee=[];function Ql(){let e=kd.createFXAAStage(),t=kd.createAmbientOcclusionStage(),n=kd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=kd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=_C.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new QS(this),r={},a=hee;for(a.push(e,t,n,i);a.length>0;){let c=a.pop();r[c.name]=c,c._textureCache=o;let u=c.length;if(l(u))for(let f=0;f<u;++f)a.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let s=this;t.uniforms.randomTexture=function(){return s._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(Ql.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let c=t[s];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,a=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||a.ready&&a.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return mee(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 a=n-1;a>=0;--a){let s=t[a];if(l(s)&&s.ready&&s.enabled)return this.getOutputTexture(s.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case _C.REINHARD:n=kd.createReinhardTonemappingStage(t);break;case _C.MODIFIED_REINHARD:n=kd.createModifiedReinhardTonemappingStage(t);break;case _C.FILMIC:n=kd.createFilmicTonemappingStage(t);break;case _C.PBR_NEUTRAL:n=kd.createPbrNeutralTonemappingStage(t);break;default:n=kd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function mee(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}Ql.prototype.add=function(e){let t=this._stageNames,n=hee;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let a=0;a<r;++a)n.push(o.get(a))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Ql.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=hee;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Ql.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Ql.prototype.get=function(e){return mee(this),this._stages[e]};Ql.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Ql.prototype.getStageByName=function(e){return this._stageNames[e]};Ql.prototype.update=function(e,t,n){mee(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let a=0;for(let C=0;C<r.length;++C){let E=r[C];E.ready&&E.enabled&&E._isSupported(e)&&(o[a++]=E)}o.length=a;let s=a!==i.length;if(!s){for(let C=0;C<a;++C)if(o[C]!==i[C]){s=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let A=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),_=h.enabled&&h._isSupported(e),y=p.enabled&&p._isSupported(e);if((s||this._textureCacheDirty||A!==this._aoEnabled||m!==this._bloomEnabled||_!==this._tonemappingEnabled||y!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=A,this._bloomEnabled=m,this._tonemappingEnabled=_,this._fxaaEnabled=y,this._textureCacheDirty=!1),l(this._randomTexture)&&!A&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&A){let E=new Uint8Array(196608);for(let I=0;I<196608;I+=3)E[I]=Math.floor(Math.random()*255);this._randomTexture=new vt({context:e,pixelFormat:Ke.RGB,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:E,width:256,height:256},sampler:new jt({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let C=0;C<r.length;++C)r[C].update(e,t);a=0;for(let C=0;C<r.length;++C){let E=r[C];E.ready&&E.enabled&&E._isSupported(e)&&a++}s=a!==o.length,s&&this.update(e,t,n)};Ql.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function J0(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Ql.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return J0(t)};function Hp(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){Hp(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)Hp(e.get(r),t,J0(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)Hp(e.get(r),t,n,i,o)}Ql.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,a=this._fxaa,s=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,h=s.enabled&&s._isSupported(e),p=c.enabled&&c._isSupported(e),A=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),_=a.enabled&&a._isSupported(e);if(!_&&!h&&!p&&!m&&r===0)return;let y=t;h&&s.ready&&(Hp(s,e,y,n,i),y=J0(s)),p&&c.ready&&(Hp(c,e,y,n,i),y=J0(c)),A&&u.ready&&Hp(u,e,y,n,i),m&&f.ready&&(Hp(f,e,y,n,i),y=J0(f));let C=y;if(r>0){Hp(o[0],e,y,n,i);for(let E=1;E<r;++E)Hp(o[E],e,J0(o[E-1]),n,i);C=J0(o[r-1])}_&&a.ready&&Hp(a,e,C,n,i)};Ql.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(bf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Ql.prototype.isDestroyed=function(){return!1};Ql.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),fe(this)};var n4=Ql;function Z0(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Z0.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};Z0.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof An,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?UTt(this,e):YTt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var cTt=new d,lTt=new d,uTt=new d,fTt=new d,dTt=new d,hTt=new d,mTt=new d,pTt=new me,ATt=new P,gTt=new Wi,_Tt=new An,yTt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};Z0.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(P.IDENTITY);let i=cTt,o=lTt,r=uTt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,mTt),h=At.eastNorthUpToFixedFrame(f,t,ATt);P.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,pTt),i),P.multiplyByPointAsVector(h,o,o),P.multiplyByPointAsVector(h,r,r)}}let a;this._morphToOrthographic?(a=_Tt,a.width=n.camera.frustum.right-n.camera.frustum.left,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(a=gTt,a.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,a.fov=D.toRadians(60));let s=yTt;s.position=i,s.direction=o,s.up=r,s.frustum=a;let c=KTt(s);AR(this,c),this._previousMode===oe.SCENE2D?qTt(this,e,s,c):(s.position2D=P.multiplyByPoint(Bo.TRANSFORM_2D,i,fTt),s.direction2D=P.multiplyByPointAsVector(Bo.TRANSFORM_2D,o,dTt),s.up2D=P.multiplyByPointAsVector(Bo.TRANSFORM_2D,r,hTt),n._mode=oe.MORPHING,fSe(this,e,s,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var gee={position:new d,direction:new d,up:new d,frustum:void 0},nSe=new Wi;Z0.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===oe.SCENE2D)vTt(this,e,t);else{let i;e>0?(i=gee,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=iSe(this,t);let o,r=n.camera;r.frustum instanceof An?o=r.frustum.clone():(o=nSe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=D.toRadians(60)),i.frustum=o;let a=hSe(i);AR(this,a),Aee(this,e,i,a)}e===0&&l(this._completeMorph)&&this._completeMorph()}};Z0.prototype.isDestroyed=function(){return!1};Z0.prototype.destroy=function(){return i4(this),fe(this)};function AR(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ld(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Dn.LEFT_DOWN),e._morphHandler.setInputAction(n,Dn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Dn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Dn.WHEEL)}}function i4(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 CTt=new me,ETt=new d,ITt=new P;function iSe(e,t){let n=e._scene,i=n.camera,o=gee,r=o.position,a=o.direction,s=o.up,c=n.mapProjection.unproject(i.position,CTt);t.cartographicToCartesian(c,r);let u=t.scaleToGeodeticSurface(r,ETt),f=At.eastNorthUpToFixedFrame(u,t,ITt);return P.multiplyByPointAsVector(f,i.direction,a),P.multiplyByPointAsVector(f,i.up,s),o}var bTt=new d,xTt=new d,TTt=new d,STt=new d,wTt=new d,BTt=new d;function Aee(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,a=d.clone(r.position,bTt),s=d.clone(r.direction,xTt),c=d.clone(r.up,TTt),u=P.multiplyByPoint(Bo.TRANSFORM_2D_INVERSE,n.position,STt),f=P.multiplyByPointAsVector(Bo.TRANSFORM_2D_INVERSE,n.direction,wTt),h=P.multiplyByPointAsVector(Bo.TRANSFORM_2D_INVERSE,n.up,BTt);function p(m){Ud(a,u,m.time,r.position),Ud(s,f,m.time,r.direction),Ud(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let A=o.tweens.add({duration:t,easingFunction:Pa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dSe(e,o,0,1,t,i)}});e._currentTweens.push(A)}var DTt=new An,oSe=new d,rSe=new d,aSe=new d,_ee=new d,sSe=new d,cSe=new d;function vTt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=gee,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=iSe(e,n));let a;e._morphToOrthographic?(a=DTt,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.width=o.frustum.right-o.frustum.left):(a=nSe,a.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,a.fov=D.toRadians(60)),r.frustum=a;let s=hSe(r);AR(e,s);let c;e._morphToOrthographic?c=function(){Aee(e,t,r,s)}:c=function(){uSe(e,t,r,function(){Aee(e,t,r,s)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,_ee),complete:function(){i._mode=oe.MORPHING,c()}})):c()}function Ud(e,t,n,i){return d.lerp(e,t,n,i)}function lSe(e,t,n,i,o){let r=e._scene,a=r.camera;if(a.frustum instanceof An)return;let s=a.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(s*.5);a.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){a.frustum.fov=D.lerp(s,c,p.time);let A=u/Math.tan(a.frustum.fov*.5);i(a,A)}let h=r.tweens.add({duration:t,easingFunction:Pa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){a.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var PTt=new d,RTt=new d,MTt=new d,pee=new d,NTt=new d,LTt=new d,OTt=new Aa,FTt=new In,QTt=new d,kTt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function UTt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,PTt),r=d.clone(i.direction,RTt),a=d.clone(i.up,MTt),s=d.negate(d.UNIT_Z,NTt),c=d.clone(d.UNIT_Y,LTt),u=pee;if(t>0)d.clone(d.ZERO,pee),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,pee);let y=FTt;P.multiplyByPoint(Bo.TRANSFORM_2D,o,y.origin),P.multiplyByPointAsVector(Bo.TRANSFORM_2D,r,y.direction);let C=n.globe;if(l(C)){let E=C.pickWorldCoordinates(y,n,!0,QTt);l(E)&&(P.multiplyByPoint(Bo.TRANSFORM_2D_INVERSE,E,u),u.z+=d.distance(o,u))}}let f=OTt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=kTt;h.position=u,h.direction=s,h.up=c,h.frustum=f;let p=mSe(h);AR(e,p);function A(y){Ud(o,u,y.time,i.position),Ud(r,s,y.time,i.direction),Ud(a,c,y.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(y,C){y.position.z=C}let _=n.tweens.add({duration:t,easingFunction:Pa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:A,complete:function(){lSe(e,t,h,m,p)}});e._currentTweens.push(_)}var tSe=new me,zTt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new Aa},GTt={position:new d,direction:new d,up:new d,frustum:void 0},VTt=new d,HTt=new In,WTt=new P,jTt=new d;function YTt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=zTt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,tSe),i.mapProjection.project(tSe,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=HTt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),A=n.scaleToGeodeticSurface(o.positionWC,jTt),m=At.eastNorthUpToFixedFrame(A,n,WTt);P.inverseTransformation(m,m),P.multiplyByPointAsVector(m,p,p),P.multiplyByPointAsVector(Bo.TRANSFORM_2D,p,p);let _=i.globe;if(l(_)){let y=_.pickWorldCoordinates(h,i,!0,VTt);if(l(y)){let C=d.distance(r.position2D,y);y.x+=C,d.clone(y,r.position2D)}}}function a(h,p){h.position.x=p}P.multiplyByPoint(Bo.TRANSFORM_2D,r.position,r.position2D),P.multiplyByPointAsVector(Bo.TRANSFORM_2D,r.direction,r.direction2D),P.multiplyByPointAsVector(Bo.TRANSFORM_2D,r.up,r.up2D);let s=r.frustum;s.right=r.position.z*.5,s.left=-s.right,s.top=s.right*(i.drawingBufferHeight/i.drawingBufferWidth),s.bottom=-s.top;let c=GTt;P.multiplyByPoint(Bo.TRANSFORM_2D_INVERSE,r.position2D,c.position),d.clone(r.direction,c.direction),d.clone(r.up,c.up),c.frustum=s;let u=mSe(c);AR(e,u);function f(){lSe(e,t,r,a,u)}fSe(e,t,r,f)}function uSe(e,t,n,i){let o=e._scene,r=o.camera,a=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let s=r.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=a*Math.tan(s*.5);r.frustum.far=u/Math.tan(c*.5)+1e7,r.frustum.fov=c;function f(p){r.frustum.fov=D.lerp(c,s,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Pa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function qTt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,a=d.clone(n.position,_ee),s=d.clone(n.direction,sSe),c=d.clone(n.up,cSe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,oSe),h=d.clone(r.direction,rSe),p=d.clone(r.up,aSe);f.z=a.z;function A(_){Ud(f,a,_.time,r.position),Ud(h,s,_.time,r.direction),Ud(p,c,_.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Pa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:A,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():uSe(e,0,n,u)}function fSe(e,t,n,i){let o=e._scene,r=o.camera,a=d.clone(r.position,oSe),s=d.clone(r.direction,rSe),c=d.clone(r.up,aSe),u=d.clone(n.position2D,_ee),f=d.clone(n.direction2D,sSe),h=d.clone(n.up2D,cSe);function p(m){Ud(a,u,m.time,r.position),Ud(s,f,m.time,r.direction),Ud(c,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let A=o.tweens.add({duration:t,easingFunction:Pa.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){dSe(e,o,1,0,t,i)}});e._currentTweens.push(A)}function dSe(e,t,n,i,o,r){let a={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Pa.QUARTIC_OUT};l(r)&&(a.complete=function(){r(e)});let s=t.tweens.addProperty(a);e._currentTweens.push(s)}function hSe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),i4(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function mSe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),i4(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function KTt(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),i4(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var o4=Z0;var XTt={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},oo=Object.freeze(XTt);function Os(e,t){let n=`${e}`;return l(t)&&(n+=`+${t}`),n}function JTt(e,t){Q.clone(e.distance.startPosition,t.distance.startPosition),Q.clone(e.distance.endPosition,t.distance.endPosition),Q.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),Q.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function pSe(e,t,n){let i=Os(oo.PINCH,t),o=e._update,r=e._isDown,a=e._eventStartPosition,s=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,a[i]=new Q;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new Q,endPosition:new Q},u.angleAndHeight={startPosition:new Q,endPosition:new Q},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,s[i]=new Date,Q.lerp(f.position1,f.position2,.5,a[i])},Dn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},Dn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(JTt(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(Q.clone(f.distance.endPosition,u.distance.endPosition),Q.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,A=Math.PI*2;for(;h>=p+Math.PI;)h-=A;for(;h<p-Math.PI;)h+=A;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Dn.PINCH_MOVE,t)}function ASe(e,t){let n=Os(oo.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let a=e._movement[n];l(a)||(a=e._movement[n]={});let s=e._lastMovement[n];l(s)||(s=e._lastMovement[n]={startPosition:new Q,endPosition:new Q,valid:!1}),a.startPosition=new Q,Q.clone(Q.ZERO,a.startPosition),a.endPosition=new Q,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=o[n]=new Date,a.endPosition.x=0,a.endPosition.y=u,Q.clone(a.endPosition,s.endPosition),s.valid=!0,r[n]=!1},Dn.WHEEL,t)}function kS(e,t,n){let i=Os(n,t),o=e._isDown,r=e._eventStartPosition,a=e._pressTime;o[i]=!1,r[i]=new Q;let s=e._lastMovement[i];l(s)||(s=e._lastMovement[i]={startPosition:new Q,endPosition:new Q,valid:!1});let c,u;n===oo.LEFT_DRAG?(c=Dn.LEFT_DOWN,u=Dn.LEFT_UP):n===oo.RIGHT_DRAG?(c=Dn.RIGHT_DOWN,u=Dn.RIGHT_UP):n===oo.MIDDLE_DRAG&&(c=Dn.MIDDLE_DOWN,u=Dn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,s.valid=!1,o[i]=!0,a[i]=new Date,Q.clone(f.position,r[i])},c,t),e._eventHandler.setInputAction(function(){yee(Os(n,void 0),e);for(let f of Object.values(ac)){let h=Os(n,f);yee(h,e)}},u,t)}function yee(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 gSe(e,t){Q.clone(e.startPosition,t.startPosition),Q.clone(e.endPosition,t.endPosition)}function ZTt(e,t,n){let i=n._isDown,o=!1,r=Os(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==r&&(o=!0,yee(c,n));if(!o)return;let a=n._pressTime,s=n._lastMovement[r];l(s)||(s=n._lastMovement[r]={startPosition:new Q,endPosition:new Q,valid:!1}),n._buttonsDown++,s.valid=!1,i[r]=!0,a[r]=new Date}function _Se(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let a in oo)if(oo.hasOwnProperty(a)){let s=oo[a];if(l(s)){let c=Os(s,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new Q,endPosition:new Q,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new Q,endPosition:new Q})}}e._eventHandler.setInputAction(function(a){for(let s in oo)if(oo.hasOwnProperty(s)){let c=oo[s];if(l(c)){let u=Os(c,t);ZTt(c,t,e),r[u]&&(n[u]?(gSe(i[u],o[u]),o[u].valid=!0,gSe(a,i[u]),n[u]=!1):Q.clone(a.endPosition,i[u].endPosition))}}Q.clone(a.endPosition,e._currentMousePosition)},Dn.MOUSE_MOVE,t)}function zd(e){this._eventHandler=new Ld(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new Q,ASe(this,void 0),pSe(this,void 0,e),kS(this,void 0,oo.LEFT_DRAG),kS(this,void 0,oo.RIGHT_DRAG),kS(this,void 0,oo.MIDDLE_DRAG),_Se(this,void 0);for(let t in ac)if(ac.hasOwnProperty(t)){let n=ac[t];l(n)&&(ASe(this,n),pSe(this,n,e),kS(this,n,oo.LEFT_DRAG),kS(this,n,oo.RIGHT_DRAG),kS(this,n,oo.MIDDLE_DRAG),_Se(this,n))}}Object.defineProperties(zd.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Os(oo.WHEEL)]||!this._update[Os(oo.WHEEL,ac.SHIFT)]||!this._update[Os(oo.WHEEL,ac.CTRL)]||!this._update[Os(oo.WHEEL,ac.ALT)];return this._buttonsDown>0||e}}});zd.prototype.isMoving=function(e,t){let n=Os(e,t);return!this._update[n]};zd.prototype.getMovement=function(e,t){let n=Os(e,t);return this._movement[n]};zd.prototype.getLastMovement=function(e,t){let n=Os(e,t),i=this._lastMovement[n];if(i.valid)return i};zd.prototype.isButtonDown=function(e,t){let n=Os(e,t);return this._isDown[n]};zd.prototype.getStartMousePosition=function(e,t){if(e===oo.WHEEL)return this._currentMousePosition;let n=Os(e,t);return this._eventStartPosition[n]};zd.prototype.getButtonPressTime=function(e,t){let n=Os(e,t);return this._pressTime[n]};zd.prototype.getButtonReleaseTime=function(e,t){let n=Os(e,t);return this._releaseTime[n]};zd.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};zd.prototype.isDestroyed=function(){return!1};zd.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),fe(this)};var r4=zd;function a4(e,t,n,i,o,r,a,s,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ye(n),this._stopObject=Ye(i),this._duration=o,this._delay=r,this._easingFunction=a,this._update=s,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(a4.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}}});a4.prototype.cancelTween=function(){this._tweens.remove(this)};function am(){this._tweens=[]}Object.defineProperties(am.prototype,{length:{get:function(){return this._tweens.length}}});am.prototype.add=function(e){if(e=e??V.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new a4(this);let t=e.duration/ci.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/ci.SECONDS_PER_MILLISECOND,o=e.easingFunction??Pa.LINEAR_NONE,r=e.startObject,a=new b0e(r);a.to(Ye(e.stopObject),t),a.delay(i),a.easing(o),l(e.update)&&a.onUpdate(function(){e.update(r)}),a.onComplete(e.complete??null),a.repeat(e._repeat??0);let s=new a4(this,a,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(s),s};am.prototype.addProperty=function(e){e=e??V.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(a){t[n]=a.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})};am.prototype.addAlpha=function(e){e=e??V.EMPTY_OBJECT;let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let a=0;a<r;++a)t.uniforms[n[a]].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})};am.prototype.addOffsetIncrement=function(e){e=e??V.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};am.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};am.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};am.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};am.prototype.get=function(e){return this._tweens[e]};am.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/ci.SECONDS_PER_MILLISECOND:ki();n<t.length;){let i=t[n],o=i.tweenjs;if(i.needsStart)i.needsStart=!1,o.start(e);else if(o.update(e))n++;else{if(t[n]?.needsStart)continue;o.stop(),t.splice(n,1)}}};var US=am;function yC(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=oo.LEFT_DRAG,this.zoomEventTypes=[oo.RIGHT_DRAG,oo.WHEEL,oo.PINCH],this.rotateEventTypes=oo.LEFT_DRAG,this.tiltEventTypes=[oo.MIDDLE_DRAG,oo.PINCH,{eventType:oo.LEFT_DRAG,modifier:ac.CTRL},{eventType:oo.RIGHT_DRAG,modifier:ac.CTRL}],this.lookEventTypes={eventType:oo.LEFT_DRAG,modifier:ac.SHIFT};let t=e.ellipsoid??te.default;this.minimumPickingTerrainHeight=te.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=te.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=te.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=te.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new r4(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 US,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Q(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new Q(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new Q,this._strafeEndMousePosition=new Q,this._zoomMouseStart=new Q(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new Q,this._panLastWorldPosition=new d,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new me(Math.PI,D.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function $Tt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function eSt(e){return Q.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var tSt=.4;function nSt(e,t,n,i,o,r,a){let s=r[a];l(s)||(s=r[a]={startPosition:new Q,endPosition:new Q,motion:new Q,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<tSt){let A=$Tt(p,i),m=e.getLastMovement(t,n);if(!l(m)||eSt(m)||!s.inertiaEnabled||(s.motion.x=(m.endPosition.x-m.startPosition.x)*.5,s.motion.y=(m.endPosition.y-m.startPosition.y)*.5,s.startPosition=Q.clone(m.startPosition,s.startPosition),s.endPosition=Q.multiplyByScalar(s.motion,A,s.endPosition),s.endPosition=Q.add(s.startPosition,s.endPosition,s.endPosition),isNaN(s.endPosition.x)||isNaN(s.endPosition.y)||Q.distance(s.startPosition,s.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let _=e.getStartMousePosition(t,n);o(r,_,s)}}}function iSt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var ySe=[];function kl(e,t,n,i,o,r){if(!l(n))return;let a=e._aggregator;Array.isArray(n)||(ySe[0]=n,n=ySe);let s=n.length;for(let c=0;c<s;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,h=u.modifier,p=a.isMoving(f,h)&&a.getMovement(f,h),A=a.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,A,p),iSt(e,r)):o<1&&nSt(a,f,h,o,i,e,r))}}var s4=new In,oSt=new d,rSt=new Q,aSt=new d,sSt=new Q,cSt=new d,lSt=new d,uSt=new d,fSt=new d,vSe=new d,dSt=new d,hSt=new d,mSt=new d,pSt=new d,ASt=new d,gSt=new d,_St=new d,ySt=new d,CSt=new d,ESt=new d,$0=new d,CSe=new d,ESe=new d,Cee={orientation:new Rc};function Dee(e,t,n,i,o,r){let a=1;l(r)&&(a=D.clamp(Math.abs(r),.25,1));let s=n.endPosition.y-n.startPosition.y,u=s>0?e.minimumZoomDistance*a:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let A=s/e._scene.canvas.clientHeight;A=Math.min(A,e.maximumMovementRatio);let m=p*A;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let _=e._scene,y=_.camera,C=_.mode,E=Cee.orientation;E.heading=y.heading,E.pitch=y.pitch,E.roll=y.roll;let I=n.inertiaEnabled??Q.equals(t,e._zoomMouseStart),x=e._zoomingOnVector,S=e._rotatingZoom,w;if(I||(e._zoomMouseStart=Q.clone(t,e._zoomMouseStart),l(e._globe)&&C===oe.SCENE2D?(w=y.getPickRay(t,s4).origin,w=d.fromElements(w.y,w.z,w.x)):l(e._globe)&&(w=xg(e,t,oSt)),l(w)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(w,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,x=e._zoomingOnVector=!1,S=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){y.zoomIn(m);return}let v=C===oe.COLUMBUS_VIEW;if(y.positionCartographic.height<2e6&&(S=!0),!I||S){if(C===oe.SCENE2D){let R=e._zoomWorldPosition,N=y.position;if(!d.equals(R,N)&&y.positionCartographic.height<e._maxCoord.x*2){let L=y.position.x,g=d.subtract(R,N,aSt);d.normalize(g,g);let b=d.distance(R,N)*m/(y.getMagnitude()*.5);y.move(g,b*.5),(y.position.x<0&&L>0||y.position.x>0&&L<0)&&(w=y.getPickRay(t,s4).origin,w=d.fromElements(w.y,w.z,w.x),e._zoomWorldPosition=d.clone(w,e._zoomWorldPosition))}}else if(C===oe.SCENE3D){let R=d.normalize(y.position,vSe);if(e._cameraUnderground||e._zoomingUnderground||y.positionCartographic.height<3e3&&Math.abs(d.dot(y.direction,R))<.6)v=!0;else{let N=_.canvas,L=sSt;L.x=N.clientWidth/2,L.y=N.clientHeight/2;let g=xg(e,L,cSt);if(!l(g))v=!0;else if(y.positionCartographic.height<1e6)if(d.dot(y.direction,R)>=-.5)v=!0;else{let b=hSt;d.clone(y.position,b);let T=e._zoomWorldPosition,B=dSt;if(B=d.normalize(T,B),d.dot(B,R)<0)return;let M=ESt,O=ASt;d.clone(y.direction,O),d.add(b,d.multiplyByScalar(O,1e3,$0),M);let G=gSt,k=_St;d.subtract(T,b,G),d.normalize(G,k);let z=d.dot(R,k);if(z>=0){e._zoomMouseStart.x=-1;return}let F=Math.acos(-z),H=d.magnitude(b),Y=d.magnitude(T),$=H-m,W=d.magnitude(G),K=Math.asin(D.clamp(W/Y*Math.sin(F),-1,1)),Z=Math.asin(D.clamp($/Y*Math.sin(F),-1,1)),pe=K-Z+F,ge=mSt;d.normalize(b,ge);let re=pSt;re=d.cross(k,ge,re),re=d.normalize(re,re),d.normalize(d.cross(ge,re,$0),O),d.multiplyByScalar(d.normalize(M,$0),d.magnitude(M)-m,M),d.normalize(b,b),d.multiplyByScalar(b,$,b);let ye=ySt;d.multiplyByScalar(d.add(d.multiplyByScalar(ge,Math.cos(pe)-1,CSe),d.multiplyByScalar(O,Math.sin(pe),ESe),$0),$,ye),d.add(b,ye,b),d.normalize(M,ge),d.normalize(d.cross(ge,re,$0),O);let Ce=CSt;d.multiplyByScalar(d.add(d.multiplyByScalar(ge,Math.cos(pe)-1,CSe),d.multiplyByScalar(O,Math.sin(pe),ESe),$0),d.magnitude(M),Ce),d.add(M,Ce,M),d.clone(b,y.position),d.normalize(d.subtract(M,b,$0),y.direction),d.clone(y.direction,y.direction),d.cross(y.direction,y.up,y.right),d.cross(y.right,y.direction,y.up),y.setView(Cee);return}else{let b=d.normalize(g,lSt),T=d.normalize(e._zoomWorldPosition,uSt),B=d.dot(T,b);if(B>0&&B<1){let M=D.acosClamped(B),O=d.cross(T,b,fSt),G=Math.abs(M)>D.toRadians(20)?y.positionCartographic.height*.75:y.positionCartographic.height-m,k=m/G;y.rotate(O,M*k)}}}}e._rotatingZoom=!v}if(!I&&v||x){let R,N=co.worldToWindowCoordinates(_,e._zoomWorldPosition,rSt);C!==oe.COLUMBUS_VIEW&&Q.equals(t,e._zoomMouseStart)&&l(N)?R=y.getPickRay(N,s4):R=y.getPickRay(t,s4);let L=R.direction;(C===oe.COLUMBUS_VIEW||C===oe.SCENE2D)&&d.fromElements(L.y,L.z,L.x,L),y.move(L,m),e._zoomingOnVector=!0}else y.zoomIn(m);e._cameraUnderground||y.setView(Cee)}var ISt=new In,bSt=new In,xSt=new d;function TSt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,ISt).origin,a=o.getPickRay(n.endPosition,bSt).origin;r=d.fromElements(r.y,r.z,r.x,r),a=d.fromElements(a.y,a.z,a.x,a);let s=d.subtract(r,a,xSt),c=d.magnitude(s);c>0&&(d.normalize(s,s),o.move(s,c))}function Tee(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;Dee(e,t,n,e.zoomFactor,o.getMagnitude())}var SSt=new Q,wSt=new Q;function ISe(e,t,n){if(l(n.angleAndHeight)){BSt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,a=r.clientWidth,s=r.clientHeight,c=SSt;c.x=2/a*n.startPosition.x-1,c.y=2/s*(s-n.startPosition.y)-1,c=Q.normalize(c,c);let u=wSt;u.x=2/a*n.endPosition.x-1,u.y=2/s*(s-n.endPosition.y)-1,u=Q.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let h=D.acosClamped(u.x);u.y<0&&(h=D.TWO_PI-h);let p=h-f;o.twistRight(p)}function BSt(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,a=o.canvas,s=(n.endPosition.x-n.startPosition.x)/a.clientWidth;s=Math.min(s,e.maximumMovementRatio);let c=i*s*Math.PI*4;r.twistRight(c)}function DSt(e){let t=e._scene.mapMode2D===Bu.ROTATE;P.equals(P.IDENTITY,e._scene.camera.transform)?(kl(e,e.enableTranslate,e.translateEventTypes,TSt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),kl(e,e.enableZoom,e.zoomEventTypes,Tee,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&kl(e,e.enableRotate,e.tiltEventTypes,ISe,e.inertiaSpin,"_lastInertiaTiltMovement")):(kl(e,e.enableZoom,e.zoomEventTypes,Tee,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&kl(e,e.enableRotate,e.translateEventTypes,ISe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var PSe=new In,vSt=new d,PSt=new d;function xg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,a;if(i.pickPositionSupported&&(a=i.pickPositionWorldCoordinates(t,vSt)),!l(o))return d.clone(a,n);let s=!e._cameraUnderground,c=r.getPickRay(t,PSe),u=o.pickWorldCoordinates(c,i,s,PSt),f=l(a)?d.distance(a,r.positionWC):Number.POSITIVE_INFINITY,h=l(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(a,n):d.clone(u,n)}var RSt=new me;function m4(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let c=t.cartesianToCartographic(i.position,RSt);l(c)&&(r=c.height)}else r=i.position.z;let a=e._scene.globeHeight??0;return Math.abs(a-r)}var MSt=new d;function RSe(e,t){let n=t.origin,i=t.direction,o=m4(e),r=d.normalize(n,MSt),a=Math.abs(d.dot(r,i));return a=Math.max(a,.5)*2,o*a}function MSe(e,t,n,i){let o=d.distance(t.origin,n),r=m4(e),a=D.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>a&&(o=Math.min(o,r/5),o=Math.max(o,100)),In.getPoint(t,o,i)}function NSe(e,t,n,i){let o;return l(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=m4(e))):o=m4(e),In.getPoint(t,o,i)}var NSt=new Q;function LSe(e,t){let n=t.endPosition,i=Q.subtract(t.endPosition,t.startPosition,NSt),o=e._strafeEndMousePosition;Q.add(o,i,o),t.endPosition=o,vee(e,t,e._strafeStartPosition),t.endPosition=n}var bSe=new In,LSt=new In,Eee=new d,OSt=new d,FSt=new d,QSt=new d,kSt=new cn(d.UNIT_X,0),USt=new Q,zSt=new Q;function GSt(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Sf(e,t,n);return}if(e._strafing){LSe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,a=Q.clone(n.startPosition,USt),s=Q.clone(n.endPosition,zSt),c=o.getPickRay(a,bSe),u=d.clone(d.ZERO,QSt),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=xg(e,a,Eee),l(h)&&(u.x=h.x)),r||u.x>o.position.z&&l(h)){let I=h;r&&(I=NSe(e,c,h,Eee)),Q.clone(t,e._strafeMousePosition),Q.clone(t,e._strafeEndMousePosition),d.clone(I,e._strafeStartPosition),e._strafing=!0,vee(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(u,f,kSt);c=o.getPickRay(a,bSe);let A=di.rayPlane(c,p,Eee),m=o.getPickRay(s,LSt),_=di.rayPlane(m,p,OSt);if(!l(A)||!l(_)){e._looking=!0,Sf(e,t,n),Q.clone(t,e._translateMousePosition);return}let y=d.subtract(A,_,FSt),C=y.x;y.x=y.y,y.y=y.z,y.z=C;let E=d.magnitude(y);E>D.EPSILON6&&(d.normalize(y,y),o.move(y,E))}var OSe=new Q,u4=new In,f4=new d,VSt=new d,FSe=new P,HSt=new P,WSt=new d,jSt=new cn(d.UNIT_X,0),Iee=new d,See=new me,QSe=new P,YSt=new Qe,qSt=new J,d4=new d;function KSt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),Q.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Sf(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,XSt(e,t,n)):JSt(e,t,n)}function XSt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,a=OSe;a.x=r.clientWidth/2,a.y=r.clientHeight/2;let s=o.getPickRay(a,u4),c=d.UNIT_X,u=s.origin,f=s.direction,h,p=d.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(h=-d.dot(c,u)/p),!l(h)||h<=0){e._looking=!0,Sf(e,t,n),Q.clone(t,e._tiltCenterMousePosition);return}let A=d.multiplyByScalar(f,h,f4);d.add(u,A,A);let m=i.mapProjection,_=m.ellipsoid;d.fromElements(A.y,A.z,A.x,A);let y=m.unproject(A,See);_.cartographicToCartesian(y,A);let C=At.eastNorthUpToFixedFrame(A,_,FSe),E=e._globe,I=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let x=P.clone(o.transform,QSe);o._setTransform(C),Tf(e,t,n,d.UNIT_Z),o._setTransform(x),e._globe=E,e._ellipsoid=I;let S=I.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function JSt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,a,s,c=d.UNIT_X;if(Q.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,f4);else{if(o.position.z<e._minimumPickingTerrainHeight&&(a=xg(e,t,f4)),!l(a)){s=o.getPickRay(t,u4);let g=s.origin,b=s.direction,T,B=d.dot(c,b);if(Math.abs(B)>D.EPSILON6&&(T=-d.dot(c,g)/B),!l(T)||T<=0){e._looking=!0,Sf(e,t,n),Q.clone(t,e._tiltCenterMousePosition);return}a=d.multiplyByScalar(b,T,f4),d.add(g,a,a)}r&&(l(s)||(s=o.getPickRay(t,u4)),MSe(e,s,a,a)),Q.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let u=i.canvas,f=OSe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,s=o.getPickRay(f,u4);let h=d.clone(d.ZERO,WSt);h.x=a.x;let p=cn.fromPointNormal(h,c,jSt),A=di.rayPlane(s,p,VSt),m=o._projection,_=m.ellipsoid;d.fromElements(a.y,a.z,a.x,a);let y=m.unproject(a,See);_.cartographicToCartesian(y,a);let C=At.eastNorthUpToFixedFrame(a,_,FSe),E;l(A)?(d.fromElements(A.y,A.z,A.x,A),y=m.unproject(A,See),_.cartographicToCartesian(y,A),E=At.eastNorthUpToFixedFrame(A,_,HSt)):E=C;let I=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=d.UNIT_Z,w=P.clone(o.transform,QSe);o._setTransform(C);let v=d.cross(d.UNIT_Z,d.normalize(o.position,Iee),Iee),R=d.dot(o.right,v);if(Tf(e,t,n,S,!1,!0),o._setTransform(E),R<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(S=void 0);let b=o.constrainedAxis;o.constrainedAxis=void 0,Tf(e,t,n,S,!0,!1),o.constrainedAxis=b}else Tf(e,t,n,S,!0,!1);if(l(o.constrainedAxis)){let g=d.cross(o.direction,o.constrainedAxis,d4);d.equalsEpsilon(g,d.ZERO,D.EPSILON6)||(d.dot(g,o.right)<0&&d.negate(g,g),d.cross(g,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(w),e._globe=I,e._ellipsoid=x;let N=x.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let L=d.clone(o.positionWC,Iee);if(e.enableCollisionDetection&&Nee(e,!0),!d.equals(o.positionWC,L)){o._setTransform(E),o.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(o.position)>g&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(g),o.position));let b=d.angleBetween(L,o.position),T=d.cross(L,o.position,L);d.normalize(T,T);let B=Qe.fromAxisAngle(T,b,YSt),M=J.fromQuaternion(B,qSt);J.multiplyByVector(M,o.direction,o.direction),J.multiplyByVector(M,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(w)}}var kSe=new Q,USe=new In,zSe=new d;function GSe(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,a=e._cameraUnderground,s;a?s=t:(s=kSe,s.x=r.clientWidth/2,s.y=r.clientHeight/2);let c=o.getPickRay(s,USe),u=c.origin,f=c.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=xg(e,s,zSe));let A;if(l(p)&&(A=d.distance(u,p)),a){let m=RSe(e,c,h);l(A)?A=Math.min(A,m):A=m}if(!l(A)){let m=d.UNIT_X;A=-d.dot(m,u)/d.dot(m,f)}Dee(e,t,n,e.zoomFactor,A)}function ZSt(e){let n=e._scene.camera;if(!P.equals(P.IDENTITY,n.transform))kl(e,e.enableRotate,e.rotateEventTypes,Tf,e.inertiaSpin,"_lastInertiaSpinMovement"),kl(e,e.enableZoom,e.zoomEventTypes,Pee,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),kl(e,e.enableTilt,e.tiltEventTypes,KSt,e.inertiaSpin,"_lastInertiaTiltMovement"),kl(e,e.enableTranslate,e.translateEventTypes,GSt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),kl(e,e.enableZoom,e.zoomEventTypes,GSe,e.inertiaZoom,"_lastInertiaZoomMovement"),kl(e,e.enableLook,e.lookEventTypes,Sf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var $St=new In,ewt=new cn(d.UNIT_X,0),twt=new d,nwt=new d;function vee(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,$St),a=d.clone(o.direction,nwt);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(a.z,a.x,a.y,a);let s=cn.fromPointNormal(n,a,ewt),c=di.rayPlane(r,s,twt);l(c)&&(a=d.subtract(n,c,a),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(a.y,a.z,a.x,a),d.add(o.position,a,o.position))}var xSe=new d,VSe=new me,wee=new d,Bee=new te,iwt=new d,owt=new d,rwt=new d;function awt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,a=e._ellipsoid;if(!P.equals(o.transform,P.IDENTITY)){Tf(e,t,n);return}let s,c,u=a.geodeticSurfaceNormal(o.position,iwt);if(Q.equals(t,e._rotateMousePosition)){if(e._looking)Sf(e,t,n,u);else if(e._rotating)Tf(e,t,n);else if(e._strafing)LSe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;s=d.magnitude(e._rotateStartPosition),c=wee,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Bee),xee(e,t,n,a)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=a.cartesianToCartographic(o.positionWC,VSe).height,h=e._globe;if(l(h)&&f<e._minimumPickingTerrainHeight){let p=xg(e,n.startPosition,rwt);if(l(p)){let A=!1,m=o.getPickRay(n.startPosition,PSe);if(r)A=!0,NSe(e,m,p,p);else{let _=a.geodeticSurfaceNormal(p,owt);Math.abs(d.dot(m.direction,_))<.05?A=!0:A=d.magnitude(o.position)<d.magnitude(p)}A?(Q.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,vee(e,n,e._strafeStartPosition)):(s=d.magnitude(p),c=wee,c.x=c.y=c.z=s,a=te.fromCartesian3(c,Bee),xee(e,t,n,a),d.clone(p,e._rotateStartPosition))}else e._looking=!0,Sf(e,t,n,u)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,xSe))?(xee(e,t,n,e._ellipsoid),d.clone(xSe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Tf(e,t,n)):(e._looking=!0,Sf(e,t,n,u));Q.clone(t,e._rotateMousePosition)}function Tf(e,t,n,i,o,r){o=o??!1,r=r??!1;let a=e._scene,s=a.camera,c=a.canvas,u=s.constrainedAxis;l(i)&&(s.constrainedAxis=i);let f=d.magnitude(s.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,A=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),A=Math.min(A,e.maximumMovementRatio);let m=h*p*Math.PI*2,_=h*A*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let y=e.maximumTiltAngle,C=d.dot(s.direction,i),E=Math.PI-Math.acos(C)+_;E>y&&(_-=E-y)}o||s.rotateRight(m),r||s.rotateUp(_),s.constrainedAxis=u}var bee=ie.clone(ie.UNIT_W),TSe=ie.clone(ie.UNIT_W),c4=new d,zS=new d,l4=new d,SSe=new d,swt=new Q,cwt=new Q,lwt=new Q,uwt=new Q,fwt=new In;function xee(e,t,n,i){let o=e._scene,r=o.camera,a=Q.clone(n.startPosition,swt),s=Q.clone(n.endPosition,cwt),c=i.cartesianToCartographic(r.positionWC,VSe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,bee),!l(e._globe)&&!Q.equalsEpsilon(a,e._panLastMousePosition)&&(u=xg(e,a,bee)),!l(e._globe)&&l(u))){let h=d.subtract(u,r.positionWC,zS),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),zS),A=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,A,o.pixelRatio,uwt),_=Q.subtract(s,a,lwt),y=d.multiplyByScalar(r.rightWC,_.x*m.x,zS),C=d.normalize(r.positionWC,vSe),E=r.getPickRay(s,fwt).direction,I=d.subtract(E,d.projectVector(E,r.rightWC,l4),l4),x=d.angleBetween(I,r.directionWC),S=1;l(r.frustum.fov)&&(S=Math.max(Math.tan(x),.1));let w=Math.abs(d.dot(r.directionWC,C)),v=-_.y*m.y*2/Math.sqrt(S)*(1-w),R=d.multiplyByScalar(E,v,l4);w=Math.abs(d.dot(r.upWC,C));let N=d.multiplyByScalar(r.upWC,-_.y*(1-w)*m.y,SSe);f=d.add(u,y,TSe),f=d.add(f,R,f),f=d.add(f,N,f),d.clone(f,e._panLastWorldPosition),Q.clone(s,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=r.pickEllipsoid(a,i,bee),f=r.pickEllipsoid(s,i,TSe)),!l(u)||!l(f)){e._rotating=!0,Tf(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),l(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,c4);d.cross(p,h,p),d.normalize(p,p);let A=d.cross(h,p,zS),m=d.magnitude(u),_=d.dot(h,u),y=Math.acos(_/m),C=d.multiplyByScalar(h,_,l4);d.subtract(u,C,C),d.normalize(C,C);let E=d.magnitude(f),I=d.dot(h,f),x=Math.acos(I/E),S=d.multiplyByScalar(h,I,SSe);d.subtract(f,S,S),d.normalize(S,S);let w=Math.acos(d.dot(C,p));d.dot(C,A)<0&&(w=D.TWO_PI-w);let v=Math.acos(d.dot(S,p));d.dot(S,A)<0&&(v=D.TWO_PI-v);let R=w-v,N;d.equalsEpsilon(h,r.position,D.EPSILON2)?N=r.right:N=d.cross(h,r.position,c4);let L=d.cross(h,N,c4),g=d.dot(L,d.subtract(u,h,zS)),b=d.dot(L,d.subtract(f,h,zS)),T;g>0&&b>0?T=x-y:g>0&&b<=0?d.dot(r.position,h)>0?T=-y-x:T=y+x:T=y-x,r.rotateRight(R),r.rotateUp(T)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,c4);if(h<1&&!d.equalsEpsilon(p,d.ZERO,D.EPSILON14)){let A=Math.acos(h);r.rotate(p,A)}}}var dwt=new d,hwt=new me,wSe=0;function Pee(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,a=r.camera,s=r.canvas,c=e._cameraUnderground,u;c?u=t:(u=kSe,u.x=s.clientWidth/2,u.y=s.clientHeight/2);let f=a.getPickRay(u,USe),h,p=o.cartesianToCartographic(a.position,hwt).height,A=Math.abs(wSe)<e.minimumPickingTerrainDistanceWithInertia;(i?A:p<e._minimumPickingTerrainHeight)&&(h=xg(e,u,zSe));let _;if(l(h)&&(_=d.distance(f.origin,h)),!l(e._globe)&&l(_)&&a.getMagnitude()<_&&(h=void 0,_=void 0),l(_)&&(wSe=_),c){let C=RSe(e,f,p);l(_)?_=Math.min(_,C):_=C}l(_)||(_=p);let y=d.normalize(a.position,dwt);Dee(e,t,n,e.zoomFactor,_,d.dot(y,a.direction))}var HSe=new Q,h4=new In,gR=new d,mwt=new d,WSe=new P,pwt=new P,jSe=new P,Awt=new Qe,gwt=new J,Ree=new me,Mee=new d;function _wt(e,t,n){let o=e._scene.camera;if(!P.equals(o.transform,P.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),Q.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let s=e._ellipsoid.geodeticSurfaceNormal(o.position,Mee);Sf(e,t,n,s);return}let a=e._ellipsoid.cartesianToCartographic(o.position,Ree);e._tiltOnEllipsoid||a.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Cwt(e,t,n)):Ewt(e,t,n)}var ywt=new me;function Cwt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,a=e.minimumZoomDistance*.25,s=i.cartesianToCartographic(r.positionWC,ywt).height;if(s-a-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,u=HSe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=r.getPickRay(u,h4),h,p=di.rayEllipsoid(f,i);if(l(p))h=In.getPoint(f,p.start,gR);else if(s>e._minimumTrackBallHeight){let E=di.grazingAltitudeLocation(f,i);if(!l(E))return;let I=i.cartesianToCartographic(E,Ree);I.height=0,h=i.cartographicToCartesian(I,gR)}else{e._looking=!0;let E=e._ellipsoid.geodeticSurfaceNormal(r.position,Mee);Sf(e,t,n,E),Q.clone(t,e._tiltCenterMousePosition);return}let A=At.eastNorthUpToFixedFrame(h,i,WSe),m=e._globe,_=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let y=P.clone(r.transform,jSe);r._setTransform(A),Tf(e,t,n,d.UNIT_Z),r._setTransform(y),e._globe=m,e._ellipsoid=_;let C=_.maximumRadius;e._rotateFactor=1/C,e._rotateRateRangeAdjustment=C}function Ewt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,a=e._cameraUnderground,s,c,u;if(Q.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,gR);else{if(s=xg(e,t,gR),!l(s)){if(c=r.getPickRay(t,h4),u=di.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(r.position,Ree).height<=e._minimumTrackBallHeight){e._looking=!0;let b=e._ellipsoid.geodeticSurfaceNormal(r.position,Mee);Sf(e,t,n,b),Q.clone(t,e._tiltCenterMousePosition)}return}s=In.getPoint(c,u.start,gR)}a&&(l(c)||(c=r.getPickRay(t,h4)),MSe(e,c,s,s)),Q.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let f=o.canvas,h=HSe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,c=r.getPickRay(h,h4);let p=d.magnitude(s),A=d.fromElements(p,p,p,wee),m=te.fromCartesian3(A,Bee);if(u=di.rayEllipsoid(c,m),!l(u))return;let _=d.magnitude(c.origin)>p?u.start:u.stop,y=In.getPoint(c,_,mwt),C=At.eastNorthUpToFixedFrame(s,i,WSe),E=At.eastNorthUpToFixedFrame(y,m,pwt),I=e._globe,x=e._ellipsoid;e._globe=void 0,e._ellipsoid=te.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=d.UNIT_Z,w=P.clone(r.transform,jSe);r._setTransform(E);let v=d.cross(y,r.positionWC,d4);if(d.dot(r.rightWC,v)<0){let g=n.startPosition.y-n.endPosition.y;(a&&g<0||!a&&g>0)&&(S=void 0);let b=r.constrainedAxis;r.constrainedAxis=void 0,Tf(e,t,n,S,!0,!1),r.constrainedAxis=b}else Tf(e,t,n,S,!0,!1);if(r._setTransform(C),Tf(e,t,n,S,!1,!0),l(r.constrainedAxis)){let g=d.cross(r.direction,r.constrainedAxis,d4);d.equalsEpsilon(g,d.ZERO,D.EPSILON6)||(d.dot(g,r.right)<0&&d.negate(g,g),d.cross(g,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(w),e._globe=I,e._ellipsoid=x;let N=x.maximumRadius;e._rotateFactor=1/N,e._rotateRateRangeAdjustment=N;let L=d.clone(r.positionWC,d4);if(e.enableCollisionDetection&&Nee(e,!0),!d.equals(r.positionWC,L)){r._setTransform(E),r.worldToCameraCoordinatesPoint(L,L);let g=d.magnitudeSquared(L);d.magnitudeSquared(r.position)>g&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(g),r.position));let b=d.angleBetween(L,r.position),T=d.cross(L,r.position,L);d.normalize(T,T);let B=Qe.fromAxisAngle(T,b,Awt),M=J.fromQuaternion(B,gwt);J.multiplyByVector(M,r.direction,r.direction),J.multiplyByVector(M,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(w)}}var Iwt=new Q,bwt=new Q,BSe=new In,DSe=new In,xwt=new d,Twt=new d;function Sf(e,t,n,i){let r=e._scene.camera,a=Iwt;a.x=n.startPosition.x,a.y=0;let s=bwt;s.x=n.endPosition.x,s.y=0;let c=r.getPickRay(a,BSe),u=r.getPickRay(s,DSe),f=0,h,p;r.frustum instanceof An?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction);let A=d.dot(h,p);A<1&&(f=Math.acos(A)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?r.look(i,-f):l(m)?r.look(m,-f):r.lookLeft(f),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,c=r.getPickRay(a,BSe),u=r.getPickRay(s,DSe),f=0,r.frustum instanceof An?(h=c.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=c.direction,p=u.direction),A=d.dot(h,p),A<1&&(f=Math.acos(A)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let _=r.direction,y=d.negate(i,xwt),C=d.equalsEpsilon(_,i,D.EPSILON2),E=d.equalsEpsilon(_,y,D.EPSILON2);if(!C&&!E){A=d.dot(_,i);let I=D.acosClamped(A);f>0&&f>I&&(f=I-D.EPSILON4),A=d.dot(_,y),I=D.acosClamped(A),f<0&&-f>I&&(f=-I+D.EPSILON4);let x=d.cross(i,_,Twt);r.look(x,f)}else(C&&f<0||E&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Swt(e){kl(e,e.enableRotate,e.rotateEventTypes,awt,e.inertiaSpin,"_lastInertiaSpinMovement"),kl(e,e.enableZoom,e.zoomEventTypes,Pee,e.inertiaZoom,"_lastInertiaZoomMovement"),kl(e,e.enableTilt,e.tiltEventTypes,_wt,e.inertiaSpin,"_lastInertiaTiltMovement"),kl(e,e.enableLook,e.lookEventTypes,Sf)}var wwt=new P,Bwt=new me;function Nee(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=n.ellipsoid??te.WGS84,a=n.mapProjection,s,c;P.equals(o.transform,P.IDENTITY)||(s=P.clone(o.transform,wwt),c=d.magnitude(o.position),o._setTransform(P.IDENTITY));let u=Bwt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):a.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(l(h)){let p=h+e.minimumZoomDistance,A=h-e._lastGlobeHeight,m=A/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):a.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=A*.1}}l(s)&&(o._setTransform(s),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}yC.zoom2D=Tee;yC.zoomCV=GSe;yC.zoom3D=Pee;yC.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var Dwt=new d,vwt=new d;yC.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;P.equals(t.transform,P.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??te.default):(this._globe=void 0,this._ellipsoid=te.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=To.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=To.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=To.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let a=this._ellipsoid.maximumRadius;this._rotateFactor=1/a,this._rotateRateRangeAdjustment=a,this._adjustedHeightForTerrain=!1;let s=d.clone(t.positionWC,Dwt),c=d.clone(t.directionWC,vwt);if(i===oe.SCENE2D?DSt(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,ZSt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,Swt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(s,t.positionWC)||!d.equals(c,t.directionWC);Nee(this,u)}this._aggregator.reset()};yC.prototype.isDestroyed=function(){return!1};yC.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),fe(this)};var p4=yC;var A4=`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 g4=`uniform sampler2D colorTexture;
|
|
|
|
uniform float avgLuminance;
|
|
uniform float threshold;
|
|
uniform float offset;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
float key(float avg)
|
|
{
|
|
float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
|
|
return max(0.0, guess) + 0.1;
|
|
}
|
|
|
|
// See section 9. "The bright-pass filter" of Realtime HDR Rendering
|
|
// http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf
|
|
|
|
void main()
|
|
{
|
|
vec4 color = texture(colorTexture, v_textureCoordinates);
|
|
vec3 xyz = czm_RGBToXYZ(color.rgb);
|
|
float luminance = xyz.r;
|
|
|
|
float scaledLum = key(avgLuminance) * luminance / avgLuminance;
|
|
float brightLum = max(scaledLum - threshold, 0.0);
|
|
float brightness = brightLum / (offset + brightLum);
|
|
|
|
xyz.r = brightness;
|
|
out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
|
|
}
|
|
`;function Tg(){this._sceneFramebuffer=new NS;let e=.125,t=new Array(6);t[0]=new Oo({fragmentShader:bf,textureScale:e,forcePowerOfTwo:!0,sampleMode:Qd.LINEAR});let n=t[1]=new Oo({fragmentShader:g4,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new Q,t[2]=new Oo({fragmentShader:Y0,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 Oo({fragmentShader:Y0,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 Oo({fragmentShader:bf,sampleMode:Qd.LINEAR}),this._uCenter=new Q,this._uRadius=void 0,t[5]=new Oo({fragmentShader:A4,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new xf({stages:t});let o=new QS(this),r=t.length;for(let a=0;a<r;++a)t[a]._textureCache=o;this._textureCache=o,this.length=t.length}Tg.prototype.get=function(e){return this._stages.get(e)};Tg.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 Pwt=new ie,YSe=new Q,Rwt=new Q,qSe=new P;function Mwt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,a=i.viewProjection,s=i.projection,c=P.computeViewportTransformation(n,0,1,qSe),u=P.multiplyByPoint(r,o,Pwt),f=At.pointToGLWindowCoordinates(a,c,o,YSe);u.x+=D.SOLAR_RADIUS;let h=At.pointToGLWindowCoordinates(s,c,u,u),p=Q.magnitude(Q.subtract(h,f,h))*30*2,A=Rwt;A.x=p,A.y=p,e._uCenter=Q.clone(f,e._uCenter),e._uRadius=Math.max(A.x,A.y)*.15;let m=t.drawingBufferWidth,_=t.drawingBufferHeight,y=e._stages,C=y.get(0),E=C.outputTexture.width,I=C.outputTexture.height,x=new et;x.width=E,x.height=I,c=P.computeViewportTransformation(x,0,1,qSe),f=At.pointToGLWindowCoordinates(a,c,o,YSe),A.x*=E/m,A.y*=I/_;let S=C.scissorRectangle;S.x=Math.max(f.x-A.x*.5,0),S.y=Math.max(f.y-A.y*.5,0),S.width=Math.min(A.x,m),S.height=Math.min(A.y,_);for(let w=1;w<4;++w)et.clone(S,y.get(w).scissorRectangle)}Tg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Tg.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),Mwt(this,t,n),o};Tg.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)};Tg.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(bf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Tg.prototype.isDestroyed=function(){return!1};Tg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),fe(this)};var _4=Tg;function KSe(){this._cachedShowFrustumsShaders={}}function Nwt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Lwt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=We.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let a=r.length,s="";s+=`uniform vec3 debugShowCommandsColor;
|
|
`,s+=`uniform vec3 debugShowFrustumsColor;
|
|
`,s+=`void main()
|
|
{
|
|
czm_Debug_main();
|
|
`;let c;if(a>0)for(c=0;c<a;++c)s+=` out_FragData_${r[c]}.rgb *= debugShowCommandsColor;
|
|
`,s+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor;
|
|
`;else s+=` out_FragColor.rgb *= debugShowCommandsColor;
|
|
`,s+=` out_FragColor.rgb *= debugShowFrustumsColor;
|
|
`;s+="}",o.sources.push(s);let u=Nwt(i);return $t.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var _R=new U;function Owt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=U.fromRandom()),t._debugColor):U.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(_R.red=t.debugOverlappingFrustums&1?1:0,_R.green=t.debugOverlappingFrustums&2?1:0,_R.blue=t.debugOverlappingFrustums&4?1:0,_R.alpha=1,_R):U.WHITE}),n}var Fwt=new it;KSe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=Lwt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=it.shallowClone(t,Fwt);r.shaderProgram=o,r.uniformMap=Owt(e,t),r.execute(e.context,n)};var y4=KSe;function eI(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}eI.fromKeyframeNode=function(e,t,n,i){let o=new eI(e,t,n),{spatialNode:r,content:a}=i;return o._metadata=Qwt(e,a,n),o._orientedBoundingBox=Uwt(e,r,n,o._orientedBoundingBox),o};function Qwt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,a={};for(let s=0;s<i.length;s++){let c=i[s],u=It.getComponentCount(o[s]),f=r[s].slice(n*u,(n+1)*u);a[c]=f}return a}var XSe=new d,kwt=new d;function Uwt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,a=Math.floor(n/r),s=n-a*r,c=Math.floor(s/o.x),u=s-c*o.x,f=d.fromElements(u,c,a,XSe),h=d.divideComponents(d.subtract(f,e._paddingBefore,XSe),e.dimensions,kwt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(eI.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()}}});eI.prototype.hasProperty=function(e){return l(this._metadata[e])};eI.prototype.getNames=function(){return Object.keys(this._metadata)};eI.prototype.getProperty=function(e){return this._metadata[e]};var C4=eI;function zwt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:a,maximumValues:s}=t._provider,c=o.length,u=l(a)&&l(s);n.addDefine("METADATA_COUNT",c,he.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,he.FRAGMENT);for(let g=0;g<c;g++){let b=i[g],T=E4(o[g]),B=`PropertyStatistics_${b}`,M=`PropertyStatistics_${b}`;n.addStruct(B,M,he.FRAGMENT),n.addStructField(B,T,"min"),n.addStructField(B,T,"max")}let f="MetadataStatistics",h="MetadataStatistics",p="metadataStatistics";n.addStruct(f,h,he.FRAGMENT);for(let g=0;g<c;g++){let b=i[g],T=`PropertyStatistics_${b}`,B=b;n.addStructField(f,T,B)}let A="Metadata",m="Metadata",_="metadata";n.addStruct(A,m,he.FRAGMENT);for(let g=0;g<c;g++){let b=E4(o[g]);n.addStructField(A,b,i[g])}let y="Attributes",C="Attributes",E="attributes";n.addStruct(y,C,he.FRAGMENT),n.addStructField(y,"vec3","positionEC"),n.addStructField(y,"vec3","normalEC");let I="Voxel",x="Voxel",S="voxel";n.addStruct(I,x,he.FRAGMENT),n.addStructField(I,"vec3","viewDirUv"),n.addStructField(I,"float","travelDistance"),n.addStructField(I,"int","stepCount"),n.addStructField(I,"int","tileIndex"),n.addStructField(I,"int","sampleIndex"),n.addStructField(I,"float","distanceToDepthBuffer");let w="FragmentInput";n.addStruct(w,"FragmentInput",he.FRAGMENT),n.addStructField(w,h,p),n.addStructField(w,m,_),n.addStructField(w,C,E),n.addStructField(w,x,S);let R="Properties",N="Properties",L="properties";n.addStruct(R,N,he.FRAGMENT);for(let g=0;g<c;g++){let b=E4(o[g]);n.addStructField(R,b,i[g])}{let g="clearProperties";n.addFunction(g,`${N} clearProperties()`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=E4(o[b],r[b]);n.addFunctionLines(g,[`${L}.${i[b]} = ${T}(0.0);`])}n.addFunctionLines(g,[`return ${L};`])}{let g="sumProperties";n.addFunction(g,`${N} sumProperties(${N} propertiesA, ${N} propertiesB)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=i[b];n.addFunctionLines(g,[`${L}.${T} = propertiesA.${T} + propertiesB.${T};`])}n.addFunctionLines(g,[`return ${L};`])}{let g="scaleProperties";n.addFunction(g,`${N} scaleProperties(${N} ${L}, float scale)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} scaledProperties = ${L};`]);for(let b=0;b<c;b++)n.addFunctionLines(g,[`scaledProperties.${i[b]} *= scale;`]);n.addFunctionLines(g,["return scaledProperties;"])}{let g="mixProperties";n.addFunction(g,`${N} mixProperties(${N} propertiesA, ${N} propertiesB, float mixFactor)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=i[b];n.addFunctionLines(g,[`${L}.${T} = mix(propertiesA.${T}, propertiesB.${T}, mixFactor);`])}n.addFunctionLines(g,[`return ${L};`])}{let g="copyPropertiesToMetadata";n.addFunction(g,`void copyPropertiesToMetadata(in ${N} ${L}, inout ${m} ${_})`,he.FRAGMENT);for(let b=0;b<c;b++){let T=i[b];n.addFunctionLines(g,[`${_}.${T} = ${L}.${T};`])}}if(u){let g="setStatistics";n.addFunction(g,`void setStatistics(inout ${h} ${p})`,he.FRAGMENT);for(let b=0;b<c;b++){let T=i[b],B=o[b],M=It.getComponentCount(B);for(let O=0;O<M;O++){let G=Vwt(B,O),k=a[b][O],z=s[b][O];!l(k)||!l(z)||n.addFunctionLines(g,[`${p}.${T}.min${G} = ${JSe(k)};`,`${p}.${T}.max${G} = ${JSe(z)};`])}}}{let g="getPropertiesFromMegatextureAtUv";n.addFunction(g,`${N} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,he.FRAGMENT),n.addFunctionLines(g,[`${N} ${L};`]);for(let b=0;b<c;b++){let T=o[b],B=r[b],M=Gwt(T,B);n.addFunctionLines(g,[`properties.${i[b]} = texture(u_megatextureTextures[${b}], texcoord)${M};`])}n.addFunctionLines(g,[`return ${L};`])}}function E4(e){if(e===It.SCALAR)return"float";if(e===It.VEC2)return"vec2";if(e===It.VEC3)return"vec3";if(e===It.VEC4)return"vec4"}function Gwt(e){if(e===It.SCALAR)return".r";if(e===It.VEC2)return".ra";if(e===It.VEC3)return".rgb";if(e===It.VEC4)return""}function JSe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function Vwt(e,t){return e===It.SCALAR?"":`[${t}]`}var I4=zwt;function sm(e){let{planes:t,modelMatrix:n=P.IDENTITY,unionClippingRegions:i=!1}=e??V.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=P.clone(n),this.planeAdded=new _e,this.planeRemoved=new _e,this._unionClippingRegions=i,this._testIntersection=i?ZSe:$Se,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function ZSe(e){return e===Xt.OUTSIDE}function $Se(e){return e===Xt.INSIDE}Object.defineProperties(sm.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?ZSe:$Se)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});sm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};sm.prototype.get=function(e){return this._planes[e]};function ewe(e,t){for(let n=0;n<e.length;++n)if(cn.equals(e[n],t))return n;return-1}sm.prototype.contains=function(e){return ewe(this._planes,e)!==-1};sm.prototype.remove=function(e){let t=this._planes,n=ewe(t,e);if(n===-1)return!1;e instanceof os&&(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 os&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};sm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof os&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var Hwt=new cn(d.fromElements(1,0,0),0);function Wwt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:a,distance:s}=Ywt(i[r],t,Hwt);n[o]=a.x,n[o+1]=a.y,n[o+2]=a.z,n[o+3]=s,o+=4}}var Lee=new ie,jwt=new d;function Ywt(e,t,n){let{normal:i,distance:o}=e,r=ie.fromElements(i.x,i.y,i.z,o,Lee),a=P.multiplyByVector(t,r,Lee),s=d.fromCartesian4(a,jwt);return a=ie.divideByScalar(a,d.magnitude(s),Lee),cn.fromCartesian4(a,n)}function twe(e,t){return t.x=Math.min(e,Nt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var qwt=new Q;sm.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let a=n.width*n.height;(a<i||i<.25*a)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let a=twe(i,qwt);a.y*=2,n=new vt({context:e.context,width:a.x,height:a.y,pixelFormat:Ke.RGBA,pixelDatatype:He.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(a.x*a.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;Wwt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};sm.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=twe(o,n);return r.y*=2,r};sm.prototype.isDestroyed=function(){return!1};sm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),fe(this)};var CC=sm;var b4=`struct Ray {
|
|
vec3 pos;
|
|
vec3 dir;
|
|
};
|
|
|
|
float minComponent(in vec3 v) {
|
|
return min(min(v.x, v.y), v.z);
|
|
}
|
|
|
|
float maxComponent(in vec3 v) {
|
|
return max(max(v.x, v.y), v.z);
|
|
}
|
|
`;var x4=`// See Intersection.glsl for the definition of intersectScene
|
|
// See IntersectionUtils.glsl for the definition of nextIntersection
|
|
// See convertLocalToBoxUv.glsl, convertLocalToCylinderUv.glsl, or convertLocalToEllipsoidUv.glsl
|
|
// for the definitions of convertLocalToShapeSpaceDerivative and getTileAndUvCoordinate.
|
|
// The appropriate functions are selected based on the VoxelPrimitive shape type,
|
|
// and added to the shader in Scene/VoxelRenderResources.js.
|
|
// See Octree.glsl for the definitions of TraversalData, SampleData,
|
|
// traverseOctreeFromBeginning, and traverseOctreeFromExisting
|
|
// See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture
|
|
|
|
#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
|
|
#if defined(PICKING_VOXEL)
|
|
#define ALPHA_ACCUM_MAX 0.1
|
|
#else
|
|
#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
|
|
#endif
|
|
|
|
uniform mat4 u_transformPositionViewToLocal;
|
|
uniform mat3 u_transformDirectionViewToLocal;
|
|
uniform vec3 u_cameraPositionLocal;
|
|
uniform vec3 u_cameraDirectionLocal;
|
|
uniform float u_stepSize;
|
|
|
|
#if defined(PICKING)
|
|
uniform vec4 u_pickColor;
|
|
#endif
|
|
|
|
vec3 getSampleSize(in int level) {
|
|
vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
|
|
vec3 sampleSizeUv = 1.0 / sampleCount;
|
|
return scaleShapeUvToShapeSpace(sampleSizeUv);
|
|
}
|
|
|
|
#define MINIMUM_STEP_SCALAR (0.02)
|
|
#define SHIFT_FRACTION (0.001)
|
|
|
|
/**
|
|
* Given a coordinate within a tile, and sample spacings along a ray through
|
|
* the coordinate, find the distance to the points where the ray entered and
|
|
* exited the voxel cell, along with the surface normals at those points.
|
|
* The surface normals are returned in shape space coordinates.
|
|
*/
|
|
RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
|
|
vec3 voxelCoord = tileUv * vec3(u_dimensions);
|
|
vec3 directions = sign(sampleSizeAlongRay);
|
|
vec3 positiveDirections = max(directions, 0.0);
|
|
vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
|
|
vec3 exitCoord = entryCoord + directions;
|
|
|
|
vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
|
|
float lastEntry = maxComponent(distanceFromEntry);
|
|
bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
|
|
vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
|
|
vec4 entry = vec4(entryNormal, lastEntry);
|
|
|
|
vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
|
|
float firstExit = minComponent(distanceToExit);
|
|
bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
|
|
vec3 exitNormal = vec3(isFirstExit) * directions;
|
|
vec4 exit = vec4(exitNormal, firstExit);
|
|
|
|
return RayShapeIntersection(entry, exit);
|
|
}
|
|
|
|
vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
|
|
vec3 gradient = viewRay.dir * jacobianT;
|
|
vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
|
|
|
|
RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
|
|
|
|
// Transform normal from shape space to Cartesian space to eye space
|
|
vec3 voxelNormal = jacobianT * voxelIntersection.entry.xyz;
|
|
voxelNormal = normalize(czm_normal * voxelNormal);
|
|
|
|
// Compare with the shape intersection, to choose the appropriate normal
|
|
vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
|
|
vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);
|
|
|
|
float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
|
|
float shift = fixedStep * SHIFT_FRACTION;
|
|
float dt = voxelIntersection.exit.w + shift;
|
|
if ((currentT + dt) > shapeIntersection.exit.w) {
|
|
// Stop at end of shape
|
|
dt = shapeIntersection.exit.w - currentT + shift;
|
|
}
|
|
float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);
|
|
|
|
return vec4(entry.xyz, stepSize);
|
|
}
|
|
|
|
vec2 packIntToVec2(int value) {
|
|
float shifted = float(value) / 255.0;
|
|
float lowBits = fract(shifted);
|
|
float highBits = floor(shifted) / 255.0;
|
|
return vec2(highBits, lowBits);
|
|
}
|
|
|
|
vec2 packFloatToVec2(float value) {
|
|
float lowBits = fract(value);
|
|
float highBits = floor(value) / 255.0;
|
|
return vec2(highBits, lowBits);
|
|
}
|
|
|
|
int getSampleIndex(in SampleData sampleData) {
|
|
// tileUv = 1.0 is a valid coordinate but sampleIndex = u_inputDimensions is not.
|
|
// (tileUv = 1.0 corresponds to the far edge of the last sample, at index = u_inputDimensions - 1).
|
|
// Clamp to [0, voxelDimensions - 0.5) to avoid numerical error before flooring
|
|
vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
|
|
vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
|
|
ivec3 sampleIndex = ivec3(floor(inputCoordinate));
|
|
// Convert to a 1D index for lookup in a 1D data array
|
|
return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
|
|
}
|
|
|
|
/**
|
|
* Compute the view ray at the current fragment, in the local coordinates of the shape.
|
|
*/
|
|
Ray getViewRayLocal() {
|
|
vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
vec3 origin;
|
|
vec3 direction;
|
|
if (czm_orthographicIn3D == 1.0) {
|
|
eyeCoordinates.z = 0.0;
|
|
origin = (u_transformPositionViewToLocal * eyeCoordinates).xyz;
|
|
direction = u_cameraDirectionLocal;
|
|
} else {
|
|
origin = u_cameraPositionLocal;
|
|
direction = u_transformDirectionViewToLocal * normalize(eyeCoordinates.xyz);
|
|
}
|
|
return Ray(origin, direction);
|
|
}
|
|
|
|
Ray getViewRayEC() {
|
|
vec4 eyeCoordinates = czm_windowToEyeCoordinates(gl_FragCoord);
|
|
vec3 viewPosEC = (czm_orthographicIn3D == 1.0)
|
|
? vec3(eyeCoordinates.xy, 0.0)
|
|
: vec3(0.0);
|
|
vec3 viewDirEC = normalize(eyeCoordinates.xyz);
|
|
return Ray(viewPosEC, viewDirEC);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
Ray viewRayLocal = getViewRayLocal();
|
|
Ray viewRayEC = getViewRayEC();
|
|
|
|
Intersections ix;
|
|
vec2 screenCoord = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1]
|
|
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayLocal, viewRayEC, ix);
|
|
// Exit early if the scene was completely missed.
|
|
if (shapeIntersection.entry.w == NO_HIT) {
|
|
discard;
|
|
}
|
|
|
|
float currentT = shapeIntersection.entry.w;
|
|
float endT = shapeIntersection.exit.w;
|
|
|
|
vec3 positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
|
|
TileAndUvCoordinate tileAndUv = getTileAndUvCoordinate(positionEC);
|
|
vec3 positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
|
|
mat3 jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
|
|
|
|
// Traverse the tree from the start position
|
|
TraversalData traversalData;
|
|
SampleData sampleDatas[SAMPLE_COUNT];
|
|
traverseOctreeFromBeginning(tileAndUv, traversalData, sampleDatas);
|
|
vec4 step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
|
|
|
|
FragmentInput fragmentInput;
|
|
#if defined(STATISTICS)
|
|
setStatistics(fragmentInput.metadataStatistics);
|
|
#endif
|
|
|
|
czm_modelMaterial materialOutput;
|
|
vec4 colorAccum = vec4(0.0);
|
|
|
|
for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
|
|
// Read properties from the megatexture based on the traversal state
|
|
Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
|
|
|
|
// Prepare the custom shader inputs
|
|
copyPropertiesToMetadata(properties, fragmentInput.metadata);
|
|
|
|
fragmentInput.attributes.positionEC = positionEC;
|
|
// Re-normalize normals: some shape intersections may have been scaled to encode positive/negative shapes
|
|
fragmentInput.attributes.normalEC = normalize(step.xyz);
|
|
|
|
fragmentInput.voxel.viewDirUv = viewRayLocal.dir;
|
|
|
|
fragmentInput.voxel.travelDistance = step.w;
|
|
fragmentInput.voxel.stepCount = stepCount;
|
|
fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
|
|
fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
|
|
fragmentInput.voxel.distanceToDepthBuffer = ix.distanceToDepthBuffer - currentT;
|
|
|
|
// Run the custom shader
|
|
fragmentMain(fragmentInput, materialOutput);
|
|
|
|
// Sanitize the custom shader output
|
|
vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
|
|
color.rgb = max(color.rgb, vec3(0.0));
|
|
color.a = clamp(color.a, 0.0, 1.0);
|
|
|
|
// Pre-multiplied alpha blend
|
|
colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
|
|
|
|
// Stop traversing if the alpha has been fully saturated
|
|
if (colorAccum.a > ALPHA_ACCUM_MAX) {
|
|
colorAccum.a = ALPHA_ACCUM_MAX;
|
|
break;
|
|
}
|
|
|
|
if (step.w == 0.0) {
|
|
// Shape is infinitely thin. The ray may have hit the edge of a
|
|
// foreground voxel. Step ahead slightly to check for more voxels
|
|
step.w = 0.001;
|
|
}
|
|
|
|
// Keep raymarching
|
|
currentT += step.w;
|
|
// Check if there's more intersections.
|
|
if (currentT > endT) {
|
|
#if (INTERSECTION_COUNT == 1)
|
|
break;
|
|
#else
|
|
shapeIntersection = nextIntersection(ix);
|
|
if (shapeIntersection.entry.w == NO_HIT) {
|
|
break;
|
|
} else {
|
|
// Found another intersection. Resume raymarching there
|
|
currentT = shapeIntersection.entry.w;
|
|
endT = shapeIntersection.exit.w;
|
|
}
|
|
#endif
|
|
}
|
|
positionEC = viewRayEC.pos + currentT * viewRayEC.dir;
|
|
tileAndUv = getTileAndUvCoordinate(positionEC);
|
|
positionLocal = viewRayLocal.pos + currentT * viewRayLocal.dir;
|
|
jacobianT = convertLocalToShapeSpaceDerivative(positionLocal);
|
|
|
|
// Traverse the tree from the current ray position.
|
|
// This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step.
|
|
traverseOctreeFromExisting(tileAndUv, traversalData, sampleDatas);
|
|
step = getStepSize(sampleDatas[0], viewRayLocal, shapeIntersection, jacobianT, currentT);
|
|
}
|
|
|
|
// Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1]
|
|
colorAccum.a /= ALPHA_ACCUM_MAX;
|
|
|
|
#if defined(PICKING)
|
|
// If alpha is 0.0 there is nothing to pick
|
|
if (colorAccum.a == 0.0) {
|
|
discard;
|
|
}
|
|
out_FragColor = u_pickColor;
|
|
#elif defined(PICKING_VOXEL)
|
|
// If alpha is 0.0 there is nothing to pick
|
|
if (colorAccum.a == 0.0) {
|
|
discard;
|
|
}
|
|
vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
|
|
vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0]));
|
|
out_FragColor = vec4(megatextureId, sampleIndex);
|
|
#else
|
|
out_FragColor = colorAccum;
|
|
#endif
|
|
}
|
|
`;var T4=`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 S4=`/* Intersection defines
|
|
#define INTERSECTION_COUNT ###
|
|
*/
|
|
|
|
#define NO_HIT (-czm_infinity)
|
|
#define INF_HIT (czm_infinity * 0.5)
|
|
|
|
struct RayShapeIntersection {
|
|
vec4 entry;
|
|
vec4 exit;
|
|
};
|
|
|
|
vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
|
|
{
|
|
if (intersect0.w == NO_HIT) {
|
|
return intersect1;
|
|
} else if (intersect1.w == NO_HIT) {
|
|
return intersect0;
|
|
}
|
|
return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
|
|
}
|
|
|
|
vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
|
|
{
|
|
return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
|
|
}
|
|
|
|
RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
|
|
{
|
|
bool missed = (intersect0.entry.w == NO_HIT) ||
|
|
(intersect1.entry.w == NO_HIT) ||
|
|
(intersect0.exit.w < intersect1.entry.w) ||
|
|
(intersect0.entry.w > intersect1.exit.w);
|
|
if (missed) {
|
|
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
return RayShapeIntersection(miss, miss);
|
|
}
|
|
|
|
vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
|
|
vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);
|
|
|
|
return RayShapeIntersection(entry, exit);
|
|
}
|
|
|
|
struct Intersections {
|
|
// Don't access these member variables directly - call the functions instead.
|
|
|
|
// Store an array of ray-surface intersections. Each intersection is composed of:
|
|
// .xyz for the surface normal at the intersection point
|
|
// .w for the T value
|
|
// The scale of the normal encodes the shape intersection type:
|
|
// length(intersection.xyz) = 1: positive shape entry
|
|
// length(intersection.xyz) = 2: positive shape exit
|
|
// length(intersection.xyz) = 3: negative shape entry
|
|
// length(intersection.xyz) = 4: negative shape exit
|
|
// INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,
|
|
// so we need twice as many to track ray-*surface* intersections
|
|
vec4 intersections[INTERSECTION_COUNT * 2];
|
|
float distanceToDepthBuffer;
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
// Maintain state for future nextIntersection calls
|
|
int index;
|
|
int surroundCount;
|
|
bool surroundIsPositive;
|
|
#endif
|
|
};
|
|
|
|
RayShapeIntersection getFirstIntersection(in Intersections ix)
|
|
{
|
|
return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
|
|
}
|
|
|
|
vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
|
|
{
|
|
float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
|
|
return vec4(intersection.xyz * scale, intersection.w);
|
|
}
|
|
|
|
// Use defines instead of real functions because WebGL1 cannot access array with non-constant index.
|
|
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
|
|
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
|
|
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
|
|
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
void initializeIntersections(inout Intersections ix) {
|
|
// Sort the intersections from min T to max T with bubble sort.
|
|
// Note: If this sorting function changes, some of the intersection test may
|
|
// need to be updated. Search for "bubble sort" to find those areas.
|
|
const int sortPasses = INTERSECTION_COUNT * 2 - 1;
|
|
for (int n = sortPasses; n > 0; --n) {
|
|
for (int i = 0; i < sortPasses; ++i) {
|
|
// The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to break early instead
|
|
if (i >= n) { break; }
|
|
|
|
vec4 intersect0 = ix.intersections[i + 0];
|
|
vec4 intersect1 = ix.intersections[i + 1];
|
|
|
|
bool inOrder = intersect0.w <= intersect1.w;
|
|
|
|
ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
|
|
ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
|
|
}
|
|
}
|
|
|
|
// Prepare initial state for nextIntersection
|
|
ix.index = 0;
|
|
ix.surroundCount = 0;
|
|
ix.surroundIsPositive = false;
|
|
}
|
|
#endif
|
|
|
|
#if (INTERSECTION_COUNT > 1)
|
|
RayShapeIntersection nextIntersection(inout Intersections ix) {
|
|
vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
|
|
RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);
|
|
|
|
const int passCount = INTERSECTION_COUNT * 2;
|
|
|
|
if (ix.index == passCount) {
|
|
return shapeIntersection;
|
|
}
|
|
|
|
for (int i = 0; i < passCount; ++i) {
|
|
// The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot
|
|
// loop with non-constant condition, so it has to continue instead.
|
|
if (i < ix.index) {
|
|
continue;
|
|
}
|
|
|
|
ix.index = i + 1;
|
|
|
|
surfaceIntersection = ix.intersections[i];
|
|
int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
|
|
bool currShapeIsPositive = intersectionType < 2;
|
|
bool enter = intersectionType % 2 == 0;
|
|
|
|
ix.surroundCount += enter ? +1 : -1;
|
|
ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
|
|
|
|
// entering positive or exiting negative
|
|
if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
|
|
shapeIntersection.entry = surfaceIntersection;
|
|
}
|
|
|
|
// exiting positive or entering negative after being inside positive
|
|
bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
|
|
bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
|
|
if (exitPositive || enterNegativeFromPositive) {
|
|
shapeIntersection.exit = surfaceIntersection;
|
|
|
|
// entry and exit have been found, so the loop can stop
|
|
if (exitPositive) {
|
|
// After exiting positive shape there is nothing left to intersect, so jump to the end index.
|
|
ix.index = passCount;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
return shapeIntersection;
|
|
}
|
|
#endif
|
|
|
|
// NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1
|
|
`;var w4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections,
|
|
// setIntersectionPair, INF_HIT, NO_HIT
|
|
|
|
/* intersectDepth defines (set in Scene/VoxelRenderResources.js)
|
|
#define DEPTH_INTERSECTION_INDEX ###
|
|
*/
|
|
|
|
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
|
|
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
|
|
float entry;
|
|
float exit;
|
|
if (logDepthOrDepth != 0.0) {
|
|
// Calculate how far the ray must travel before it hits the depth buffer.
|
|
vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
|
|
eyeCoordinateDepth /= eyeCoordinateDepth.w;
|
|
entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);
|
|
exit = +INF_HIT;
|
|
} else {
|
|
// There's no depth at this location.
|
|
entry = NO_HIT;
|
|
exit = NO_HIT;
|
|
}
|
|
ix.distanceToDepthBuffer = entry;
|
|
#if defined(DEPTH_TEST)
|
|
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit));
|
|
#endif
|
|
}
|
|
`;var B4=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT,
|
|
// NO_HIT, setShapeIntersection
|
|
|
|
/* Clipping plane defines (set in Scene/VoxelRenderResources.js)
|
|
#define CLIPPING_PLANES_UNION
|
|
#define CLIPPING_PLANES_COUNT
|
|
#define CLIPPING_PLANES_INTERSECTION_INDEX
|
|
*/
|
|
|
|
uniform sampler2D u_clippingPlanesTexture;
|
|
uniform mat4 u_clippingPlanesMatrix;
|
|
|
|
// Plane is in Hessian Normal Form
|
|
vec4 intersectPlane(in Ray ray, in vec4 plane) {
|
|
vec3 n = plane.xyz; // normal
|
|
float w = plane.w; // -dot(pointOnPlane, normal)
|
|
|
|
float a = dot(ray.pos, n);
|
|
float b = dot(ray.dir, n);
|
|
float t = -(w + a) / b;
|
|
|
|
return vec4(n, t);
|
|
}
|
|
|
|
#ifdef CLIPPING_PLANES
|
|
void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
|
|
vec4 backSide = vec4(-ray.dir, -INF_HIT);
|
|
vec4 farSide = vec4(ray.dir, +INF_HIT);
|
|
RayShapeIntersection clippingVolume;
|
|
|
|
#if (CLIPPING_PLANES_COUNT == 1)
|
|
// Union and intersection are the same when there's one clipping plane, and the code
|
|
// is more simplified.
|
|
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0);
|
|
vec4 intersection = intersectPlane(ray, planeUv);
|
|
bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
|
|
clippingVolume.entry = reflects ? backSide : intersection;
|
|
clippingVolume.exit = reflects ? intersection : farSide;
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
|
|
#elif defined(CLIPPING_PLANES_UNION)
|
|
vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
|
|
vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
|
|
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
|
|
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i);
|
|
vec4 intersection = intersectPlane(ray, planeUv);
|
|
if (dot(ray.dir, planeUv.xyz) > 0.0) {
|
|
firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
|
|
} else {
|
|
lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
|
|
}
|
|
}
|
|
clippingVolume.entry = backSide;
|
|
clippingVolume.exit = lastReflection;
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
|
|
clippingVolume.entry = firstTransmission;
|
|
clippingVolume.exit = farSide;
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
|
|
#else // intersection
|
|
vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
|
|
vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
|
|
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
|
|
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i);
|
|
vec4 intersection = intersectPlane(ray, planeUv);
|
|
if (dot(ray.dir, planeUv.xyz) > 0.0) {
|
|
lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
|
|
} else {
|
|
firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
|
|
}
|
|
}
|
|
if (lastTransmission.w < firstReflection.w) {
|
|
clippingVolume.entry = lastTransmission;
|
|
clippingVolume.exit = firstReflection;
|
|
} else {
|
|
clippingVolume.entry = vec4(-ray.dir, NO_HIT);
|
|
clippingVolume.exit = vec4(ray.dir, NO_HIT);
|
|
}
|
|
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
|
|
#endif
|
|
}
|
|
#endif
|
|
`;var yR=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,
|
|
// RayShapeIntersection
|
|
|
|
vec4 transformNormalToEC(in vec4 intersection) {
|
|
return vec4(normalize(czm_normal * intersection.xyz), intersection.w);
|
|
}
|
|
|
|
RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) {
|
|
return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit));
|
|
}
|
|
|
|
vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
|
|
float normalSign = positiveNormal ? 1.0 : -1.0;
|
|
vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;
|
|
|
|
vec2 position = ray.pos.xy;
|
|
vec2 direction = ray.dir.xy;
|
|
float approachRate = dot(direction, planeNormal);
|
|
float distance = -dot(position, planeNormal);
|
|
|
|
float t = (approachRate == 0.0)
|
|
? NO_HIT
|
|
: distance / approachRate;
|
|
|
|
return vec4(planeNormal, 0.0, t);
|
|
}
|
|
|
|
RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
|
|
{
|
|
vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
|
|
if (!hitFront) {
|
|
return RayShapeIntersection(intersection, farSide);
|
|
} else {
|
|
return RayShapeIntersection(-1.0 * farSide, intersection);
|
|
}
|
|
}
|
|
|
|
void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
|
|
{
|
|
intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false));
|
|
intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true));
|
|
}
|
|
|
|
bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
|
|
float normalSign = positiveNormal ? 1.0 : -1.0;
|
|
vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
|
|
vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
|
|
return dot(hit, planeDirection) > 0.0;
|
|
}
|
|
|
|
void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
|
|
vec4 intersection = intersectLongitude(ray, angle, true);
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true);
|
|
|
|
farSide = transformNormalToEC(farSide);
|
|
|
|
if (hitPositiveSide) {
|
|
intersection = transformNormalToEC(intersection);
|
|
intersections[0].entry = -1.0 * farSide;
|
|
intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w);
|
|
intersections[1].entry = intersection;
|
|
intersections[1].exit = farSide;
|
|
} else {
|
|
vec4 miss = vec4(normalize(czm_normal * ray.dir), NO_HIT);
|
|
intersections[0].entry = -1.0 * farSide;
|
|
intersections[0].exit = farSide;
|
|
intersections[1].entry = miss;
|
|
intersections[1].exit = miss;
|
|
}
|
|
}
|
|
|
|
RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
|
|
{
|
|
// Note: works for maxAngle > minAngle + pi, where the "regular wedge"
|
|
// is actually a negative volume.
|
|
// Compute intersections with the two planes.
|
|
// Normals will point toward the "outside" (negative space)
|
|
vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
|
|
vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);
|
|
|
|
// Choose intersection with smallest T as the "first", the other as "last"
|
|
// Note: first or last could be in the "shadow" wedge, beyond the tip
|
|
bool inOrder = intersect1.w <= intersect2.w;
|
|
vec4 first = inOrder ? intersect1 : intersect2;
|
|
vec4 last = inOrder ? intersect2 : intersect1;
|
|
|
|
bool firstIsAhead = first.w >= 0.0;
|
|
bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
|
|
bool exitFromInside = firstIsAhead == startedInsideFirst;
|
|
bool lastIsAhead = last.w > 0.0;
|
|
bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
|
|
bool enterFromOutside = lastIsAhead == startedOutsideLast;
|
|
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
|
|
if (exitFromInside && enterFromOutside) {
|
|
// Ray crosses both faces of negative wedge, exiting then entering the positive shape
|
|
return transformNormalsToEC(RayShapeIntersection(first, last));
|
|
} else if (!exitFromInside && enterFromOutside) {
|
|
// Ray starts inside wedge. last is in shadow wedge, and first is actually the entry
|
|
return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first));
|
|
} else if (exitFromInside && !enterFromOutside) {
|
|
// First intersection was in the shadow wedge, so last is actually the exit
|
|
return transformNormalsToEC(RayShapeIntersection(last, farSide));
|
|
} else { // !exitFromInside && !enterFromOutside
|
|
// Both intersections were in the shadow wedge
|
|
return transformNormalsToEC(RayShapeIntersection(miss, miss));
|
|
}
|
|
}
|
|
`;var D4=`// See IntersectionUtils.glsl for the definitions of Ray, RayShapeIntersection,
|
|
// NO_HIT, Intersections
|
|
|
|
/* Box defines (set in Scene/VoxelBoxShape.js)
|
|
#define BOX_INTERSECTION_INDEX ### // always 0
|
|
*/
|
|
|
|
uniform sampler2D u_renderBoundPlanesTexture;
|
|
|
|
RayShapeIntersection intersectBoundPlanes(in Ray ray) {
|
|
vec4 lastEntry = vec4(ray.dir, -INF_HIT);
|
|
vec4 firstExit = vec4(-ray.dir, +INF_HIT);
|
|
for (int i = 0; i < 6; i++) {
|
|
vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
|
|
vec4 intersection = intersectPlane(ray, boundPlane);
|
|
if (dot(ray.dir, boundPlane.xyz) < 0.0) {
|
|
lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
|
|
} else {
|
|
firstExit = intersection.w < firstExit.w ? intersection: firstExit;
|
|
}
|
|
}
|
|
|
|
if (lastEntry.w < firstExit.w) {
|
|
return RayShapeIntersection(lastEntry, firstExit);
|
|
} else {
|
|
return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
|
|
}
|
|
}
|
|
|
|
void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix)
|
|
{
|
|
RayShapeIntersection intersection = intersectBoundPlanes(rayEC);
|
|
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
|
|
}
|
|
`;var v4=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, Intersections,
|
|
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection,
|
|
// intersectIntersections
|
|
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
|
|
// intersectFlippedWedge, intersectRegularWedge
|
|
|
|
/* Cylinder defines (set in Scene/VoxelCylinderShape.js)
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF
|
|
#define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO
|
|
|
|
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX
|
|
#define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN
|
|
#define CYLINDER_INTERSECTION_INDEX_ANGLE
|
|
*/
|
|
|
|
// Cylinder uniforms
|
|
uniform vec2 u_cylinderRenderRadiusMinMax;
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
|
|
uniform vec2 u_cylinderRenderAngleMinMax;
|
|
#endif
|
|
|
|
uniform sampler2D u_renderBoundPlanesTexture;
|
|
|
|
RayShapeIntersection intersectBoundPlanes(in Ray ray) {
|
|
vec4 lastEntry = vec4(ray.dir, -INF_HIT);
|
|
vec4 firstExit = vec4(-ray.dir, +INF_HIT);
|
|
for (int i = 0; i < 2; i++) {
|
|
vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
|
|
vec4 intersection = intersectPlane(ray, boundPlane);
|
|
if (dot(ray.dir, boundPlane.xyz) < 0.0) {
|
|
lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
|
|
} else {
|
|
firstExit = intersection.w < firstExit.w ? intersection: firstExit;
|
|
}
|
|
}
|
|
|
|
if (lastEntry.w < firstExit.w) {
|
|
return RayShapeIntersection(lastEntry, firstExit);
|
|
} else {
|
|
return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Find the intersection of a ray with a right cylindrical surface of a given radius
|
|
* about the z-axis.
|
|
*/
|
|
RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
|
|
{
|
|
vec2 position = ray.pos.xy;
|
|
vec2 direction = ray.dir.xy;
|
|
|
|
float a = dot(direction, direction);
|
|
float b = dot(position, direction);
|
|
float c = dot(position, position) - radius * radius;
|
|
float determinant = b * b - a * c;
|
|
|
|
if (determinant < 0.0) {
|
|
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
return RayShapeIntersection(miss, miss);
|
|
}
|
|
|
|
determinant = sqrt(determinant);
|
|
float t1 = (-b - determinant) / a;
|
|
float t2 = (-b + determinant) / a;
|
|
float signFlip = convex ? 1.0 : -1.0;
|
|
vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);
|
|
vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);
|
|
// Return normals in eye coordinates
|
|
vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);
|
|
vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2);
|
|
|
|
return RayShapeIntersection(intersect1, intersect2);
|
|
}
|
|
|
|
/**
|
|
* Find the intersection of a ray with a right cylindrical solid of given
|
|
* radius and height bounds. NOTE: The shape is assumed to be convex.
|
|
*/
|
|
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius)
|
|
{
|
|
RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
|
|
RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);
|
|
return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
|
|
}
|
|
|
|
void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)
|
|
{
|
|
RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);
|
|
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
|
|
|
|
if (outerIntersect.entry.w == NO_HIT) {
|
|
return;
|
|
}
|
|
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
|
|
// When the cylinder is perfectly thin it's necessary to sandwich the
|
|
// inner cylinder intersection inside the outer cylinder intersection.
|
|
|
|
// Without this special case,
|
|
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
|
|
// [outerMin, innerMin, outerMax, innerMax] which will cause the back
|
|
// side of the cylinder to be invisible because it will think the ray
|
|
// is still inside the inner (negative) cylinder after exiting the
|
|
// outer (positive) cylinder.
|
|
|
|
// With this special case,
|
|
// [outerMin, innerMin, innerMax, outerMax] will bubble sort to
|
|
// [outerMin, innerMin, innerMax, outerMax] which will work correctly.
|
|
|
|
// Note: If initializeIntersections() changes its sorting function
|
|
// from bubble sort to something else, this code may need to change.
|
|
RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
|
|
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
|
|
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
|
|
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
|
|
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
|
|
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
|
|
RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
|
|
#endif
|
|
|
|
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
|
|
RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
|
|
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
|
|
RayShapeIntersection wedgeIntersects[2];
|
|
intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
|
|
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
|
|
RayShapeIntersection wedgeIntersects[2];
|
|
intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
|
|
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
|
|
#endif
|
|
}
|
|
`;var P4=`// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT, Intersections,
|
|
// RayShapeIntersection, setSurfaceIntersection, setShapeIntersection
|
|
// See IntersectLongitude.glsl for the definitions of intersectHalfPlane,
|
|
// intersectFlippedWedge, intersectRegularWedge
|
|
|
|
/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF
|
|
#define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE
|
|
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX
|
|
#define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN
|
|
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX
|
|
#define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN
|
|
*/
|
|
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
|
|
uniform vec2 u_ellipsoidRenderLongitudeMinMax;
|
|
#endif
|
|
uniform float u_eccentricitySquared;
|
|
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
|
|
uniform vec2 u_clipMinMaxHeight; // Values are negative: clipHeight - maxShapeHeight
|
|
|
|
RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
|
|
float t = -ray.pos.z / ray.dir.z;
|
|
|
|
bool startsOutside = sign(ray.pos.z) == sign(z);
|
|
bool entry = (t >= 0.0) != startsOutside;
|
|
|
|
vec4 intersect = vec4(0.0, 0.0, z, t);
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
if (entry) {
|
|
return RayShapeIntersection(intersect, farSide);
|
|
} else {
|
|
return RayShapeIntersection(-1.0 * farSide, intersect);
|
|
}
|
|
}
|
|
|
|
RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex)
|
|
{
|
|
// Scale the ray by the ellipsoid axes to make it a unit sphere
|
|
// Note: approximating ellipsoid + height as an ellipsoid
|
|
vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height);
|
|
vec3 position = ray.pos * radiiCorrection;
|
|
vec3 direction = ray.dir * radiiCorrection;
|
|
|
|
float a = dot(direction, direction); // ~ 1.0 (or maybe 4.0 if ray is scaled)
|
|
float b = dot(direction, position); // roughly inside [-1.0, 1.0] when zoomed in
|
|
float c = dot(position, position) - 1.0; // ~ 0.0 when zoomed in.
|
|
float determinant = b * b - a * c; // ~ b * b when zoomed in
|
|
|
|
if (determinant < 0.0) {
|
|
vec4 miss = vec4(normalize(direction), NO_HIT);
|
|
return RayShapeIntersection(miss, miss);
|
|
}
|
|
|
|
determinant = sqrt(determinant);
|
|
|
|
// Compute larger root using standard formula
|
|
float signB = b < 0.0 ? -1.0 : 1.0;
|
|
// The other root may suffer from subtractive cancellation in the standard formula.
|
|
// Compute it from the first root instead.
|
|
float t1 = (-b - signB * determinant) / a;
|
|
float t2 = c / (a * t1);
|
|
float tmin = min(t1, t2);
|
|
float tmax = max(t1, t2);
|
|
|
|
float directionScale = convex ? 1.0 : -1.0;
|
|
vec3 d1 = directionScale * (position + tmin * direction);
|
|
vec3 d2 = directionScale * (position + tmax * direction);
|
|
|
|
// Return normals in eye coordinates. Use spherical approximation for the normal.
|
|
vec3 normal1 = normalize(czm_normal * d1);
|
|
vec3 normal2 = normalize(czm_normal * d2);
|
|
|
|
return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax));
|
|
}
|
|
|
|
/**
|
|
* Given a circular cone around the z-axis, with apex at the origin,
|
|
* find the parametric distance(s) along a ray where that ray intersects
|
|
* the cone.
|
|
* The cone opening angle is described by the squared cosine of
|
|
* its half-angle (the angle between the Z-axis and the surface)
|
|
*/
|
|
vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
|
|
{
|
|
vec3 o = ray.pos;
|
|
vec3 d = ray.dir;
|
|
float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;
|
|
|
|
float aSin = d.z * d.z * sinSqrHalfAngle;
|
|
float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
|
|
float a = aSin + aCos;
|
|
|
|
float bSin = d.z * o.z * sinSqrHalfAngle;
|
|
float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
|
|
float b = bSin + bCos;
|
|
|
|
float cSin = o.z * o.z * sinSqrHalfAngle;
|
|
float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
|
|
float c = cSin + cCos;
|
|
// determinant = b * b - a * c. But bSin * bSin = aSin * cSin.
|
|
// Avoid subtractive cancellation by expanding to eliminate these terms
|
|
float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;
|
|
|
|
if (determinant < 0.0) {
|
|
return vec2(NO_HIT);
|
|
} else if (a == 0.0) {
|
|
// Ray is parallel to cone surface
|
|
return (b == 0.0)
|
|
? vec2(NO_HIT) // Ray is on cone surface
|
|
: vec2(-0.5 * c / b, NO_HIT);
|
|
}
|
|
|
|
determinant = sqrt(determinant);
|
|
|
|
// Compute larger root using standard formula
|
|
float signB = b < 0.0 ? -1.0 : 1.0;
|
|
float t1 = (-b - signB * determinant) / a;
|
|
// The other root may suffer from subtractive cancellation in the standard formula.
|
|
// Compute it from the first root instead.
|
|
float t2 = c / (a * t1);
|
|
float tmin = min(t1, t2);
|
|
float tmax = max(t1, t2);
|
|
return vec2(tmin, tmax);
|
|
}
|
|
|
|
/**
|
|
* Given a point on a conical surface, find the surface normal at that point.
|
|
*/
|
|
vec3 getConeNormal(in vec3 p, in bool convex) {
|
|
// Start with radial component pointing toward z-axis
|
|
vec2 radial = -abs(p.z) * normalize(p.xy);
|
|
// Z component points toward opening of cone
|
|
float zSign = (p.z < 0.0) ? -1.0 : 1.0;
|
|
float z = length(p.xy) * zSign;
|
|
// Flip normal if shape is convex
|
|
float flip = (convex) ? -1.0 : 1.0;
|
|
return normalize(vec3(radial, z) * flip);
|
|
}
|
|
|
|
/**
|
|
* Compute the shift between the ellipsoid origin and the apex of a cone of latitude
|
|
*/
|
|
float getLatitudeConeShift(in float sinLatitude) {
|
|
// Find prime vertical radius of curvature:
|
|
// the distance along the ellipsoid normal to the intersection with the z-axis
|
|
float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
|
|
float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2);
|
|
|
|
// Compute a shift from the origin to the intersection of the cone with the z-axis
|
|
return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
|
|
}
|
|
|
|
void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
|
|
// Shift the ray to account for the latitude cone not being centered at the Earth center
|
|
ray.pos.z += getLatitudeConeShift(cosHalfAngle);
|
|
|
|
float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
|
|
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
|
|
|
|
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
// Initialize output with no intersections
|
|
intersections[0].entry = -1.0 * farSide;
|
|
intersections[0].exit = farSide;
|
|
intersections[1].entry = miss;
|
|
intersections[1].exit = miss;
|
|
|
|
if (intersect.x == NO_HIT) {
|
|
return;
|
|
}
|
|
|
|
// Find the points of intersection
|
|
float tmin = intersect.x;
|
|
float tmax = intersect.y;
|
|
vec3 p0 = ray.pos + tmin * ray.dir;
|
|
vec3 p1 = ray.pos + tmax * ray.dir;
|
|
|
|
vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
|
|
vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);
|
|
|
|
bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
|
|
bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
|
|
|
|
if (p0InShadowCone && p1InShadowCone) {
|
|
// no valid intersections
|
|
} else if (p0InShadowCone) {
|
|
intersections[0].exit = intersect1;
|
|
} else if (p1InShadowCone) {
|
|
intersections[0].entry = intersect0;
|
|
} else {
|
|
intersections[0].exit = intersect0;
|
|
intersections[1].entry = intersect1;
|
|
intersections[1].exit = farSide;
|
|
}
|
|
}
|
|
|
|
RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
|
|
// Shift the ray to account for the latitude cone not being centered at the Earth center
|
|
ray.pos.z += getLatitudeConeShift(cosHalfAngle);
|
|
|
|
float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
|
|
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
|
|
|
|
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
|
|
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
|
|
|
|
if (intersect.x == NO_HIT) {
|
|
return RayShapeIntersection(miss, miss);
|
|
}
|
|
|
|
// Find the points of intersection
|
|
float tmin = intersect.x;
|
|
float tmax = intersect.y;
|
|
vec3 p0 = ray.pos + tmin * ray.dir;
|
|
vec3 p1 = ray.pos + tmax * ray.dir;
|
|
|
|
vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
|
|
vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);
|
|
|
|
bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
|
|
bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
|
|
|
|
if (p0InShadowCone && p1InShadowCone) {
|
|
return RayShapeIntersection(miss, miss);
|
|
} else if (p0InShadowCone) {
|
|
return RayShapeIntersection(intersect1, farSide);
|
|
} else if (p1InShadowCone) {
|
|
return RayShapeIntersection(-1.0 * farSide, intersect0);
|
|
} else {
|
|
return RayShapeIntersection(intersect0, intersect1);
|
|
}
|
|
}
|
|
|
|
void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { // Outer ellipsoid
|
|
RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
|
|
|
|
// Exit early if the outer ellipsoid was missed.
|
|
if (outerIntersect.entry.w == NO_HIT) {
|
|
return;
|
|
}
|
|
|
|
// Inner ellipsoid
|
|
RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
|
|
|
|
if (innerIntersect.entry.w == NO_HIT) {
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
|
|
} else {
|
|
// When the ellipsoid is large and thin it's possible for floating point math
|
|
// to cause the ray to intersect the inner ellipsoid before the outer ellipsoid.
|
|
// To prevent this from happening, clamp innerIntersect to outerIntersect and
|
|
// sandwich the inner ellipsoid intersection inside the outer ellipsoid intersection.
|
|
|
|
// Without this special case,
|
|
// [outerMin, outerMax, innerMin, innerMax] will bubble sort to
|
|
// [outerMin, innerMin, outerMax, innerMax] which will cause the back
|
|
// side of the ellipsoid to be invisible because it will think the ray
|
|
// is still inside the inner (negative) ellipsoid after exiting the
|
|
// outer (positive) ellipsoid.
|
|
|
|
// With this special case,
|
|
// [outerMin, innerMin, innerMax, outerMax] will bubble sort to
|
|
// [outerMin, innerMin, innerMax, outerMax] which will work correctly.
|
|
|
|
// Note: If initializeIntersections() changes its sorting function
|
|
// from bubble sort to something else, this code may need to change.
|
|
innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
|
|
innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
|
|
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true); // positive, enter
|
|
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true); // negative, enter
|
|
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false); // negative, exit
|
|
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false); // positive, exit
|
|
}
|
|
|
|
// Bottom cone
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
|
|
RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
|
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
|
|
RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
|
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
|
|
RayShapeIntersection bottomConeIntersections[2];
|
|
intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
|
|
#endif
|
|
|
|
// Top cone
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
|
|
RayShapeIntersection topConeIntersections[2];
|
|
intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
|
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
|
|
RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
|
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
|
|
RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
|
|
#endif
|
|
|
|
// Wedge
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
|
|
RayShapeIntersection wedgeIntersects[2];
|
|
intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
|
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
|
|
RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
|
|
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
|
|
RayShapeIntersection wedgeIntersects[2];
|
|
intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
|
|
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
|
|
#endif
|
|
}
|
|
`;var GS=`// Main intersection function for Voxel scenes.
|
|
// See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl
|
|
// for the definition of intersectShape. The appropriate function is selected
|
|
// based on the VoxelPrimitive shape type, and added to the shader in
|
|
// Scene/VoxelRenderResources.js.
|
|
// See also IntersectClippingPlane.glsl and IntersectDepth.glsl.
|
|
// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT,
|
|
// getFirstIntersection, initializeIntersections, nextIntersection.
|
|
|
|
/* Intersection defines (set in Scene/VoxelRenderResources.js)
|
|
#define INTERSECTION_COUNT ###
|
|
*/
|
|
|
|
RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) {
|
|
// Do a ray-shape intersection to find the exact starting and ending points.
|
|
intersectShape(ray, rayEC, ix);
|
|
|
|
// Exit early if the positive shape was completely missed or behind the ray.
|
|
RayShapeIntersection intersection = getFirstIntersection(ix);
|
|
if (intersection.entry.w == NO_HIT) {
|
|
// Positive shape was completely missed - so exit early.
|
|
return intersection;
|
|
}
|
|
|
|
// Clipping planes
|
|
#if defined(CLIPPING_PLANES)
|
|
intersectClippingPlanes(ray, ix);
|
|
#endif
|
|
|
|
// Depth
|
|
intersectDepth(screenCoord, rayEC, ix);
|
|
|
|
// Find the first intersection that's in front of the ray
|
|
#if (INTERSECTION_COUNT > 1)
|
|
initializeIntersections(ix);
|
|
for (int i = 0; i < INTERSECTION_COUNT; ++i) {
|
|
intersection = nextIntersection(ix);
|
|
if (intersection.exit.w > 0.0) {
|
|
// Set start to 0.0 when ray is inside the shape.
|
|
intersection.entry.w = max(intersection.entry.w, 0.0);
|
|
break;
|
|
}
|
|
}
|
|
#else
|
|
// Set start to 0.0 when ray is inside the shape.
|
|
intersection.entry.w = max(intersection.entry.w, 0.0);
|
|
#endif
|
|
|
|
return intersection;
|
|
}
|
|
`;var R4=`uniform vec3 u_boxLocalToShapeUvScale;
|
|
uniform vec3 u_boxLocalToShapeUvTranslate;
|
|
|
|
uniform ivec4 u_cameraTileCoordinates;
|
|
uniform vec3 u_cameraTileUv;
|
|
uniform mat3 u_boxEcToXyz;
|
|
|
|
mat3 convertLocalToShapeSpaceDerivative(in vec3 positionLocal) {
|
|
// For BOX, local space = shape space, so the Jacobian is the identity matrix.
|
|
return mat3(1.0);
|
|
}
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
return shapeUv / u_boxLocalToShapeUvScale;
|
|
}
|
|
|
|
vec3 convertEcToDeltaTile(in vec3 positionEC) {
|
|
vec3 dPosition = u_boxEcToXyz * positionEC;
|
|
return u_boxLocalToShapeUvScale * dPosition * float(1 << u_cameraTileCoordinates.w);
|
|
}
|
|
|
|
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
|
|
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
|
|
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
|
|
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
|
|
tileCoordinate = min(max(ivec3(0), tileCoordinate), ivec3((1 << u_cameraTileCoordinates.w) - 1));
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0);
|
|
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
|
|
}
|
|
`;var M4=`uniform vec2 u_cylinderLocalToShapeUvRadius; // x = scale, y = offset
|
|
uniform vec2 u_cylinderLocalToShapeUvHeight; // x = scale, y = offset
|
|
uniform vec2 u_cylinderLocalToShapeUvAngle; // x = scale, y = offset
|
|
uniform float u_cylinderShapeUvAngleRangeOrigin;
|
|
uniform mat3 u_cylinderEcToRadialTangentUp;
|
|
uniform ivec4 u_cameraTileCoordinates;
|
|
uniform vec3 u_cameraTileUv;
|
|
uniform vec3 u_cameraShapePosition; // (radial distance, angle, height) of camera in shape space
|
|
|
|
mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
|
|
vec3 radial = normalize(vec3(position.xy, 0.0));
|
|
vec3 z = vec3(0.0, 0.0, 1.0);
|
|
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
|
|
return mat3(radial, east / length(position.xy), z);
|
|
}
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
float radius = shapeUv.x / u_cylinderLocalToShapeUvRadius.x;
|
|
float angle = shapeUv.y * czm_twoPi / u_cylinderLocalToShapeUvAngle.x;
|
|
float height = shapeUv.z / u_cylinderLocalToShapeUvHeight.x;
|
|
|
|
return vec3(radius, angle, height);
|
|
}
|
|
|
|
/**
|
|
* Computes the change in polar coordinates given a change in position.
|
|
* @param {vec2} dPosition The change in position in Cartesian coordinates.
|
|
* @param {float} cameraRadialDistance The radial distance of the camera from the origin.
|
|
* @return {vec2} The change in polar coordinates (radial distance, angle).
|
|
*/
|
|
vec2 computePolarChange(in vec2 dPosition, in float cameraRadialDistance) {
|
|
float dAngle = atan(dPosition.y, cameraRadialDistance + dPosition.x);
|
|
// Find the direction of the radial axis at the output angle, in Cartesian coordinates
|
|
vec2 outputRadialAxis = vec2(cos(dAngle), sin(dAngle));
|
|
float sinHalfAngle = sin(dAngle / 2.0);
|
|
float versine = 2.0 * sinHalfAngle * sinHalfAngle;
|
|
float dRadial = dot(dPosition, outputRadialAxis) - cameraRadialDistance * versine;
|
|
return vec2(dRadial, dAngle);
|
|
}
|
|
|
|
vec3 convertEcToDeltaShape(in vec3 positionEC) {
|
|
// 1. Rotate to radial, tangent, and up coordinates
|
|
vec3 rtu = u_cylinderEcToRadialTangentUp * positionEC;
|
|
// 2. Compute change in angular and radial coordinates.
|
|
vec2 dPolar = computePolarChange(rtu.xy, u_cameraShapePosition.x);
|
|
return vec3(dPolar.xy, rtu.z);
|
|
}
|
|
|
|
vec3 convertEcToDeltaTile(in vec3 positionEC) {
|
|
vec3 deltaShape = convertEcToDeltaShape(positionEC);
|
|
// Convert to tileset coordinates in [0, 1]
|
|
float dx = u_cylinderLocalToShapeUvRadius.x * deltaShape.x;
|
|
float dy = deltaShape.y / czm_twoPi;
|
|
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
|
|
// Wrap to ensure dy is not crossing through the unoccupied angle range, where
|
|
// angle to tile coordinate conversions would be more complicated
|
|
float cameraUvAngle = (u_cameraShapePosition.y + czm_pi) / czm_twoPi;
|
|
float cameraUvAngleShift = fract(cameraUvAngle - u_cylinderShapeUvAngleRangeOrigin);
|
|
float rawOutputUvAngle = cameraUvAngleShift + dy;
|
|
float rotation = floor(rawOutputUvAngle);
|
|
dy -= rotation;
|
|
#endif
|
|
dy *= u_cylinderLocalToShapeUvAngle.x;
|
|
float dz = u_cylinderLocalToShapeUvHeight.x * deltaShape.z;
|
|
// Convert to tile coordinate changes
|
|
return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
|
|
}
|
|
|
|
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
|
|
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
|
|
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
|
|
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
|
|
int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
|
|
tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
|
|
tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
if (tileCoordinate.y < 0) {
|
|
tileCoordinate.y += (maxTileCoordinate + 1);
|
|
} else if (tileCoordinate.y > maxTileCoordinate) {
|
|
tileCoordinate.y -= (maxTileCoordinate + 1);
|
|
}
|
|
#else
|
|
tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
#endif
|
|
vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
|
|
tileUv.x = clamp(tileUv.x, 0.0, 1.0);
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
// If there is only one tile spanning 2*PI angle, the coordinate wraps around
|
|
tileUv.y = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.y) : clamp(tileUv.y, 0.0, 1.0);
|
|
#else
|
|
tileUv.y = clamp(tileUv.y, 0.0, 1.0);
|
|
#endif
|
|
tileUv.z = clamp(tileUv.z, 0.0, 1.0);
|
|
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
|
|
}
|
|
`;var N4=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js)
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY
|
|
#define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY
|
|
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE
|
|
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED
|
|
#define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE
|
|
*/
|
|
|
|
uniform vec3 u_cameraPositionCartographic; // (longitude, latitude, height) in radians and meters
|
|
uniform vec2 u_ellipsoidCurvatureAtLatitude;
|
|
uniform mat3 u_ellipsoidEcToEastNorthUp;
|
|
uniform vec3 u_ellipsoidRadii;
|
|
uniform vec2 u_evoluteScale; // (radii.x ^ 2 - radii.z ^ 2) * vec2(1.0, -1.0) / radii;
|
|
uniform vec3 u_ellipsoidInverseRadiiSquared;
|
|
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
|
|
uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
|
|
#endif
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
uniform vec2 u_ellipsoidLocalToShapeUvLongitude; // x = scale, y = offset
|
|
uniform float u_ellipsoidShapeUvLongitudeRangeOrigin;
|
|
#endif
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
|
|
uniform vec2 u_ellipsoidLocalToShapeUvLatitude; // x = scale, y = offset
|
|
#endif
|
|
uniform float u_ellipsoidInverseHeightDifference;
|
|
|
|
uniform ivec4 u_cameraTileCoordinates;
|
|
uniform vec3 u_cameraTileUv;
|
|
|
|
// robust iterative solution without trig functions
|
|
// https://github.com/0xfaded/ellipse_demo/issues/1
|
|
// https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse
|
|
// Extended to return radius of curvature along with the point
|
|
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
|
|
vec2 p = abs(pos);
|
|
vec2 inverseRadii = 1.0 / radii;
|
|
|
|
// We describe the ellipse parametrically: v = radii * vec2(cos(t), sin(t))
|
|
// but store the cos and sin of t in a vec2 for efficiency.
|
|
// Initial guess: t = pi/4
|
|
vec2 tTrigs = vec2(0.7071067811865476);
|
|
// Initial guess of point on ellipsoid
|
|
vec2 v = radii * tTrigs;
|
|
// Center of curvature of the ellipse at v
|
|
vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
|
|
|
|
const int iterations = 3;
|
|
for (int i = 0; i < iterations; ++i) {
|
|
// Find the (approximate) intersection of p - evolute with the ellipsoid.
|
|
vec2 q = normalize(p - evolute) * length(v - evolute);
|
|
// Update the estimate of t.
|
|
tTrigs = (q + evolute) * inverseRadii;
|
|
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
|
|
v = radii * tTrigs;
|
|
evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
|
|
}
|
|
|
|
return vec3(v * sign(pos), length(v - evolute));
|
|
}
|
|
|
|
mat3 convertLocalToShapeSpaceDerivative(in vec3 position) {
|
|
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
|
|
|
|
// Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z)
|
|
// (assume radii.y == radii.x) and find the nearest point on the ellipse and its normal
|
|
float distanceFromZAxis = length(position.xy);
|
|
vec2 posEllipse = vec2(distanceFromZAxis, position.z);
|
|
vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadii.xz);
|
|
vec2 surfacePoint = surfacePointAndRadius.xy;
|
|
|
|
vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquared.xz);
|
|
vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));
|
|
|
|
float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
|
|
float height = heightSign * length(posEllipse - surfacePoint);
|
|
vec3 up = normalize(cross(east, north));
|
|
|
|
return mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
|
|
}
|
|
|
|
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
|
|
// Convert from [0, 1] to radians [-pi, pi]
|
|
float longitude = shapeUv.x * czm_twoPi;
|
|
#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
|
|
longitude /= u_ellipsoidLocalToShapeUvLongitude.x;
|
|
#endif
|
|
|
|
// Convert from [0, 1] to radians [-pi/2, pi/2]
|
|
float latitude = shapeUv.y * czm_pi;
|
|
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
|
|
latitude /= u_ellipsoidLocalToShapeUvLatitude.x;
|
|
#endif
|
|
|
|
float height = shapeUv.z / u_ellipsoidInverseHeightDifference;
|
|
|
|
return vec3(longitude, latitude, height);
|
|
}
|
|
|
|
vec3 convertEcToDeltaShape(in vec3 positionEC) {
|
|
vec3 enu = u_ellipsoidEcToEastNorthUp * positionEC;
|
|
|
|
// 1. Compute the change in longitude from the camera to the ENU point
|
|
// First project the camera and ENU positions to the equatorial XY plane,
|
|
// positioning the camera on the +x axis, so that enu.x projects along the +y axis
|
|
float cosLatitude = cos(u_cameraPositionCartographic.y);
|
|
float sinLatitude = sin(u_cameraPositionCartographic.y);
|
|
float primeVerticalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.x;
|
|
vec2 cameraXY = vec2((primeVerticalRadius + u_cameraPositionCartographic.z) * cosLatitude, 0.0);
|
|
// Note precision loss in positionXY.x if length(enu) << length(cameraXY)
|
|
vec2 positionXY = cameraXY + vec2(-enu.y * sinLatitude + enu.z * cosLatitude, enu.x);
|
|
float dLongitude = atan(positionXY.y, positionXY.x);
|
|
|
|
// 2. Find the longitude component of positionXY, by rotating about Z until the y component is zero.
|
|
// Use the versine to compute the change in x directly from the change in angle:
|
|
// versine(angle) = 2 * sin^2(angle/2)
|
|
float sinHalfLongitude = sin(dLongitude / 2.0);
|
|
float dx = length(positionXY) * 2.0 * sinHalfLongitude * sinHalfLongitude;
|
|
// Rotate longitude component back to ENU North and Up, and remove from enu
|
|
enu += vec3(-enu.x, -dx * sinLatitude, dx * cosLatitude);
|
|
|
|
// 3. Compute the change in latitude from the camera to the ENU point.
|
|
// First project the camera and ENU positions to the meridional ZX plane,
|
|
// positioning the camera on the +Z axis, so that enu.y maps to the +X axis.
|
|
float meridionalRadius = 1.0 / u_ellipsoidCurvatureAtLatitude.y;
|
|
vec2 cameraZX = vec2(meridionalRadius + u_cameraPositionCartographic.z, 0.0);
|
|
vec2 positionZX = cameraZX + vec2(enu.z, enu.y);
|
|
float dLatitude = atan(positionZX.y, positionZX.x);
|
|
|
|
// 4. Compute the change in height above the ellipsoid
|
|
// Find the change in enu.z associated with rotating the point to the latitude of the camera
|
|
float sinHalfLatitude = sin(dLatitude / 2.0);
|
|
float dz = length(positionZX) * 2.0 * sinHalfLatitude * sinHalfLatitude;
|
|
// The remaining change in enu.z is the change in height above the ellipsoid
|
|
float dHeight = enu.z + dz;
|
|
|
|
return vec3(dLongitude, dLatitude, dHeight);
|
|
}
|
|
|
|
vec3 convertEcToDeltaTile(in vec3 positionEC) {
|
|
vec3 deltaShape = convertEcToDeltaShape(positionEC);
|
|
// Convert to tileset coordinates in [0, 1]
|
|
float dx = deltaShape.x / czm_twoPi;
|
|
|
|
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
|
|
// Wrap to ensure dx is not crossing through the unoccupied angle range, where
|
|
// angle to tile coordinate conversions would be more complicated
|
|
float cameraUvLongitude = (u_cameraPositionCartographic.x + czm_pi) / czm_twoPi;
|
|
float cameraUvLongitudeShift = fract(cameraUvLongitude - u_ellipsoidShapeUvLongitudeRangeOrigin);
|
|
float rawOutputUvLongitude = cameraUvLongitudeShift + dx;
|
|
float rotation = floor(rawOutputUvLongitude);
|
|
dx -= rotation;
|
|
dx *= u_ellipsoidLocalToShapeUvLongitude.x;
|
|
#endif
|
|
|
|
float dy = deltaShape.y / czm_pi;
|
|
#if (defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE))
|
|
dy *= u_ellipsoidLocalToShapeUvLatitude.x;
|
|
#endif
|
|
|
|
float dz = u_ellipsoidInverseHeightDifference * deltaShape.z;
|
|
// Convert to tile coordinate changes
|
|
return vec3(dx, dy, dz) * float(1 << u_cameraTileCoordinates.w);
|
|
}
|
|
|
|
TileAndUvCoordinate getTileAndUvCoordinate(in vec3 positionEC) {
|
|
vec3 deltaTileCoordinate = convertEcToDeltaTile(positionEC);
|
|
vec3 tileUvSum = u_cameraTileUv + deltaTileCoordinate;
|
|
ivec3 tileCoordinate = u_cameraTileCoordinates.xyz + ivec3(floor(tileUvSum));
|
|
int maxTileCoordinate = (1 << u_cameraTileCoordinates.w) - 1;
|
|
tileCoordinate.y = min(max(0, tileCoordinate.y), maxTileCoordinate);
|
|
tileCoordinate.z = min(max(0, tileCoordinate.z), maxTileCoordinate);
|
|
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
if (tileCoordinate.x < 0) {
|
|
tileCoordinate.x += (maxTileCoordinate + 1);
|
|
} else if (tileCoordinate.x > maxTileCoordinate) {
|
|
tileCoordinate.x -= (maxTileCoordinate + 1);
|
|
}
|
|
#else
|
|
tileCoordinate.x = min(max(0, tileCoordinate.x), maxTileCoordinate);
|
|
ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz;
|
|
#endif
|
|
vec3 tileUv = tileUvSum - vec3(tileCoordinateChange);
|
|
#if (!defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE))
|
|
// If there is only one tile spanning 2*PI angle, the coordinate wraps around
|
|
tileUv.x = (u_cameraTileCoordinates.w == 0) ? fract(tileUv.x) : clamp(tileUv.x, 0.0, 1.0);
|
|
#else
|
|
tileUv.x = clamp(tileUv.x, 0.0, 1.0);
|
|
#endif
|
|
tileUv.y = clamp(tileUv.y, 0.0, 1.0);
|
|
tileUv.z = clamp(tileUv.z, 0.0, 1.0);
|
|
return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv);
|
|
}
|
|
`;var L4=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js
|
|
#define OCTREE_FLAG_INTERNAL 0
|
|
#define OCTREE_FLAG_LEAF 1
|
|
#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2
|
|
|
|
#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops
|
|
|
|
uniform sampler2D u_octreeInternalNodeTexture;
|
|
uniform vec2 u_octreeInternalNodeTexelSizeUv;
|
|
uniform int u_octreeInternalNodeTilesPerRow;
|
|
#if (SAMPLE_COUNT > 1)
|
|
uniform sampler2D u_octreeLeafNodeTexture;
|
|
uniform vec2 u_octreeLeafNodeTexelSizeUv;
|
|
uniform int u_octreeLeafNodeTilesPerRow;
|
|
#endif
|
|
uniform ivec3 u_dimensions; // does not include padding, and is in the z-up orientation
|
|
uniform ivec3 u_inputDimensions; // includes padding, and is in the orientation of the input data
|
|
#if defined(PADDING)
|
|
uniform ivec3 u_paddingBefore;
|
|
#endif
|
|
|
|
struct OctreeNodeData {
|
|
int data;
|
|
int flag;
|
|
};
|
|
|
|
struct TraversalData {
|
|
ivec4 octreeCoords;
|
|
int parentOctreeIndex;
|
|
};
|
|
|
|
struct TileAndUvCoordinate {
|
|
ivec4 tileCoords;
|
|
vec3 tileUv;
|
|
};
|
|
|
|
struct SampleData {
|
|
int megatextureIndex;
|
|
ivec4 tileCoords;
|
|
vec3 tileUv;
|
|
vec3 inputCoordinate;
|
|
#if (SAMPLE_COUNT > 1)
|
|
float weight;
|
|
#endif
|
|
};
|
|
|
|
int normU8_toInt(in float value) {
|
|
return int(value * 255.0);
|
|
}
|
|
int normU8x2_toInt(in vec2 value) {
|
|
return int(value.x * 255.0) + 256 * int(value.y * 255.0);
|
|
}
|
|
float normU8x2_toFloat(in vec2 value) {
|
|
return float(normU8x2_toInt(value)) / 65535.0;
|
|
}
|
|
|
|
OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
|
|
vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);
|
|
|
|
OctreeNodeData data;
|
|
data.data = normU8x2_toInt(texData.xy);
|
|
data.flag = normU8x2_toInt(texData.zw);
|
|
return data;
|
|
}
|
|
|
|
OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
|
|
int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
|
|
int octreeCoordX = (parentOctreeIndex % u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
|
|
int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
|
|
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
|
|
return getOctreeNodeData(octreeUv);
|
|
}
|
|
|
|
int getOctreeParentIndex(in int octreeIndex) {
|
|
int octreeCoordX = (octreeIndex % u_octreeInternalNodeTilesPerRow) * 9;
|
|
int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
|
|
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
|
|
vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
|
|
int parentOctreeIndex = normU8x2_toInt(parentData.xy);
|
|
return parentOctreeIndex;
|
|
}
|
|
|
|
vec3 getTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
|
|
int levelDifference = tileAndUv.tileCoords.w - octreeCoords.w;
|
|
float scalar = exp2(-1.0 * float(levelDifference));
|
|
vec3 originShift = vec3(tileAndUv.tileCoords.xyz - (octreeCoords.xyz << levelDifference)) * scalar;
|
|
return tileAndUv.tileUv * scalar + originShift;
|
|
}
|
|
|
|
vec3 getClampedTileUv(in TileAndUvCoordinate tileAndUv, in ivec4 octreeCoords) {
|
|
vec3 tileUv = getTileUv(tileAndUv, octreeCoords);
|
|
return clamp(tileUv, vec3(0.0), vec3(1.0));
|
|
}
|
|
|
|
void addSampleCoordinates(in TileAndUvCoordinate tileAndUv, inout SampleData sampleData) {
|
|
vec3 tileUv = getClampedTileUv(tileAndUv, sampleData.tileCoords);
|
|
|
|
vec3 inputCoordinate = tileUv * vec3(u_dimensions);
|
|
#if defined(PADDING)
|
|
inputCoordinate += vec3(u_paddingBefore);
|
|
#endif
|
|
#if defined(Y_UP_METADATA_ORDER)
|
|
#if defined(SHAPE_BOX)
|
|
float inputY = inputCoordinate.y;
|
|
inputCoordinate.y = inputCoordinate.z;
|
|
// u_inputDimensions.z is the y-up dimension along the 3D Tiles y-axis.
|
|
inputCoordinate.z = float(u_inputDimensions.z) - inputY;
|
|
#elif defined(SHAPE_CYLINDER)
|
|
float angle = inputCoordinate.y;
|
|
float height = inputCoordinate.z;
|
|
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
|
|
// Account for the different 0-angle convention in glTF vs 3DTiles
|
|
if (sampleData.tileCoords.w == 0) {
|
|
float angleCount = float(u_inputDimensions.z);
|
|
angle = mod(angle + angleCount / 2.0, angleCount);
|
|
}
|
|
#endif
|
|
inputCoordinate.y = height;
|
|
inputCoordinate.z = angle;
|
|
#endif
|
|
#endif
|
|
|
|
sampleData.tileUv = tileUv;
|
|
sampleData.inputCoordinate = inputCoordinate;
|
|
}
|
|
|
|
void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
|
|
sampleData.megatextureIndex = data.data;
|
|
sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
|
|
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
|
|
: octreeCoords;
|
|
}
|
|
|
|
#if (SAMPLE_COUNT > 1)
|
|
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
int leafIndex = data.data;
|
|
int leafNodeTexelCount = 2;
|
|
// Adding 0.5 moves to the center of the texel
|
|
float leafCoordXStart = float((leafIndex % u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
|
|
float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
|
|
|
|
// Get an interpolation weight and a flag to determine whether to read the parent texture
|
|
vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
|
|
vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
|
|
float lerp = normU8x2_toFloat(leafData0.xy);
|
|
sampleDatas[0].weight = 1.0 - lerp;
|
|
sampleDatas[1].weight = lerp;
|
|
// TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT
|
|
sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
|
|
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
|
|
: octreeCoords;
|
|
sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
|
|
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
|
|
: octreeCoords;
|
|
|
|
// Get megatexture indices for both samples
|
|
vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
|
|
vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
|
|
sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
|
|
sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
|
|
}
|
|
#endif
|
|
|
|
OctreeNodeData traverseOctreeDownwards(in ivec4 tileCoordinate, inout TraversalData traversalData) {
|
|
OctreeNodeData childData;
|
|
|
|
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
|
|
// tileCoordinate.xyz is defined at the level of detail tileCoordinate.w.
|
|
// Find the corresponding coordinate at the level traversalData.octreeCoords.w
|
|
int level = traversalData.octreeCoords.w + 1;
|
|
int levelDifference = tileCoordinate.w - level;
|
|
ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
|
|
traversalData.octreeCoords = ivec4(coordinateAtLevel, level);
|
|
|
|
ivec3 childCoordinate = coordinateAtLevel & 1;
|
|
childData = getOctreeChildData(traversalData.parentOctreeIndex, childCoordinate);
|
|
|
|
if (childData.flag != OCTREE_FLAG_INTERNAL) {
|
|
// leaf tile - stop traversing
|
|
break;
|
|
}
|
|
|
|
traversalData.parentOctreeIndex = childData.data;
|
|
}
|
|
|
|
return childData;
|
|
}
|
|
|
|
/**
|
|
* Transform a given position to an octree tile coordinate and a position within that tile,
|
|
* and find the corresponding megatexture index and texture coordinates
|
|
*/
|
|
void traverseOctreeFromBeginning(in TileAndUvCoordinate tileAndUv, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
traversalData.octreeCoords = ivec4(0);
|
|
traversalData.parentOctreeIndex = 0;
|
|
|
|
OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
|
|
if (nodeData.flag != OCTREE_FLAG_LEAF) {
|
|
nodeData = traverseOctreeDownwards(tileAndUv.tileCoords, traversalData);
|
|
}
|
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
#else
|
|
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[1]);
|
|
#endif
|
|
}
|
|
|
|
bool insideTile(in ivec4 tileCoordinate, in ivec4 octreeCoords) {
|
|
int levelDifference = tileCoordinate.w - octreeCoords.w;
|
|
if (levelDifference < 0) {
|
|
return false;
|
|
}
|
|
ivec3 coordinateAtLevel = tileCoordinate.xyz >> levelDifference;
|
|
return coordinateAtLevel == octreeCoords.xyz;
|
|
}
|
|
|
|
void traverseOctreeFromExisting(in TileAndUvCoordinate tileAndUv, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
ivec4 tileCoords = tileAndUv.tileCoords;
|
|
if (insideTile(tileCoords, traversalData.octreeCoords)) {
|
|
for (int i = 0; i < SAMPLE_COUNT; i++) {
|
|
addSampleCoordinates(tileAndUv, sampleDatas[i]);
|
|
}
|
|
return;
|
|
}
|
|
|
|
// Go up tree until we find a parent tile containing tileCoords.
|
|
// Assumes all parents are available all they way up to the root.
|
|
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
|
|
traversalData.octreeCoords.xyz /= 2;
|
|
traversalData.octreeCoords.w -= 1;
|
|
|
|
if (insideTile(tileCoords, traversalData.octreeCoords)) {
|
|
break;
|
|
}
|
|
|
|
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
|
|
}
|
|
|
|
// Go down tree
|
|
OctreeNodeData nodeData = traverseOctreeDownwards(tileCoords, traversalData);
|
|
|
|
#if (SAMPLE_COUNT == 1)
|
|
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
#else
|
|
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[0]);
|
|
addSampleCoordinates(tileAndUv, sampleDatas[1]);
|
|
#endif
|
|
}
|
|
`;var O4=`// See Octree.glsl for the definitions of SampleData
|
|
|
|
/* Megatexture defines (set in Scene/VoxelRenderResources.js)
|
|
#define SAMPLE_COUNT ###
|
|
#define PADDING
|
|
*/
|
|
|
|
uniform ivec3 u_megatextureTileCounts; // number of tiles in the megatexture, along each axis
|
|
|
|
vec3 index1DTo3DTexCoord(int index)
|
|
{
|
|
int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y;
|
|
int iz = index / tilesPerZ;
|
|
int remainder = index - iz * tilesPerZ;
|
|
int iy = remainder / u_megatextureTileCounts.x;
|
|
int ix = remainder - iy * u_megatextureTileCounts.x;
|
|
return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts);
|
|
}
|
|
|
|
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
|
|
int tileIndex = sampleData.megatextureIndex;
|
|
|
|
vec3 voxelCoord = sampleData.inputCoordinate;
|
|
|
|
// UV coordinate of the lower corner of the tile in the megatexture
|
|
vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex);
|
|
|
|
// Voxel location
|
|
vec3 tileDimensions = vec3(u_inputDimensions);
|
|
vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5));
|
|
vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts);
|
|
|
|
return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv);
|
|
}
|
|
|
|
// Convert an array of sample datas to a final weighted properties.
|
|
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
|
|
#if (SAMPLE_COUNT == 1)
|
|
return getPropertiesFromMegatexture(sampleDatas[0]);
|
|
#else
|
|
// When more than one sample is taken the accumulator needs to start at 0
|
|
Properties properties = clearProperties();
|
|
for (int i = 0; i < SAMPLE_COUNT; ++i) {
|
|
float weight = sampleDatas[i].weight;
|
|
|
|
// Avoid reading the megatexture when the weight is 0 as it can be costly.
|
|
if (weight > 0.0) {
|
|
Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
|
|
tempProperties = scaleProperties(tempProperties, weight);
|
|
properties = sumProperties(properties, tempProperties);
|
|
}
|
|
}
|
|
return properties;
|
|
#endif
|
|
}
|
|
`;var Kwt={Z_UP:0,Y_UP:1},Sg=Object.freeze(Kwt);function Xwt(e){let t=new Xg;this.shaderBuilder=t;let n=e._customShader,i=Pt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let m in o)if(o.hasOwnProperty(m)){let _=o[m];t.addUniform(_.type,m,he.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",he.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,a=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=a;let s=e._shape.renderBoundPlanes,c=s?.length??0;this.renderBoundPlanes=s,this.renderBoundPlanesLength=c,t.addVertexLines([T4]),e.provider.metadataOrder===Sg.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,he.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,he.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,he.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,he.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",L4,b4,O4,S4,B4,w4]),a>0&&(t.addDefine("CLIPPING_PLANES",void 0,he.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",a,he.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,he.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,he.FRAGMENT),u==="BOX"?t.addFragmentLines([R4,D4,GS]):u==="CYLINDER"?t.addFragmentLines([M4,yR,v4,GS]):u==="ELLIPSOID"&&t.addFragmentLines([N4,yR,P4,GS]),t.addFragmentLines([x4]);let f=e._shape,h=f.shaderDefines;for(let m in h)if(h.hasOwnProperty(m)){let _=h[m];l(_)&&(_=_===!0?void 0:_,t.addDefine(m,_,he.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;a>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,he.FRAGMENT),a===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,he.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,he.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,he.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,he.FRAGMENT);let A=e._traversal;t.addDefine("SAMPLE_COUNT",`${A._sampleCount}`,he.FRAGMENT)}var F4=Xwt;var nwe=new Q;function Jwt(e,t){let n=new F4(e);I4(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:a,renderBoundPlanesLength:s}=n;if(r>0){let I="getClippingPlane",x=`vec4 ${I}(highp sampler2D packedPlanes, int planeNumber)`,S=Ca.getTextureResolution(o,t,nwe),w=iwe(S);i.addFunction(I,x,he.FRAGMENT),i.addFunctionLines(I,[w])}if(s>0){let I="getBoundPlane",x=`vec4 ${I}(highp sampler2D packedPlanes, int planeNumber)`,S=CC.getTextureResolution(a,t,nwe),w=iwe(S);i.addFunction(I,x,he.FRAGMENT),i.addFunctionLines(I,[w])}let c=i.clone();c.addDefine("PICKING",void 0,he.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,he.FRAGMENT);let f=i.buildShaderProgram(t),h=c.buildShaderProgram(t),p=u.buildShaderProgram(t),A=Ve.fromCache({cull:{enabled:!0,face:Li.BACK},depthTest:{enabled:!1},depthMask:!1,blending:sn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),_=e._depthTest,y=new it({vertexArray:m,primitiveType:Pe.TRIANGLES,renderState:A,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Be.VOXELS,executeInClosestFrustum:!0,owner:this,cull:_,occlude:_}),C=it.shallowClone(y,new it);C.shaderProgram=h,C.pickOnly=!0;let E=it.shallowClone(y,new it);if(E.shaderProgram=p,E.pickOnly=!0,l(e._drawCommand)){let I=e._drawCommand;I.shaderProgram=I.shaderProgram&&I.shaderProgram.destroy()}if(l(e._drawCommandPick)){let I=e._drawCommandPick;I.shaderProgram=I.shaderProgram&&I.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let I=e._drawCommandPickVoxel;I.shaderProgram=I.shaderProgram&&I.shaderProgram.destroy()}e._drawCommand=y,e._drawCommandPick=C,e._drawCommandPickVoxel=E}function iwe(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let a=`${o}`;return a.indexOf(".")===-1&&(a+=".0"),`int pixY = planeNumber / ${t};
|
|
int pixX = planeNumber - (pixY * ${t});
|
|
// Sample from center of pixel
|
|
float u = (float(pixX) + 0.5) * ${r};
|
|
float v = (float(pixY) + 0.5) * ${a};
|
|
return texture(packedPlanes, vec2(u, v));`}var Q4=Jwt;var Zwt={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"},CR=Object.freeze(Zwt);function VS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}VS.prototype.getTexture=function(e){return this._textures[e]};function $wt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}VS.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):$wt(this,e,t)};function eBt(e,t,n){let{id:i,textureUniform:o,image:r}=t,a=n.webgl2?k4(o,r,n):tBt(o,r,n),s=e._textures[i];l(s)&&s!==n.defaultTexture&&s.destroy(),e._textures[i]=a}function k4(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?rwe(e,n):new vt({context:n,source:t,sampler:o});return owe(o)&&r.generateMipmap(),r}function tBt(e,t,n){let{typedArray:i,sampler:o}=e,r=owe(o),a=o.wrapS===pn.REPEAT||o.wrapS===pn.MIRRORED_REPEAT||o.wrapT===pn.REPEAT||o.wrapT===pn.MIRRORED_REPEAT,{width:s,height:c}=l(i)?e:t,u=[s,c].every(D.isPowerOfTwo);if((r||a)&&!u)if(l(i)){if(e.pixelDatatype===He.UNSIGNED_BYTE){let h=LV(i,s,c),p=dE(h);return k4({sampler:o},p,n)}}else{let h=dE(t);return k4(e,h,n)}else return k4(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):a&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),rwe(e,n)}function owe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function rwe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:a,sampler:s}=e;return new vt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:a,width:o,height:r},sampler:s,flipY:!1})}VS.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];eBt(this,o,t)}n.length=0};VS.prototype.isDestroyed=function(){return!1};VS.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return fe(this)};var U4=VS;function ER(e){e=e??V.EMPTY_OBJECT,this.mode=e.mode??U_.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??V.EMPTY_OBJECT,this.varyings=e.varyings??V.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??SE.INHERIT,this._textureManager=new U4,this._defaultTexture=void 0,this.uniformMap=nBt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},rBt(this),aBt(this)}function nBt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===CR.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=iBt(e,i)):n[i]=oBt(e,i)}return n}function iBt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function oBt(e,t){return function(){return e.uniforms[t].value}}function tI(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function rBt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,tI(r,t,o),o=e.usedVariablesVertex.featureIdSet,tI(r,n,o),o=e.usedVariablesVertex.metadataSet,tI(r,i,o));let a=e.fragmentShaderText;if(l(a)){o=e.usedVariablesFragment.attributeSet,tI(a,t,o),o=e.usedVariablesFragment.featureIdSet,tI(a,n,o),o=e.usedVariablesFragment.metadataSet,tI(a,i,o);let s=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;tI(a,s,c)}}function awe(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 el(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${awe(t)} is not available in the ${i} shader. Did you mean ${awe(n)} instead?`;throw new de(o)}}function aBt(e){let t=e.usedVariablesVertex.attributeSet;el(t,"position","positionMC","vertex"),el(t,"normal","normalMC","vertex"),el(t,"tangent","tangentMC","vertex"),el(t,"bitangent","bitangentMC","vertex"),el(t,"positionWC","positionMC","vertex"),el(t,"positionEC","positionMC","vertex"),el(t,"normalEC","normalMC","vertex"),el(t,"tangentEC","tangentMC","vertex"),el(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;el(n,"position","positionEC","fragment"),el(n,"normal","normalEC","fragment"),el(n,"tangent","tangentEC","fragment"),el(n,"bitangent","bitangentEC","fragment"),el(n,"normalMC","normalEC","fragment"),el(n,"tangentMC","tangentEC","fragment"),el(n,"bitangentMC","bitangentEC","fragment")}ER.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===CR.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};ER.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};ER.prototype.isDestroyed=function(){return!1};ER.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),fe(this)};var HS=ER;function wg(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(wg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});wg.fromMetadataArray=function(e){return new wg({metadata:e})};wg.fromGltf=async function(e){let t=new td({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new wg({loader:t})};wg.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=sBt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function sBt(e,t,n){let{className:i,names:o,types:r,componentTypes:a}=n.provider,s=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=s,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=c[o[f]].attribute,p=e.find(y=>y.name===h);if(!l(p))continue;let A=Qt.toComponentDatatype(a[f]),m=It.getComponentCount(r[f]),_=p.count*m;u[f]=j.createArrayBufferView(A,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,_)}return u}wg.prototype.isDestroyed=function(){return!1};wg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),fe(this)};var WS=wg;function tl(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=tl.DefaultMinBounds.clone(),this._maxBounds=tl.DefaultMaxBounds.clone(),this._renderMinBounds=tl.DefaultMinBounds.clone(),this._renderMaxBounds=tl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=tl,n=[new os(d.negate(d.UNIT_X,new d),e.x),new os(d.negate(d.UNIT_Y,new d),e.y),new os(d.negate(d.UNIT_Z,new d),e.z),new os(d.UNIT_X,-t.x),new os(d.UNIT_Y,-t.y),new os(d.UNIT_Z,-t.z)];this._renderBoundPlanes=new CC({planes:n}),this._shaderUniforms={boxEcToXyz:new J,boxLocalToShapeUvScale:new d,boxLocalToShapeUvTranslate:new d},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(tl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var cBt=new d,lBt=new d,uBt=new J,fBt=new d,dBt=new d;tl.prototype.update=function(e,t,n,i,o){i=i??t.clone(fBt),o=o??n.clone(dBt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,this._renderMinBounds),a=d.clamp(n,i,o,this._renderMaxBounds),s=P.getScale(e,lBt);if(r.x>a.x||r.y>a.y||r.z>a.z||(r.x===a.x)+(r.y===a.y)+(r.z===a.z)>=2||s.x===0||s.y===0||s.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-a.x,c.get(4).distance=-a.y,c.get(5).distance=-a.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=Qee(r,a,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let _ in f)f.hasOwnProperty(_)&&(f[_]=void 0);let h=0;f.BOX_INTERSECTION_INDEX=h,h+=1;let p=t,A=n,m=d.fromElements(Oee(p.x,A.x),Oee(p.y,A.y),Oee(p.z,A.z),u.boxLocalToShapeUvScale);return u.boxLocalToShapeUvTranslate=d.negate(d.multiplyComponents(m,p,u.boxLocalToShapeUvTranslate),u.boxLocalToShapeUvTranslate),this._shaderMaximumIntersectionsLength=h,!0};function Oee(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var hBt=new P;tl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,hBt),i=P.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;J.multiply(i,o,t.boxEcToXyz)};tl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n,boxLocalToShapeUvTranslate:i}=this._shaderUniforms;return d.add(d.multiplyComponents(e,n,t),i,t)};var z4=new d,Fee=new d;tl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=d.fromElements(D.lerp(r.x,a.x,s*t),D.lerp(r.y,a.y,s*n),D.lerp(r.z,a.z,s*i),z4),u=d.fromElements(D.lerp(r.x,a.x,s*(t+1)),D.lerp(r.y,a.y,s*(n+1)),D.lerp(r.z,a.z,s*(i+1)),Fee);return Qee(c,u,this._shapeTransform,o)};var swe=new d;tl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,swe),a=d.multiplyByScalar(r,o,swe),s=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,z4),o,z4),c=d.add(s,a,Fee),u=this._minBounds,f=this._maxBounds,h=d.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),z4),p=d.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Fee);return Qee(h,p,this._shapeTransform,i)};tl.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));tl.DefaultMaxBounds=Object.freeze(new d(1,1,1));var cwe=new d;function Qee(e,t,n,i){let o=tl.DefaultMinBounds,r=tl.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=P.getTranslation(n,i.center),i.halfAxes=P.getMatrix3(n,i.halfAxes);else{let s=P.getScale(n,cwe),c=d.midpoint(e,t,cBt);i.center=P.multiplyByPoint(n,c,i.center),s=d.fromElements(s.x*.5*(t.x-e.x),s.y*.5*(t.y-e.y),s.z*.5*(t.z-e.z),cwe);let u=P.getRotation(n,uBt);i.halfAxes=J.setScale(u,s,i.halfAxes)}return i}var jS=tl;function wf(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=wf.DefaultMinBounds.clone(),this._maxBounds=wf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=wf,n=[new os(d.negate(d.UNIT_Z,new d),e.z),new os(d.UNIT_Z,-t.z)];this._renderBoundPlanes=new CC({planes:n}),this._shaderUniforms={cameraShapePosition:new d,cylinderEcToRadialTangentUp:new J,cylinderRenderRadiusMinMax:new Q,cylinderRenderAngleMinMax:new Q,cylinderLocalToShapeUvRadius:new Q,cylinderLocalToShapeUvAngle:new Q,cylinderLocalToShapeUvHeight:new Q,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(wf.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var mBt=new d,pBt=new d,ABt=new d,gBt=new d,_Bt=new d,yBt=new P,CBt=new d,lwe=new Q;wf.prototype.update=function(e,t,n,i,o){i=i??t.clone(pBt),o=o??n.clone(ABt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:a}=wf,s=a.y-r.y,c=.5*s,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),o.y=D.negativePiToPi(o.y);let h=d.maximumByComponent(t,i,gBt),p=d.minimumByComponent(n,o,_Bt),A=P.getScale(e,mBt);if(p.x===0||h.x>p.x||h.z>p.z||D.equalsEpsilon(A.x,0,void 0,u)||D.equalsEpsilon(A.y,0,void 0,u)||D.equalsEpsilon(A.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=h.z,m.get(1).distance=-p.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=zee(h,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let _=n.y<t.y,y=n.y-t.y+_*s,C=p.y<h.y,E=p.y-h.y+C*s,I=E>=c-f&&E<s-f,x=E>f&&E<c-f,S=E<=f,w=I||x||S,v=this._shaderUniforms,R=this._shaderDefines;for(let F in R)R.hasOwnProperty(F)&&(R[F]=void 0);let N=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=N,N+=1,y<s-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),h.x!==r.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=N,N+=1),v.cylinderRenderRadiusMinMax=Q.fromElements(h.x,p.x,v.cylinderRenderRadiusMinMax),h.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,g=0,b=1;L!==0&&(g=1/L,b=-t.x*g),v.cylinderLocalToShapeUvRadius=Q.fromElements(g,b,v.cylinderLocalToShapeUvRadius);let T=n.z-t.z,B=0,M=1;T!==0&&(B=1/T,M=-t.z*B),v.cylinderLocalToShapeUvHeight=Q.fromElements(B,M,v.cylinderLocalToShapeUvHeight),w&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=N,I?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,N+=1):x?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,N+=2):S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,N+=2),v.cylinderRenderAngleMinMax=Q.fromElements(h.y,p.y,v.cylinderRenderAngleMinMax));let O=(t.y-r.y)/s,G=(n.y-r.y)/s,k=1-y/s,z=(G+.5*k)%1;if(v.cylinderShapeUvAngleRangeOrigin=z,y<=f)v.cylinderLocalToShapeUvAngle=Q.fromElements(0,1,v.cylinderLocalToShapeUvAngle);else{let F=s/y,H=O-z,Y=-F*(H-Math.floor(H));v.cylinderLocalToShapeUvAngle=Q.fromElements(F,Y,v.cylinderLocalToShapeUvAngle)}return this._shaderMaximumIntersectionsLength=N,!0};var EBt=new J,IBt=new J,bBt=new P;wf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,yBt),i=P.multiplyByPoint(n,e.camera.positionWC,CBt);t.cameraShapePosition=d.fromElements(Q.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=Q.normalize(Q.fromCartesian3(i,lwe),lwe),r=J.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],EBt),a=e.context.uniformState.inverseView,s=P.multiplyTransformation(n,a,bBt),c=P.getMatrix3(s,IBt);t.cylinderEcToRadialTangentUp=J.multiply(r,c,t.cylinderEcToRadialTangentUp)};wf.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvRadius:r,cylinderLocalToShapeUvAngle:a,cylinderShapeUvAngleRangeOrigin:s,cylinderLocalToShapeUvHeight:c}=this._shaderUniforms;return n=n*r.x+r.y,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*a.x+a.y,o=o*c.x+c.y,d.fromElements(n,i,o,t)};var G4=new d,Uee=new d;wf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,a=this._maxBounds,s=1/Math.pow(2,e),c=d.fromElements(D.lerp(r.x,a.x,t*s),D.lerp(r.y,a.y,n*s),D.lerp(r.z,a.z,i*s),G4),u=d.fromElements(D.lerp(r.x,a.x,(t+1)*s),D.lerp(r.y,a.y,(n+1)*s),D.lerp(r.z,a.z,(i+1)*s),Uee);return zee(c,u,this._shapeTransform,o)};var uwe=new d;wf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,uwe),a=d.multiplyByScalar(r,o,uwe),s=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,G4),o,G4),c=d.add(s,a,Uee),u=this._minBounds,f=this._maxBounds,h=d.fromElements(D.lerp(u.x,f.x,s.x),D.lerp(u.y,f.y,s.y),D.lerp(u.z,f.z,s.z),G4),p=d.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Uee);return zee(h,p,this._shapeTransform,i)};wf.DefaultMinBounds=Object.freeze(new d(0,-D.PI,-1));wf.DefaultMaxBounds=Object.freeze(new d(1,+D.PI,1));var xBt=5,TBt=new Array(xBt),SBt=new d,wBt=new J,BBt=new P,DBt=new P,vBt=new P,kee=new P,PBt=new d,RBt=new d,MBt=new d,dwe=new Array(8);for(let e=0;e<8;e++)dwe[e]=new d;function fwe(e,t,n){return Math.abs(ie.dot(e,t))<n}function NBt(e){let t=P.getColumn(e,0,PBt),n=P.getColumn(e,1,RBt),i=P.getColumn(e,2,MBt),o=D.EPSILON4;return fwe(t,n,o)&&fwe(n,i,o)}function LBt(e,t){let n=dwe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)P.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var OBt=new d;function zee(e,t,n,i){let o=e.x,r=t.x,a=e.y,s=t.y<a?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=s-a,h=a+f*.5,p=TBt,A=0;p[A++]=a,p[A++]=s,p[A++]=h,f>D.PI&&(p[A++]=h-D.PI_OVER_TWO,p[A++]=h+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,_=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let O=0;O<A;++O){let G=p[O]-h,k=Math.cos(G),z=Math.sin(G),F=k*o,H=z*o,Y=k*r,$=z*r;m=Math.min(m,F,Y),_=Math.min(_,H,$),y=Math.max(y,F,Y),C=Math.max(C,H,$)}let E=y-m,I=C-_,x=u-c,S=(m+y)*.5,w=(_+C)*.5,v=(c+u)*.5,R=d.fromElements(S,w,v,SBt),N=J.fromRotationZ(h,wBt),L=d.fromElements(E,I,x,OBt),g=P.fromScale(L,vBt),b=P.fromRotation(N,DBt),T=P.fromTranslation(R,BBt),B=P.multiplyTransformation(b,P.multiplyTransformation(T,g,kee),kee),M=P.multiplyTransformation(n,B,kee);return NBt(M)?en.fromTransformation(M,i):LBt(M,i)}var YS=wf;function Gd(){this._orientedBoundingBox=new en,this._boundingSphere=new le,this._boundTransform=new P,this._shapeTransform=new P,this._rectangle=new ce,this._minimumHeight=Gd.DefaultMinBounds.z,this._maximumHeight=Gd.DefaultMaxBounds.z,this._ellipsoid=new te,this._translation=new d,this._rotation=new J,this._shaderUniforms={cameraPositionCartographic:new d,ellipsoidEcToEastNorthUp:new J,ellipsoidRadii:new d,eccentricitySquared:0,evoluteScale:new Q,ellipsoidCurvatureAtLatitude:new Q,ellipsoidInverseRadiiSquared:new d,ellipsoidRenderLongitudeMinMax:new Q,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidLocalToShapeUvLongitude:new Q,ellipsoidLocalToShapeUvLatitude:new Q,ellipsoidRenderLatitudeSinMinMax:new Q,ellipsoidInverseHeightDifference:0,clipMinMaxHeight:new Q},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Gd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var FBt=new d,QBt=new d,kBt=new d,UBt=new d,zBt=new d,GBt=new d,VBt=new d,HBt=new d,hwe=new d,mwe=new d,WBt=new ce;Gd.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:a}=Gd;i=i??r,o=o??a;let s=D.EPSILON10,c=D.EPSILON3,u=D.EPSILON10,f=D.EPSILON10,h=D.EPSILON3,p=P.getScale(e,HBt),A=d.clone(r,FBt);A.z=-d.minimumComponent(p);let m=d.clamp(t,A,a,QBt),_=d.clamp(n,A,a,kBt),y=d.clamp(i,A,a,UBt),C=d.clamp(o,A,a,zBt),E=d.maximumByComponent(m,y,GBt),I=d.minimumByComponent(_,C,VBt),x=d.add(p,d.fromElements(_.z,_.z,_.z,hwe),hwe),S=d.add(p,d.fromElements(I.z,I.z,I.z,mwe),mwe);if(E.y>I.y||E.y===a.y||I.y===r.y||E.z>I.z||D.equalsEpsilon(S,d.ZERO,void 0,s))return!1;this._rectangle=ce.fromRadians(m.x,m.y,_.x,_.y),this._translation=P.getTranslation(e,this._translation),this._rotation=P.getRotation(e,this._rotation),this._ellipsoid=te.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=_.z;let w=ce.fromRadians(E.x,E.y,I.x,I.y,WBt);this._orientedBoundingBox=Gee(w,E.z,I.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=P.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let v=a.x-r.x,R=.5*v,N=I.x<E.x,L=I.x-E.x+N*v,g=L<=u,b=L>=R-u&&L<v-u,T=L>u&&L<R-u,B=g||b||T,M=_.x<m.x,O=_.x-m.x+M*v,G=O>R+u&&O<v-u,k=O>=R-u&&O<=R+u,z=O<R-u,F=G||k||z,H=I.y<-h,Y=I.y>=-h&&I.y<=+h,$=I.y>+h&&I.y<a.y-f,W=H||Y||$,K=E.y>r.y+f&&E.y<-h,Z=E.y>=-h&&E.y<=+h,pe=E.y>+h,ge=K||Z||pe,re=W||ge,ye=_.y-m.y,Ce=_.y<-h,ve=_.y>=-h&&_.y<=+h,Ne=_.y>+h&&_.y<a.y-f,Le=Ce||ve||Ne,Oe=m.y>r.y+f&&m.y<-h,nt=m.y>=-h&&m.y<=+h,Fe=m.y>+h,rt=Le||(Oe||nt||Fe),je=this._shaderUniforms,st=this._shaderDefines;for(let mt in st)st.hasOwnProperty(mt)&&(st[mt]=void 0);je.ellipsoidRadii=d.clone(x,je.ellipsoidRadii);let{x:ft,z:St}=je.ellipsoidRadii,be=St/ft;je.eccentricitySquared=1-be*be,je.evoluteScale=Q.fromElements((ft*ft-St*St)/ft,(St*St-ft*ft)/St,je.evoluteScale),je.ellipsoidInverseRadiiSquared=d.divideComponents(d.ONE,d.multiplyComponents(je.ellipsoidRadii,je.ellipsoidRadii,je.ellipsoidInverseRadiiSquared),je.ellipsoidInverseRadiiSquared);let Se=0;st.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Se,Se+=1,st.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Se,Se+=1,je.clipMinMaxHeight=Q.fromElements(E.z-_.z,I.z-_.z,je.clipMinMaxHeight);let qt=_.z-m.z;if(je.ellipsoidInverseHeightDifference=1/qt,m.z===_.z&&(je.ellipsoidInverseHeightDifference=0),B&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,st.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Se,b?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Se+=1):T?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Se+=2):g&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Se+=2),je.ellipsoidRenderLongitudeMinMax=Q.fromElements(E.x,I.x,je.ellipsoidRenderLongitudeMinMax)),F){st.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let mt=(m.x-r.x)/v,Ut=(_.x-r.x)/v,Gn=1-O/v,Xe=(Ut+.5*Gn)%1;if(je.ellipsoidShapeUvLongitudeRangeOrigin=Xe,_.x<m.x&&(st.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),O<=u)je.ellipsoidLocalToShapeUvLongitude=Q.fromElements(0,1,je.ellipsoidLocalToShapeUvLongitude);else{let Vt=v/O,Do=mt-Xe,ji=-Vt*(Do-Math.floor(Do));je.ellipsoidLocalToShapeUvLongitude=Q.fromElements(Vt,ji,je.ellipsoidLocalToShapeUvLongitude)}}if(B){let mt=D.equalsEpsilon(E.x,r.x,void 0,c),Ut=D.equalsEpsilon(I.x,a.x,void 0,c);mt&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Ut&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Gn=(m.x-r.x)/v,Xe=(_.x-r.x)/v,ro=(I.x-r.x)/v,Vt=1-L/v,Do=(ro+.5*Vt)%1;je.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(Gn,Xe,Do,je.ellipsoidShapeUvLongitudeMinMaxMid)}if(re&&(ge&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,st.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Se,K?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Se+=1):Z?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Se+=1):pe&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Se+=2)),W&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,st.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Se,H?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Se+=2):Y?(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Se+=1):$&&(st.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Se+=1)),je.ellipsoidRenderLatitudeSinMinMax=Q.fromElements(Math.sin(E.y),Math.sin(I.y),je.ellipsoidRenderLatitudeSinMinMax)),rt)if(st.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,ye<f)je.ellipsoidLocalToShapeUvLatitude=Q.fromElements(0,1,je.ellipsoidLocalToShapeUvLatitude);else{let Ut=(a.y-r.y)/ye,Gn=(r.y-m.y)/ye;je.ellipsoidLocalToShapeUvLatitude=Q.fromElements(Ut,Gn,je.ellipsoidLocalToShapeUvLatitude)}return this._shaderMaximumIntersectionsLength=Se,!0};var jBt=new me,YBt=new d,qBt=new P,pwe=new J;Gd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,jBt);d.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=d.fromRadians(o.longitude,o.latitude,0,n,YBt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let a=At.eastNorthUpToFixedFrame(r,n,qBt),s=P.getRotation(a,pwe),c=e.context.uniformState.viewRotation,u=J.multiply(c,s,pwe);t.ellipsoidEcToEastNorthUp=J.transpose(u,t.ellipsoidEcToEastNorthUp)};var Iwe=new ce;Gd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),a=t*r,s=(t+1)*r,c=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,a,c,s,u,Iwe),A=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,h);return Gee(p,A,m,this._ellipsoid,this._translation,this._rotation,o)};var KBt=new Q,XBt=new Q,IR=new Q,Awe=new Q,gwe=new Q,bR=new Q;function JBt(e,t,n,i){let o=Q.abs(e,KBt),r=Q.fromElements(1/t.x,1/t.y,XBt),a=Q.fromElements(Math.SQRT1_2,Math.SQRT1_2,IR),s=Q.multiplyComponents(t,a,Awe),c=Q.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,gwe);for(let u=0;u<3;++u){let f=Q.magnitude(Q.subtract(s,c,bR)),h=Q.normalize(Q.subtract(o,c,bR),bR),p=Q.multiplyByScalar(h,f,bR);a=Q.multiplyComponents(Q.add(p,c,IR),r,IR),a=Q.normalize(Q.clamp(a,Q.ZERO,Q.ONE,IR),IR),s=Q.multiplyComponents(t,a,Awe),c=Q.fromElements(n.x*a.x*a.x*a.x,n.y*a.y*a.y*a.y,gwe)}return d.fromElements(Math.sign(e.x)*s.x,Math.sign(e.y)*s.y,Q.magnitude(Q.subtract(s,c,bR)),i)}var ZBt=new Q,_we=new Q,$Bt=new d,ywe=new Q;Gd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidInverseHeightDifference:a,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvLongitude:c,ellipsoidLocalToShapeUvLatitude:u}=this._shaderUniforms,f=Math.hypot(e.x,e.y),h=Q.fromElements(f,e.z,_we),p=JBt(h,Q.fromElements(i.x,i.z,ZBt),o,$Bt),A=Q.normalize(Q.fromElements(p.x*r.x,p.y*r.z,ywe),ywe),m=Math.atan2(A.y,A.x),_=Q.magnitude(h)<Q.magnitude(p)?-1:1,y=Q.subtract(h,p,_we),C=_*Q.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:E,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:I}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(E)&&(n-=s,n=n-Math.floor(n),n=n*c.x+c.y),m=(m+Math.PI/2)/Math.PI,l(I)&&(m=m*u.x+u.y),C=1+C*a,d.fromElements(n,m,C,t)};var Cwe=new d,Ewe=new d,eDt=new d;Gd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,Cwe),a=d.multiplyByScalar(r,o,Cwe),s=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Ewe),o,Ewe),c=d.add(s,a,eDt),u=ce.subsection(this._rectangle,s.x,s.y,c.x,c.y,Iwe),f=D.lerp(this._minimumHeight,this._maximumHeight,s.z),h=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return Gee(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function Gee(e,t,n,i,o,r,a){return a=en.fromRectangle(e,t,n,i,a),a.center=d.add(a.center,o,a.center),a.halfAxes=J.multiply(a.halfAxes,r,a.halfAxes),a}Gd.DefaultMinBounds=Object.freeze(new d(-D.PI,-D.PI_OVER_TWO,-te.WGS84.minimumRadius));Gd.DefaultMaxBounds=Object.freeze(new d(D.PI,D.PI_OVER_TWO,10*te.WGS84.maximumRadius));var qS=Gd;var Bf={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Bf.getMinBounds=function(e){switch(e){case Bf.BOX:return jS.DefaultMinBounds;case Bf.ELLIPSOID:return qS.DefaultMinBounds;case Bf.CYLINDER:return YS.DefaultMinBounds}};Bf.getMaxBounds=function(e){switch(e){case Bf.BOX:return jS.DefaultMaxBounds;case Bf.ELLIPSOID:return qS.DefaultMaxBounds;case Bf.CYLINDER:return YS.DefaultMaxBounds}};Bf.getShapeConstructor=function(e){switch(e){case Bf.BOX:return jS;case Bf.ELLIPSOID:return qS;case Bf.CYLINDER:return YS}};var Sc=Object.freeze(Bf);var Vee=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function xR(e,t){this.spatialNode=e,this.keyframe=t,this.state=Vee.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}xR.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Vee.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};xR.priorityComparator=function(e,t){return e.priority-t.priority};xR.searchComparator=function(e,t){return e.keyframe-t.keyframe};xR.LoadState=Vee;var Uo=xR;function Wp(e,t,n,i,o=134217728,r){let a=tDt(i),s=nDt(n),c=n*Qt.getSizeInBytes(i),u=Wp.get3DTextureDimension(t,c,o,r),f=d.divideComponents(u,t,new d);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=d.clone(f,new d),this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=f.x*f.y*f.z,this.texture=new m1({context:e,pixelFormat:s,pixelDatatype:a,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new jt({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:si.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let h=0;h<this.maximumTileCount;h++)this.nodes[h]=new iDt(h);for(let h=0;h<this.maximumTileCount;h++){let p=this.nodes[h];p.previousNode=h>0?this.nodes[h-1]:void 0,p.nextNode=h<this.maximumTileCount-1?this.nodes[h+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(Wp.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=jt.NEAREST:this.texture.sampler=new jt({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:si.LINEAR}),this._nearestSampling=e)}}});function tDt(e){if(e===Qt.FLOAT32||e===Qt.FLOAT64)return He.FLOAT;if(e===Qt.UINT8)return He.UNSIGNED_BYTE}function nDt(e){switch(e){case 1:return Ke.RED;case 2:return Ke.RG;case 3:return Ke.RGB;case 4:return Ke.RGBA}}function iDt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Wp.prototype.add=function(e){if(this.isFull())throw new de("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Wp.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new de("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Wp.prototype.isFull=function(){return this.emptyList===void 0};Wp.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=Nt;if(d.maximumComponent(e)>o)throw new ue("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,a=Math.floor(n/r);if(a<1)throw new ue("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,a):i=a;let s=Object.entries(e).sort((f,h)=>h[1]-f[1]),c=s.map(([f,h])=>Math.floor(o/h));for(let f=0;f<3;f++){let h=bwe(c);if(h<i)break;let p=c.slice();p.splice(f,1);let A=p[0]*p[1],m=h-i,_=Math.floor(m/A);c[f]-=_}bwe(c)>a&&(c[2]=Math.floor(a/(c[0]*c[1])));let u=new d;for(let f=0;f<3;f++){let[h,p]=s[f];u[h]=c[f]*p}return u};function bwe(e){return e.reduce((t,n)=>t*n)}Wp.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,a=Math.floor(e/r),s=e-a*r,c=Math.floor(s/n.x),u=s-c*n.x,f={source:o,xOffset:u*i.x,yOffset:c*i.y,zOffset:a*i.z};this.texture.copyFrom(f)};Wp.prototype.isDestroyed=function(){return!1};Wp.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),fe(this)};var V4=Wp;function Vd(e,t,n,i,o,r,a){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=d.clone(a),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var oDt=new d;Vd.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=J.getScale(this.orientedBoundingBox.halfAxes,oDt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};Vd.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,a=i*2,s=o*2,c=a+1,u=r+1,f=s+1,h=t+1,p=[[h,r,a,s],[h,u,a,s],[h,r,c,s],[h,u,c,s],[h,r,a,f],[h,u,a,f],[h,r,c,f],[h,u,c,f]];this.children=p.map(([A,m,_,y])=>new Vd(A,m,_,y,this,e,this.dimensions))};Vd.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Vd.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var xwe={keyframe:0};function TR(e,t){return xwe.keyframe=e,Io(t,xwe,Uo.searchComparator)}Vd.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,a,s=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=rDt(i,h),A=h[p],m=o===i||i<A.keyframe?p:Math.min(p+1,h.length-1),_=h[m],y=i-A.keyframe,C=Twe(n-t.level,y);C<s&&(s=C,r=A);let E=_.keyframe-o,I=Twe(n-t.level,E);if(I<c&&(c=I,a=_),y===0&&E===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=a,!l(r)||!l(a))return;let u=r.keyframe,f=a.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function rDt(e,t){let n=TR(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function Twe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Vd.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Vd.prototype.createKeyframeNode=function(e){let t=TR(e,this.keyframeNodes);if(t<0){t=~t;let n=new Uo(this,e);this.keyframeNodes.splice(t,0,n)}};Vd.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=TR(n,this.keyframeNodes);if(i<0)throw new de("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=TR(n,this.renderableKeyframeNodes);if(o<0)throw new de("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Vd.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new de("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let a=t[r];e.megatextureIndex=a.add(n[r])}let i=this.renderableKeyframeNodes,o=TR(e.keyframe,i);if(o>=0)throw new de("Keyframe already renderable");o=~o,i.splice(o,0,e)};Vd.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var H4=Vd;function EC(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:a}=e,{types:s,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(s.length);let u=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let C=0;C<s.length;C++){let E=s[C],I=It.getComponentCount(E),x=c[C];this.megatextures[C]=new V4(t,a,I,x,i,u),this.textureMemoryByteLength+=this.megatextures[C].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let h=e._shape;this.rootNode=new H4(0,0,0,0,void 0,h,r),this._priorityQueue=new eC({maximumLength:f,comparator:Uo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,Hee(p,1,n-2,0);let A=9,m=2048,_=Math.floor(m/A),y=Math.ceil(f/_);this.internalNodeTexture=new vt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:m,height:y,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST})}),this.internalNodeTilesPerRow=_,this.internalNodeTexelSizeUv=new Q(1/m,1/y),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new Q}EC.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Hee(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,Hee(e,t,o-1,i+1),Hee(e,o+1,n,i+1)}EC.simultaneousRequestCountMaximum=50;EC.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,a=this.megatextures[0].maximumTileCount,s=this._keyframeCount,c=o._levelBlendFactor,u=c>0,f=s>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!l(this.leafNodeTexture)){let I=Math.floor(512),x=Math.ceil(a/I);this.leafNodeTexture=new vt({context:r,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,flipY:!1,width:1024,height:x,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST})}),this.leafNodeTexelSizeUv=Q.fromElements(1/1024,1/x,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=I}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,s-1),n&&Swe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let A=ki();cDt(this,e),lDt(this,e);let m=ki();mDt(this,h,c);let _=ki(),y=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||y){let C=m-A,E=_-m,I=_-A;hDt(this,e,C,E,I)}};EC.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};EC.prototype.isDestroyed=function(){return!1};EC.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),fe(this)};function Swe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];Swe(e,i)}}function aDt(e,t){if(e._simultaneousRequestCount>=EC.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function a(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Uo.LoadState.PROCESSING:Uo.LoadState.UNAVAILABLE}function s(f){e._simultaneousRequestCount--,t.state=Uo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Uo.LoadState.RECEIVING,u.then(a).catch(s))}function sDt(e){return e/(1+e)}function cDt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),wwe(e.rootNode,ns.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,a;for(;i.length>0;)a=i.removeMaximum(),a.highPriorityFrameNumber=n,o[r]=a,r++;e._highPriorityKeyframeNodeCount=r}function lDt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(uDt);let r=e._highPriorityKeyframeNodes,a=e._highPriorityKeyframeNodeCount,s=0,c=0;for(let u=0;u<a;u++){let f=r[u];if(!(f.state===Uo.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Uo.LoadState.UNLOADED&&aDt(e,f),f.state===Uo.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!fDt(h.metadata,e)){f.content=void 0,f.state=Uo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-s,s++;let A=o[p];e._primitive.tileUnload.raiseEvent(),A.spatialNode.destroyKeyframeNode(A,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Uo.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function uDt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function fDt(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:a}=i[o],{x:s,y:c,z:u}=r,f=s*c*u,h=e[o],p=f*a;if(h.length!==p)return!1}return!0}function wwe(e,t,n,i){let{camera:o,context:r,pixelRatio:a,frameNumber:s}=i,{positionWC:c,frustum:u}=o,h=r.drawingBufferHeight/a/u.sseDenominator;if(e.computeScreenSpaceError(c,h),t=e.visibility(i,t),t===ns.MASK_OUTSIDE)return;e.visitedFrameNumber=s;let p=n._primitive,A=p._shape,m=p.screenSpaceError,_=n._priorityQueue,y=n._keyframeCount,C=D.clamp(Math.floor(n._keyframeLocation),0,y-2),E=C+1;if(y===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==y)for(let v=0;v<y;v++)e.createKeyframeNode(v);let{screenSpaceError:I,keyframeNodes:x}=e,S=sDt(I),w=!1;for(let v=0;v<x.length;v++){let R=x[v];R.priority=10*S+dDt(C,R.keyframe,E,n),R.state!==Uo.LoadState.UNAVAILABLE&&R.state!==Uo.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&_.insert(R),R.state===Uo.LoadState.LOADED&&(w=!0)}if(I<m||!w){e.children=void 0;return}l(e.children)||e.constructChildNodes(A);for(let v=0;v<8;v++){let R=e.children[v];wwe(R,t,n,i)}}function dDt(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),a=Math.pow(1-o/r,4),s=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(s,a,.15+.85*a)}function hDt(e,t,n,i,o){let r=e._keyframeCount,a=e.rootNode,s=Object.keys(Uo.LoadState).length,c=new Array(s),u=new Array(s),f=0;for(let w=0;w<s;w++){let v=new Array(r).fill(0);c[w]=v,u[w]=0}function h(w){let v=w.keyframeNodes;for(let R=0;R<v.length;R++){let N=v[R],L=N.keyframe,g=N.state;c[g][L]+=1,u[g]+=1,f++}if(l(w.children))for(let R=0;R<8;R++){let N=w.children[R];h(N)}}h(a),e._primitive.statistics.numberOfTilesWithContentReady=u[Uo.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Uo.LoadState.RECEIVING],A=u[Uo.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||A!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,A),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=A,m&&(p===0&&A===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 y=`KEYFRAMES: ${c[Uo.LoadState.LOADED]}`,C=`UNLOADED: ${u[Uo.LoadState.UNLOADED]} | RECEIVING: ${u[Uo.LoadState.RECEIVING]} | PROCESSING: ${u[Uo.LoadState.PROCESSING]} | LOADED: ${u[Uo.LoadState.LOADED]} | FAILED: ${u[Uo.LoadState.FAILED]} | UNAVAILABLE: ${u[Uo.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,E=Math.round(n*100)/100,I=Math.round(i*100)/100,x=Math.round(o*100)/100,S=`LOAD: ${E} | OCT: ${I} | ALL: ${x}`;console.log(`${y} || ${C} || ${S}`)}var W4={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function mDt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,a=t>=2,s=0,c=0,u=[],f=[];function h(A,m,_,y,C){let E=!1;if(l(A.children))for(let I=0;I<8;I++){let x=A.children[I];x.computeSurroundingRenderableKeyframeNodes(o),x.isRenderable(r)&&(E=!0)}if(E){u[C]=W4.INTERNAL<<16|m,u[_]=y,s++,y=m,C=y*9+1;for(let I=0;I<8;I++){let x=A.children[I];m=s,_=m*9+0,h(x,m,_,y,C+I)}}else{if(e._primitive.tileVisible.raiseEvent(),a){let I=c*5,x=A.renderableKeyframeNodePrevious,S=A.level-x.spatialNode.level,w=x.spatialNode.parent,v=l(w)?w.renderableKeyframeNodePrevious:x,R=pDt(A,i,n),N=S,L=1,g=x.megatextureIndex,b=v.megatextureIndex;f[I+0]=R,f[I+1]=N,f[I+2]=L,f[I+3]=g,f[I+4]=b,u[C]=W4.LEAF<<16|c}else{let I=A.renderableKeyframeNodePrevious,S=A.level-I.spatialNode.level===0?W4.LEAF:W4.PACKED_LEAF_FROM_PARENT;u[C]=S<<16|I.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),ADt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),a&&gDt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function pDt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,a=((t-i)/(o-i)+n-1)/n;return D.clamp(a,0,1)}function ADt(e,t,n,i){let o=Ke.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),a=Math.max(1,t*Math.min(r,n)),s=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(a*s*o);for(let h=0;h<e.length;h++){let p=e[h],A=h*o;for(let m=0;m<o;m++)c[A+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:a,height:s},xOffset:0,yOffset:0};i.copyFrom(f)}function gDt(e,t,n,i){let o=Ke.componentsLength(i.pixelFormat),r=5,a=Math.ceil(e.length/r),s=Math.max(1,t*Math.min(a,n)),c=Math.max(1,Math.ceil(a/n)),u=new Uint8Array(s*c*o);for(let p=0;p<a;p++){let A=e[p*r+0],m=e[p*r+1],_=e[p*r+2],y=e[p*r+3],C=e[p*r+4],E=D.clamp(Math.floor(65536*A),0,65535);u[p*8+0]=E>>>0&255,u[p*8+1]=E>>>8&255,u[p*8+2]=m&255,u[p*8+3]=_&255,u[p*8+4]=y>>>0&255,u[p*8+5]=y>>>8&255,u[p*8+6]=C>>>0&255,u[p*8+7]=C>>>8&255}let h={source:{arrayBufferView:u,width:s,height:c},xOffset:0,yOffset:0};i.copyFrom(h)}var j4=EC;function jp(e){e=e??V.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??jp.DefaultProvider,this._traversal=void 0,this._statistics=new lp,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new d,this._inputDimensions=new d,this._paddingBefore=new d,this._paddingAfter=new d,this._availableLevels=1,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrixOld=P.clone(this._modelMatrix),this._customShader=e.customShader??jp.DefaultCustomShader,this._customShaderCompilationEvent=new _e,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionLocalToWorld=new P,this._transformPositionWorldToLocal=new P,this._transformPlaneLocalToView=new P,this._transformDirectionWorldToLocal=new J,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new ap,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new Q,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new Q,megatextureTextures:[],megatextureTileCounts:new d,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToLocal:new P,transformDirectionViewToLocal:new J,cameraPositionLocal:new d,cameraDirectionLocal:new d,cameraTileCoordinates:new ie,cameraTileUv:new d,ndcSpaceAxisAlignedBoundingBox:new ie,clippingPlanesTexture:void 0,clippingPlanesMatrix:new P,renderBoundPlanesTexture:void 0,stepSize:0,pickColor:new U},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}this.tileLoad=new _e,this.tileVisible=new _e,this.tileFailed=new _e,this.tileUnload=new _e,this.loadProgress=new _e,this.allTilesLoaded=new _e,this.initialTilesLoaded=new _e;let i=this._provider;_Dt(this,i)}function _Dt(e,t){let{shape:n,minBounds:i=Sc.getMinBounds(n),maxBounds:o=Sc.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),Dwe(e);let r=Sc.getShapeConstructor(n);e._shape=new r,e._shapeVisible=vwe(e)}Object.defineProperties(jp.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ca.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];l(e)?this._customShader=e:this._customShader=jp.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var yDt=new ie,CDt=new ie,EDt=new P,IDt=new P,bDt=new d,xDt=new ie;jp.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){PDt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=Dwe(this),r=vDt(this,e);if((o||r)&&(this._shapeVisible=vwe(this),zDt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let a=GDt(t.timeIntervalCollection,this._clock),s=this._traversal,c=s._sampleCount;if(s.update(e,a,o,this._disableUpdate),c!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&XDt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),VDt(this,e)&&(this._shaderDirty=!0);let f=s.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=s.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=Q.clone(s.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(Q4(this,i),this._shaderDirty=!1);let h=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,A=jDt(p,h,CDt);if(A.x===1||A.y===1||A.z===-1||A.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ie.clone(A,n.ndcSpaceAxisAlignedBoundingBox);let _=i.uniformState.inverseView,y=P.multiplyTransformation(this._transformPositionWorldToLocal,_,n.transformPositionViewToLocal);this._transformPlaneLocalToView=P.transpose(y,this._transformPlaneLocalToView);let C=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=J.multiply(this._transformDirectionWorldToLocal,C,n.transformDirectionViewToLocal),n.cameraPositionLocal=P.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=J.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let E=wDt(this,n.cameraPositionLocal,xDt);n.cameraTileCoordinates=ie.fromElements(Math.floor(E.x),Math.floor(E.y),Math.floor(E.z),E.w,n.cameraTileCoordinates),n.cameraTileUv=d.fromElements(E.x-Math.floor(E.x),E.y-Math.floor(E.y),E.z-Math.floor(E.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,TDt(this),SDt(this,e);let I=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;I.boundingVolume=this._shape.boundingSphere,e.commandList.push(I)};function TDt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function SDt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function wDt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,bDt),o=e._availableLevels,r=2**(o-1);return ie.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var BDt=new d,Wee=new d,DDt=new me;function vDt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function PDt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=U.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=Ye(o,!0);let a=e._uniformMap;for(let c in r)if(r.hasOwnProperty(c)){let u=`u_${c}`;a[u]=function(){return r[c]}}if(e._dimensions=d.clone(t.dimensions,e._dimensions),i.dimensions=d.clone(e._dimensions,i.dimensions),e._paddingBefore=d.clone(t.paddingBefore??d.ZERO,e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(t.paddingAfter??d.ZERO,e._paddingAfter),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=d.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=d.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===Sg.Y_UP){let c=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=c}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions),e._availableLevels=t.availableLevels??1;let s=t.keyframeCount??1;e._traversal=new j4(e,n,s),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,UDt(e._traversal,i)}function Dwe(e){return SR(e,"_modelMatrix","_modelMatrixOld")+SR(e,"_minBounds","_minBoundsOld")+SR(e,"_maxBounds","_maxBoundsOld")+SR(e,"_minClippingBounds","_minClippingBoundsOld")+SR(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function SR(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var RDt=new d,MDt=new d,NDt=new d,LDt=new d,ODt=new P,FDt=new P;function vwe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=d.clone(e._minBounds,RDt),o=d.clone(e._maxBounds,MDt),r=d.clone(e._minClippingBounds,NDt),a=d.clone(e._maxClippingBounds,LDt),s=P.clone(e._modelMatrix,ODt);if(e.shape===Sc.ELLIPSOID)i.z=To.getHeight(e._minBounds.z,t,n),o.z=To.getHeight(e._maxBounds.z,t,n),r.z=To.getHeight(e._minClippingBounds.z,t,n),a.z=To.getHeight(e._maxClippingBounds.z,t,n);else{let m=d.fromElements(1,1,t,BDt);P.multiplyByScale(s,m,s),P.multiplyByTranslation(s,kDt(e),s)}let c=e._provider,u=c.shapeTransform??P.IDENTITY,f=c.globalTransform??P.IDENTITY,h=P.multiplyTransformation(f,s,FDt);P.multiplyTransformation(h,u,h);let p=e._shape;return p.update(h,i,o,r,a)?(e._transformPositionLocalToWorld=P.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=P.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=P.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var QDt=new d;function kDt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=P.IDENTITY,globalTransform:o=P.IDENTITY}=e._provider,r=P.getTranslation(i,Wee),a=P.multiplyByPoint(e._modelMatrix,r,Wee),s=P.multiplyByPoint(o,a,Wee),u=te.WGS84.cartesianToCartographic(s,DDt),f=0;l(u)&&(f=u.height);let h=To.getHeight(f,t,n);return d.fromElements(0,0,(h-f)/t,QDt)}function UDt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=Q.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=d.clone(i.tileCounts,t.megatextureTileCounts)}function zDt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Ye(t,!0)),n}function GDt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=X.secondsDifference(i.stop,i.start),s=X.secondsDifference(n,i.start)/r;return o+s}function VDt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=P.transpose(P.multiplyTransformation(P.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}jp.prototype.isDestroyed=function(){return!1};jp.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),fe(this)};var Bwe=new Array(new ie(-1,-1,-1,1),new ie(1,-1,-1,1),new ie(-1,1,-1,1),new ie(1,1,-1,1),new ie(-1,-1,1,1),new ie(1,-1,1,1),new ie(-1,1,1,1),new ie(1,1,1,1)),HDt=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),WDt=new Array(new ie,new ie,new ie,new ie,new ie,new ie,new ie,new ie);function jDt(e,t,n){let i=P.fromRotationTranslation(e.halfAxes,e.center,EDt),o=P.multiply(t,i,IDt),r=+Number.MAX_VALUE,a=-Number.MAX_VALUE,s=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=WDt,h=Bwe.length;for(u=0;u<h;u++)P.multiplyByVector(o,Bwe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let A=p.x/p.w,m=p.y/p.w;r=Math.min(r,A),a=Math.max(a,A),s=Math.min(s,m),c=Math.max(c,m)}else for(let A=0;A<3;A++){let m=HDt[u*3+A],_=f[m];if(_.z>=-_.w){let y=p.z+p.w,C=_.z+_.w,E=y/(y-C),I=ie.lerp(p,_,E,yDt),x=I.x/I.w,S=I.y/I.w;r=Math.min(r,x),a=Math.max(a,x),s=Math.min(s,S),c=Math.max(c,S)}}}return r=D.clamp(r,-1,1),s=D.clamp(s,-1,1),a=D.clamp(a,-1,1),c=D.clamp(c,-1,1),n=ie.fromElements(r,s,a,c,n),n}var jee=3e7,YDt=new d(jee,0,0),qDt=new d(0,jee,0),KDt=new d(0,0,jee);function XDt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,u,f,h){i.add({positions:[c,u],width:h,material:Xi.fromType("Color",{color:f})})}function r(c,u,f){let h=c.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function a(c){if(!n.isRenderable(c))return;let u=c.level,h=Math.max(1,5/Math.pow(2,u)),A=[U.RED,U.LIME,U.BLUE][u%3];if(r(c.orientedBoundingBox,A,h),l(c.children))for(let m=0;m<8;m++)a(c.children[m])}r(e._shape.orientedBoundingBox,U.WHITE,5),a(n.rootNode);let s=10;o(d.ZERO,YDt,U.RED,s),o(d.ZERO,qDt,U.LIME,s),o(d.ZERO,KDt,U.BLUE,s),i.update(t)}jp.DefaultCustomShader=new HS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
|
|
{
|
|
material.diffuse = vec3(1.0);
|
|
material.alpha = 1.0;
|
|
}`});function Pwe(){this.ready=!0,this.shape=Sc.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[It.SCALAR],this.componentTypes=[Qt.FLOAT32],this.maximumTileCount=1}Pwe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new WS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};jp.DefaultProvider=new Pwe;var nI=jp;function JDt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let s=(r.properties||{})[i];if(l(s))return s}var Y4=JDt;function ZDt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var q4=ZDt;function $Dt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let s=o.properties[n];if(l(s))return s}}var K4=$Dt;var J4=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??V.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof d1;if(o)this._context=e.contextOptions.createSceneContext(t);else{let u=Ye(e.contextOptions);this._context=new YI(t,u)}let r=this._context,a=l(n);a||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Jn(),this._jobScheduler=new gH,this._frameState=new mH(r,new sH(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!a,this._creditContainer=n,this._canvas=t,this._computeEngine=new eN(r),this._ellipsoid=e.ellipsoid??te.default,this._globe=void 0,this._globeTranslucencyState=new pH,this._primitives=new yu({countReferences:o}),this._groundPrimitives=new yu({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new US,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new uH(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new U,stencil:0,owner:this}),this._depthClearCommand=new ui({depth:1,owner:this}),this._stencilClearCommand=new ui({stencil:0}),this._classificationStencilClearCommand=new ui({stencil:0,renderState:Ve.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new o4(this),this._preUpdate=new _e,this._postUpdate=new _e,this._renderError=new _e,this._preRender=new _e,this._postRender=new _e,this._minimumDisableDepthTestDistance=0,this._debugInspector=new y4,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new _e,this.morphComplete=new _e,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=U.clone(U.BLACK),this._mode=oe.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new qi(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 Wb,this.fog=new hH,this.fog.enabled=te.WGS84.equals(this._ellipsoid),te.WGS84.equals(this._ellipsoid)||(Bo.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Bo(this),this.shadowMap=new AC({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=U.clone(U.WHITE),this._actualInvertClassificationColor=U.clone(this._invertClassificationColor),this._invertClassification=new lR,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new n4,this._brdfLutGenerator=new X8,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new p4(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Bu.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=sl.requestCompletedEvent.addEventListener(J4(this)),this._removeTaskProcessorListenerCallback=Zn.taskCompletedEvent.addEventListener(J4(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let s=new et(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new Bo(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Bo(this),this.preloadFlightCullingVolume=void 0,this._picking=new OH(this),this._defaultView=new OS(this,c,s),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 Kg,this._enableEdgeVisibility=!1,Fwe(this,0,X.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function evt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(J4(e))),n.push(t.terrainProviderChanged.addEventListener(J4(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Nt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Nt.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 Om.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,evt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===oe.SCENE2D?this.morphTo2D(0):e===oe.SCENE3D?this.morphTo3D(0):e===oe.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Bo(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new dH(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Nt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});_i.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function tvt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function Rwe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:a,lightShadowsEnabled:s}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=yg.createPickDerivedCommand(e,t,o,c.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=yg.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=yg.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=yg.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),s&&t.receiveShadows&&(c.shadows=AC.createReceiveDerivedCommand(a,t,n,o,c.shadows)),t.pass===Be.TRANSLUCENT&&l(r)&&r.isSupported()&&(s&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}_i.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,a=!1,s=i.lastDirtyTime;e.lastDirtyTime!==s&&(e.lastDirtyTime=s,e.dirty=!0,a=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),h=l(t.originalCommand),p=o&&!u,A=c&&!f,m=(!o||!c)&&!h,_=n.pickingMetadata&&tvt(e,n);if(e.dirty=e.dirty||p||A||m||_,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:y,shadowMaps:C}=i;y&&e.castShadows&&(t.shadows=AC.createCastDerivedCommand(C,e,a,r,t.shadows)),(u||p)&&(t.logDepth=yg.createLogDepthCommand(e,r,t.logDepth),Rwe(this,t.logDepth.command,a)),(h||m)&&Rwe(this,e,a)};var nvt=new om({pass:ur.RENDER}),Yee=new om({pass:ur.PRELOAD}),qee=new om({pass:ur.PRELOAD_FLIGHT}),ivt=new om({pass:ur.REQUEST_RENDER_MODE_DEFER_CHECK}),Mwe=new le,Kee;function ovt(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return Mwe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Kee=qV.fromBoundingSphere(Mwe,e.camera.positionWC,Kee),Kee}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function Fwe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=X.clone(n,i.time)}_i.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=ovt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof An||this.camera.frustum instanceof Aa),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=U.clone(this.invertClassificationColor,this._actualInvertClassificationColor),lR.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===Xt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var X4=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);X4=P.inverseTransformation(X4,X4);function rvt(e,t,n,i){let o=t._frameState,r=o.context,a=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let s=d.clone(a.center);if(o.mode!==oe.SCENE3D){s=P.multiplyByPoint(X4,s,s);let m=o.mapProjection,_=m.unproject(s);s=m.ellipsoid.cartographicToCartesian(_)}let c,u,{radius:f}=a;l(f)?(c=nc.createGeometry(new nc({radii:new d(f,f,f),vertexFormat:gn.FLAT_VERTEX_FORMAT})),u=P.fromTranslation(s)):(c=Nc.createGeometry(Nc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:gn.FLAT_VERTEX_FORMAT})),u=P.fromRotationTranslation(a.halfAxes,s,new P)),t._debugVolume=new Ln({geometryInstances:new Lt({geometry:jn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new gn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=yg.createLogDepthCommand(e,r).command);let A;l(i)&&(A=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(A)&&(n.framebuffer=A),o.commandList=h}function Df(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&rvt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let a=o.passes;if(!a.pick&&!a.pickVoxel&&!a.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),a.pick||a.depth){if(a.pick&&!a.depth){if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function Nwe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:a,pickingMetadata:s,depth:c}=e.derivedCommands;l(s)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(a)?(e=a.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function Qwe(e,t,n){return t.boundingVolume?.distanceSquaredTo(n)-e.boundingVolume?.distanceSquaredTo(n)}var avt=new d;function Lwe(e,t){let n=d.subtract(e,t,avt),i=Math.max(0,d.magnitude(n));return i*i}function svt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return Lwe(o.center,n)-Lwe(i.center,n)}function cvt(e,t,n){return e.boundingVolume?.distanceSquaredTo(n)-t.boundingVolume?.distanceSquaredTo(n)+D.EPSILON12}function lvt(e,t,n,i,o){Ag(i,Qwe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function uvt(e,t,n,i,o){Ag(i,cvt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function fvt(e,t,n){e.context.uniformState.updatePass(Be.VOXELS);let i=n.commands[Be.VOXELS];i.length=n.indices[Be.VOXELS],Ag(i,Qwe,e.camera.positionWC);for(let o=0;o<i.length;++o)Df(i[o],e,t)}function dvt(e,t,n){e.context.uniformState.updatePass(Be.GAUSSIAN_SPLATS);let i=n.commands[Be.GAUSSIAN_SPLATS];i.length=n.indices[Be.GAUSSIAN_SPLATS],Ag(i,svt,e.camera.positionWC);for(let o=0;o<i.length;++o)Df(i[o],e,t)}var hvt=new Wi,mvt=new Su,pvt=new An,Avt=new Aa;function gvt(e){let{frustum:t}=e;return l(t.fov)?t.clone(hvt):l(t.infiniteProjectionMatrix)?t.clone(mvt):l(t.width)?t.clone(pvt):t.clone(Avt)}function _vt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,a,s){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,a,s)}}return e._executeOITFunction}return e.frameState.passes.render?lvt:uvt}function yvt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:a}=i.passes,s=r||a,c;!s&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=_vt(e);o.uniformState.updatePass(Be.TRANSLUCENT);let f=n.commands[Be.TRANSLUCENT];f.length=n.indices[Be.TRANSLUCENT],u(e,Df,t,f,c)}function Cvt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Be.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let a=n.commands[Be.TRANSLUCENT];i.executeTranslucentCommands(e,Df,t,a,o.depthStencilTexture),i.executeClassificationCommands(e,Df,t,n)}function Evt(e,t,n){e.context.uniformState.updatePass(Be.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Be.CESIUM_3D_TILE_EDGES],r=n.indices[Be.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new U(0,0,0,0)).execute(e.context,t);for(let a=0;a<r;++a)Df(o[a],e,t);t.framebuffer=i}function Jee(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let a=gvt(n);a.near=n.frustum.near,a.far=n.frustum.far;let s=o.passes,c=s.pick||s.pickVoxel;c||Ivt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:A,usePostProcessSelected:m}=e._environmentState,{globeDepth:_,globeTranslucencyFramebuffer:y,sceneFramebuffer:C,frustumCommandsList:E}=e._view,I=E.length,x=e._globeTranslucencyState,S=e._depthClearCommand,w=e._stencilClearCommand,v=e._classificationStencilClearCommand,R=e._depthPlane,N=n.position.z;function L(b,T){r.updatePass(T);let B=b.commands[T],M=b.indices[T];for(let O=0;O<M;++O)Df(B[O],e,t);return M}function g(b,T){r.updatePass(T);let B=b.commands[T],M=b.indices[T];for(let O=0;O<M;++O)Nwe(B[O],e,t)}for(let b=0;b<I;++b){let T=I-b-1,B=E[T];e.mode===oe.SCENE2D?(n.position.z=N-B.near+1,a.far=Math.max(1,B.far-B.near),a.near=1,r.update(o),r.updateFrustum(a)):(a.near=T!==0?B.near*e.opaqueFrustumNearOffset:B.near,a.far=B.far,r.updateFrustum(a)),S.execute(i,t),i.stencilBuffer&&w.execute(i,t),x.translucent?(r.updatePass(Be.GLOBE),x.executeGlobeCommands(B,Df,y,e,t)):L(B,Be.GLOBE),p&&_.executeCopyDepth(i,t),f||(x.translucent?(r.updatePass(Be.TERRAIN_CLASSIFICATION),x.executeGlobeClassificationCommands(B,Df,y,e,t)):L(B,Be.TERRAIN_CLASSIFICATION)),u&&(S.execute(i,t),h&&R.execute(i,t));let M;if(Evt(e,t,B),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let G=e._view.edgeFramebuffer.colorTexture;l(G)?e.context.uniformState.edgeColorTexture=G:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let k=e._view.edgeFramebuffer.idTexture;l(k)?e.context.uniformState.edgeIdTexture=k:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let z=e._view.edgeFramebuffer.depthTexture;l(z)?e.context.uniformState.edgeDepthTexture=z:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(!A||c||f)M=L(B,Be.CESIUM_3D_TILE),M>0&&(p&&(_.prepareColorTextures(i,u),_.executeUpdateDepth(i,t,_.depthStencilTexture)),f||(M=L(B,Be.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let G=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,M=L(B,Be.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),_.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),M=L(B,Be.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=G,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),M>0&&i.stencilBuffer&&v.execute(i,t),M=L(B,Be.CESIUM_3D_TILE_CLASSIFICATION)}if(M>0&&i.stencilBuffer&&w.execute(i,t),fvt(e,t,B),L(B,Be.OPAQUE),dvt(e,t,B),T!==0&&e.mode!==oe.SCENE2D&&(a.near=B.near,r.updateFrustum(a)),yvt(e,t,B),Cvt(e,t,B),i.depthTexture&&e.useDepthPicking&&(p||f)){let G=e._picking.getPickDepth(e,T);G.update(i,_.depthStencilTexture),G.executeCopyDepth(i,t)}if(c||!m)continue;let O=t.framebuffer;t.framebuffer=C.getIdFramebuffer(),a.near=T!==0?B.near*e.opaqueFrustumNearOffset:B.near,a.far=B.far,r.updateFrustum(a),x.translucent?(r.updatePass(Be.GLOBE),x.executeGlobeCommands(B,Nwe,y,e,t)):g(B,Be.GLOBE),u&&(S.framebuffer=t.framebuffer,S.execute(i,t),S.framebuffer=void 0),u&&h&&R.execute(i,t),g(B,Be.CESIUM_3D_TILE),g(B,Be.OPAQUE),g(B,Be.TRANSLUCENT),t.framebuffer=O}}function Ivt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Be.ENVIRONMENT),l(i.skyBoxCommand)&&Df(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Df(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let a;i.useGlobeDepthFramebuffer?a=o.globeDepth.framebuffer:i.usePostProcess?a=o.sceneFramebuffer.framebuffer:a=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,a),t.framebuffer=a}i.isMoonVisible&&i.moonCommand.execute(n,t);let r=e.frameState.panoramaCommandList;for(let a=r.length-1;a>=0;a--){let s=r[a];l(s.shaderProgram)?Df(r[a],e,t):r.splice(a,1)}}function kwe(e){e.context.uniformState.updatePass(Be.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function bvt(e,t){e.context.uniformState.updatePass(Be.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function xvt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,a=r.length,s=[Be.GLOBE,Be.CESIUM_3D_TILE,Be.OPAQUE,Be.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||s.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<a;++f)r[f].commandList.push(u);else if(a===1)r[0].commandList.push(u);else{let f=!1;for(let h=a-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function Uwe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:a}=r;for(let s=0;s<o.length;++s){let c=o[s];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;xvt(e,n,c);for(let f=0;f<u.length;++f){let h=c.passes[f],{camera:p,commandList:A}=h;a.updateCamera(p),c.updatePass(r,f);for(let m=0;m<A.length;++m){let _=A[m];a.updatePass(_.pass);let y=_.derivedCommands.shadows.castCommands[s];Df(y,e,h.passState)}}}}var Tvt=new d;_i.prototype.updateAndExecuteCommands=function(e,t){Qvt(this,e,t),this._environmentState.useWebVR?Svt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===Bu.ROTATE?IC(!0,this,e):Lvt(this,e)};function Svt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;zwe(e),n.createPotentiallyVisibleSet(e),kwe(e),r||Uwe(e);let a=t.viewport;a.x=0,a.y=0,a.width=a.width*.5;let s=Bo.clone(i,e._cameraVR);s.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(s.right,f*.5,Tvt);i.frustum.aspectRatio=a.width/a.height;let p=.5*f*c/u;d.add(s.position,h,i.position),i.frustum.xOffset=p,Jee(e,t),a.x=a.width,d.subtract(s.position,h,i.position),i.frustum.xOffset=-p,Jee(e,t),Bo.clone(s,i)}var wvt=new me(Math.PI,D.PI_OVER_TWO),Bvt=new d,Dvt=new d,vvt=new P,Pvt=new P,Rvt=new d,Mvt=new d,Nvt=new et;function Lvt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,a=et.clone(r,Nvt);t.viewport=a;let s=wvt,c=Bvt;e.mapProjection.project(s,c);let f=d.clone(i.position,Dvt),h=P.clone(i.transform,Pvt),p=i.frustum.clone();i._setTransform(P.IDENTITY);let A=P.computeViewportTransformation(a,0,1,vvt),m=i.frustum.projectionMatrix,_=i.positionWC.y,y=d.fromElements(D.sign(_)*c.x-_,0,-i.positionWC.x,Rvt),C=At.pointToGLWindowCoordinates(m,A,y,Mvt);C.x=Math.floor(C.x);let E=a.x,I=a.width;if(_===0||C.x<=E||C.x>=E+I)IC(!0,e,t);else if(Math.abs(E+I*.5-C.x)<1)a.width=C.x-a.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),IC(!0,e,t),a.x=C.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),IC(!1,e,t);else if(C.x>E+I*.5){a.width=C.x-E;let x=i.frustum.right;i.frustum.right=c.x-_,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),IC(!0,e,t),a.x=C.x,a.width=E+I-C.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=x-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),IC(!1,e,t)}else{a.x=C.x,a.width=E+I-C.x;let x=i.frustum.left;i.frustum.left=-c.x-_,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),IC(!0,e,t),a.x=E,a.width=C.x-E,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=x-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),IC(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function IC(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),zwe(t),i.createPotentiallyVisibleSet(t),e&&(kwe(t),o||Uwe(t)),Jee(t,n)}var Owe=new ns;_i.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,a=this.skyAtmosphere,s=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof An||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(a)){if(l(s))a.setDynamicLighting(P_.fromGlobeFlags(s)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!s.show||s._surface._tilesToRender.length>0;else{let C=r.dynamicLighting;a.setDynamicLighting(C),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=a.update(e,s),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let y=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(y)?y.drawCommand:void 0,n.sunComputeCommand=l(y)?y.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(s)&&s.show&&(!s.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,A=Owe.planes;for(let y=0;y<5;++y)A[y]=p.planes[y];p=Owe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,_=this._specularEnvironmentCubeMap;l(m)&&_?.url!==m?(_=_&&_.destroy(),this._specularEnvironmentCubeMap=new Om(m)):!l(m)&&l(_)&&(_.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Ovt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new _g({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Fvt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,a=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(a!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=a),i.lightShadowsEnabled=!1,!!a){for(let s=0;s<r;++s)if(o[s]!==i.shadowMaps[s]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let s=0;s<r;++s){let c=o[s];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function zwe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),Ovt(e),Fvt(e),e._globe&&e._globe.render(t)}function Qvt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,a=e._view,s=o.passes,c=s.pick||s.pickVoxel;l(a.globeDepth)&&(a.globeDepth.picking=c);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new _4:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;U.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=l(a.globeDepth);h&&(a.globeDepth.update(i,t,a.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),a.globeDepth.clear(i,t,n));let p=a.oit,A=r.useOIT=!c&&l(p)&&p.isSupported();A&&(p.update(i,t,a.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,_=r.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);r.usePostProcessSelected=!1,_&&(a.sceneFramebuffer.update(i,a.viewport,e._hdr,e.msaaSamples),a.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),_=r.usePostProcess=m.ready,r.usePostProcessSelected=_&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=a.globeDepth.framebuffer:_&&(t.framebuffer=a.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let y=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&a.edgeFramebuffer.update(i,a.viewport,e._hdr),y){let E;if(o.invertClassificationColor.alpha===1&&h&&(E=a.globeDepth.framebuffer),l(E)||i.depthTexture){if(e._invertClassification.previousFramebuffer=E,e._invertClassification.update(i,e.msaaSamples,a.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&A){let I=e._invertClassification.unclassifiedCommand,x=I.derivedCommands;x.oit=p.createDerivedCommands(I,i,x.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&a.globeTranslucencyFramebuffer.updateAndClear(e._hdr,a.viewport,i,t)}_i.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:a,useGlobeDepthFramebuffer:s,usePostProcess:c,originalFramebuffer:u}=n,f=s?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(a&&(e.framebuffer=c?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let A=h;s&&!a&&(A=f);let m=this.postProcessStages,_=A.getColorTexture(0),y=p.getColorTexture(0),C=(f??h).getDepthStencilTexture();m.execute(t,_,C,y),m.copy(t,u)}!a&&!c&&s&&(e.framebuffer=u,o.executeCopyColor(t,e))};function kvt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function Uvt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function Gwe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof yu){let o=e.length;for(let r=0;r<o;++r){let a=e.get(r),s=Gwe(a,t,n);l(s)&&s>i&&(i=s)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=t===ot.CLAMP_TO_TERRAIN||t===ot.RELATIVE_TO_TERRAIN,i=t===ot.CLAMP_TO_3D_TILE||t===ot.RELATIVE_TO_3D_TILE;if(!l(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let a=Gwe(this.primitives,e,this);l(a)&&a>o&&(o=a)}let r=this._globe;if(!i&&l(r)&&r.show){let a=r.getHeight(e);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o};var Xee=new me;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=A=>{me.clone(e,Xee);let m;l(A)&&(m=A.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(Xee.height=m,t(Xee))},r=n===ot.CLAMP_TO_TERRAIN||n===ot.RELATIVE_TO_TERRAIN,a=n===ot.CLAMP_TO_3D_TILE||n===ot.RELATIVE_TO_3D_TILE,s;!a&&l(this.globe)&&(s=this.globe._surface.updateHeight(e,o));let c={},u=A=>{if(r||A.isDestroyed()||!A.isCesium3DTileset)return;let m=A.updateHeight(e,o,i);c[A.id]=m};if(!r){let A=this.primitives.length;for(let m=0;m<A;++m){let _=this.primitives.get(m);u(_)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(A=>{A.isDestroyed()||!A.isCesium3DTileset||(l(c[A.id])&&c[A.id](),delete c[A.id])});return()=>{s=s&&s(),Object.values(c).forEach(A=>A()),c={},f(),h()}};function zvt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}_i.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=Uvt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=zvt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Gvt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new hC({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Vvt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Hvt(e){e.primitives.postPassesUpdate(e._frameState),sl.update()}var Wvt=new U;function jvt(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=nvt;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,Wvt),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 a=e.shadowMap;l(a)&&a.enabled&&(!l(e.light)||e.light instanceof Kg?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(a)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let s=o.viewport;s.x=0,s.y=0,s.width=n.drawingBufferWidth,s.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(s,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,bvt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function iI(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Yvt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=X.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(X.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=X.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=D.incrementWrap(t.frameNumber,15e6,1);Fwe(this,o,e),t.newFrame=!0}iI(this,Vvt),this.primitives.show&&(iI(this,Yvt),iI(this,qvt),iI(this,Kvt),i||iI(this,Xvt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),iI(this,jvt)),Gvt(this,i),iI(this,Hvt),kvt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(Nt.minimumAliasedLineWidth,Math.min(e,Nt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof nI))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),a=255*r[0]+r[1],s=o._traversal.findKeyframeNode(a);if(!l(s))return;let c=255*r[2]+r[3];return C4.fromKeyframeNode(o,a,c,s)};_i.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let a=r.schema,s=Y4(a,t,n,i);if(!l(s))return;let c=K4(r,n,i);if(!l(c))return;let u=new q4(t,n,i,s,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function qvt(e){let t=e._frameState;Yee.camera=t.camera,Yee.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Yee)}function Kvt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;qee.camera=e.preloadFlightCamera,qee.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,qee)}function Xvt(e){e.primitives.updateForPass(e._frameState,ivt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return co.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function Jvt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}_i.prototype.setTerrain=function(e){return Jvt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),fe(this)};var Z4=_i;function KS(e){e=e??te.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=P.fromScale(n),this._modelMatrix=new P,this._command=new it({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new d;let i=new d;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(KS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});KS.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Zee=new P;KS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=P.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,Zee),o=P.multiplyTransformation(i,so.Y_UP_TO_Z_UP,Zee),r=P.multiply(this._scaleMatrix,o,Zee);P.clone(r,this._modelMatrix);let a=e.context,s=Zvt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=nc.createGeometry(new nc({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:ke.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:a,geometry:p,attributeLocations:jn.createAttributeLocations(p),bufferUsage:Re.STATIC_DRAW}),f.renderState=Ve.fromCache({cull:{enabled:!0,face:Li.FRONT},blending:sn.ALPHA_BLEND,depthMask:!1})}let h=s|u<<2|c<<3;if(h!==this._flags){this._flags=h;let p=[];s&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let A=new We({defines:p,sources:[Ym,KP,A8]}),m=new We({defines:p,sources:[Ym,KP,p8]});this._spSkyAtmosphere=$t.fromCache({context:a,vertexShaderSource:A,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function Zvt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}KS.prototype.isDestroyed=function(){return!1};KS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),fe(this)};var $4=KS;function wR(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new it({modelMatrix:P.clone(P.IDENTITY),owner:this,pass:Be.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t}Object.defineProperties(wR.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});wR.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r,panoramaCommandList:a}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?c1(r,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ta({context:r,source:c})),this._addToPanoramaCommandList=!0}let s=this._command;if(!l(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Nc.createGeometry(Nc.fromDimensions({dimensions:new d(2,2,2),vertexFormat:ke.POSITION_ONLY})),u=this._attributeLocations=jn.createAttributeLocations(c);s.vertexArray=Vn.fromGeometry({context:r,geometry:c,attributeLocations:u,bufferUsage:Re.STATIC_DRAW}),s.renderState=Ve.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:sn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(s.shaderProgram)||this._useHdr!==t){let c=new We({defines:[t?"HDR":""],sources:[g8]});s.shaderProgram=$t.fromCache({context:r,vertexShaderSource:l(this._transform)?l8:_8,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return s;this._addToPanoramaCommandList&&(a.push(s),this._addToPanoramaCommandList=!1)}};wR.prototype.isDestroyed=function(){return!1};wR.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),fe(this)};var XS=wR;function oI(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new XS({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(oI.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});oI.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==oe.SCENE3D&&n!==oe.MORPHING)&&i.render)return this._panorama.update(e,t)};oI.prototype.isDestroyed=function(){return!1};oI.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),fe(this)};function JS(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}oI.createEarthSkyBox=function(){return new oI({sources:{positiveX:JS("px"),negativeX:JS("mx"),positiveY:JS("py"),negativeY:JS("my"),positiveZ:JS("pz"),negativeZ:JS("mz")}})};var e9=oI;function DR(){this.show=!0,this._drawCommand=new it({primitiveType:Pe.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(DR.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var $vt=new Q,ePt=new Q,tPt=new ie,BR=new ie;DR.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,a=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||a!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=a,this._glowFactorDirty=!1,this._useHdr=n;let x=Math.max(r,a);x=Math.pow(2,Math.ceil(Math.log(x)/Math.log(2))-2),x=Math.max(1,x);let S=n?o.halfFloatingPointTexture?He.HALF_FLOAT:He.FLOAT:He.UNSIGNED_BYTE;this._texture=new vt({context:o,width:x,height:x,pixelFormat:Ke.RGBA,pixelDatatype:S}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let w=this,v={u_radiusTS:function(){return w._radiusTS}};this._commands.computeCommand=new Vl({fragmentShaderSource:C8,outputTexture:this._texture,uniformMap:v,persists:!1,owner:this,postExecute:function(){w._commands.computeCommand=void 0}})}let s=this._drawCommand;if(!l(s.vertexArray)){let x={direction:0},S=new Uint8Array(8);S[0]=0,S[1]=0,S[2]=255,S[3]=0,S[4]=255,S[5]=255,S[6]=0,S[7]=255;let w=tt.createVertexBuffer({context:o,typedArray:S,usage:Re.STATIC_DRAW}),v=[{index:x.direction,vertexBuffer:w,componentsPerAttribute:2,normalize:!0,componentDatatype:j.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT});s.vertexArray=new Vn({context:o,attributes:v,indexBuffer:R}),s.shaderProgram=$t.fromCache({context:o,vertexShaderSource:E8,fragmentShaderSource:y8,attributeLocations:x}),s.renderState=Ve.fromCache({blending:sn.ALPHA_BLEND}),s.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(c,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,s.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,s.boundingVolume);let p=co.computeActualEllipsoidPosition(e,c,BR),A=d.magnitude(d.subtract(p,e.camera.position,BR)),m=o.uniformState.projection,_=tPt;_.x=0,_.y=0,_.z=-A,_.w=1;let y=P.multiplyByVector(m,_,BR),C=co.clipToGLWindowCoordinates(t.viewport,y,$vt);_.x=D.SOLAR_RADIUS;let E=P.multiplyByVector(m,_,BR),I=co.clipToGLWindowCoordinates(t.viewport,E,ePt);return this._size=Q.magnitude(Q.subtract(I,C,BR)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};DR.prototype.isDestroyed=function(){return!1};DR.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),fe(this)};var t9=DR;var Wwe=Na(aM(),1);function nPt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t});
|
|
vec4 clippingPlanesEdgeColor = vec4(1.0);
|
|
clippingPlanesEdgeColor.rgb = ${n}.rgb;
|
|
float clippingPlanesEdgeWidth = ${n}.a;
|
|
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
|
|
{
|
|
out_FragColor = clippingPlanesEdgeColor;
|
|
}
|
|
`}var n9=nPt;var iPt={modifyFragmentShader:function(t){return t=We.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection;
|
|
void main()
|
|
{
|
|
#ifndef SHADOW_MAP
|
|
if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
|
|
if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
|
|
#endif
|
|
czm_splitter_main();
|
|
}
|
|
`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},vR=iPt;var rI={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function PR(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=U.clone(U.DARKGRAY),this._highlightColor=U.clone(U.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=rI.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??Be.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=P.clone(P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.time=0,this.shadows=Bn.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??Qr.NONE,this._splittingEnabled=!1,this._error=void 0,oPt(this,e)}Object.defineProperties(PR.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return U.clone(this._highlightColor)},set:function(e){this._highlightColor=U.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function oPt(e,t){let n=Ix.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=Um.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let s=n.draco;e._decodingState=rI.NEEDS_DECODE,s.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=U.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let a=n.batchIds;l(n.batchIds)&&(a.name="BATCH_ID",a.semantic="BATCH_ID",a.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var rPt=new d,aPt=new d,sPt=new d,Vwe,i9;function cPt(e){if(!l(i9)){Vwe=new Wwe.default(0),i9=new Array(e);for(let t=0;t<e;++t)i9[t]=Vwe.random()}return i9}function lPt(e){let n=e.length/3,i=Math.min(n,20),o=cPt(20),r=Number.MAX_VALUE,a=-Number.MAX_VALUE,s=d.fromElements(r,r,r,rPt),c=d.fromElements(a,a,a,aPt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,sPt);d.minimumByComponent(s,p,s),d.maximumByComponent(c,p,c)}let u=le.fromCornerPoints(s,c);return u.radius+=D.EPSILON2,u}function Hwe(e,t){let n=j.fromTypedArray(e);return n===j.INT||n===j.UNSIGNED_INT||n===j.DOUBLE?(bt("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 uPt=new ie,fPt=new ie,dPt=new U,jwe=0,o9=1,ite=2,Ywe=3,hPt=4,$ee=new P,mPt=new P;function pPt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,a=i.colors,s=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),h=e._isQuantized,p=e._isQuantizedDraco,A=e._isOctEncoded16P,m=e._isOctEncodedDraco,_=e._quantizedRange,y=e._octEncodedRange,C=e._isRGB565,E=e._isTranslucent,I=e._hasColors,x=e._hasNormals,S=e._hasBatchIds,w,v,R=[],N={};if(e._styleableShaderAttributes=N,f){let k=hPt;for(let z in u)if(u.hasOwnProperty(z)){let F=u[z],H=Hwe(F.typedArray,z);w=F.componentCount,v=j.fromTypedArray(H);let Y=tt.createVertexBuffer({context:n,typedArray:H,usage:Re.STATIC_DRAW});e._geometryByteLength+=Y.sizeInBytes;let $={index:k,vertexBuffer:Y,componentsPerAttribute:w,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push($),N[z]={location:k,componentCount:w},++k}}let L=tt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Re.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let g;I&&(g=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Re.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let b;x&&(b=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Re.STATIC_DRAW}),e._geometryByteLength+=b.sizeInBytes);let T;S&&(c.typedArray=Hwe(c.typedArray,"batchIds"),T=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Re.STATIC_DRAW}),e._geometryByteLength+=T.sizeInBytes);let B=[];if(h?v=j.UNSIGNED_SHORT:p?v=_<=255?j.UNSIGNED_BYTE:j.UNSIGNED_SHORT:v=j.FLOAT,B.push({index:jwe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=lPt(r.typedArray)),I)if(C)B.push({index:o9,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:j.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let k=E?4:3;B.push({index:o9,vertexBuffer:g,componentsPerAttribute:k,componentDatatype:j.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}x&&(A?(w=2,v=j.UNSIGNED_BYTE):m?(w=2,v=y<=255?j.UNSIGNED_BYTE:j.UNSIGNED_SHORT):(w=3,v=j.FLOAT),B.push({index:ite,vertexBuffer:b,componentsPerAttribute:w,componentDatatype:v,normalize:!1,offsetInBytes:0,strideInBytes:0})),S&&B.push({index:Ywe,vertexBuffer:T,componentsPerAttribute:1,componentDatatype:j.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(B=B.concat(R));let M=new Vn({context:n,attributes:B}),O={depthTest:{enabled:!0}},G={depthTest:{enabled:!0},depthMask:!1,blending:sn.ALPHA_BLEND};e._opaquePass===Be.CESIUM_3D_TILE&&(O.stencilTest=Yt.setCesium3DTileBit(),O.stencilMask=Yt.CESIUM_3D_TILE_MASK,G.stencilTest=Yt.setCesium3DTileBit(),G.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ve.fromCache(O),e._translucentRenderState=Ve.fromCache(G),e._drawCommand=new it({boundingVolume:new le,cull:e._cull,modelMatrix:new P,primitiveType:Pe.POINTS,vertexArray:M,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:E?e._translucentRenderState:e._opaqueRenderState,pass:E?Be.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function APt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,a={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let s=uPt;if(s.x=e._attenuation?e.maximumAttenuation:e._pointSize,s.x*=t.pixelRatio,s.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===oe.SCENE2D||c instanceof An?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,s.z=e.geometricError*e.geometricErrorScale,s.w=u}return s},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let s=e.clippingPlanes;return e.isClipped?s.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let s=e.clippingPlanes;if(!l(s))return U.TRANSPARENT;let c=U.clone(s.edgeColor,dPt);return c.alpha=s.edgeWidth,c},u_clippingPlanesMatrix:function(){let s=e.clippingPlanes;if(!l(s))return P.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;P.multiply(n.uniformState.view3D,c,$ee);let u=P.multiply($ee,s.modelMatrix,$ee);return P.inverseTranspose(u,mPt)}};vR.addUniforms(e,a),(i||o||r)&&(a=Pt(a,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let s=fPt;if(l(e._quantizedVolumeScale)){let c=d.clone(e._quantizedVolumeScale,s);d.divideByScalar(c,e._quantizedRange,s)}return s.w=e._octEncodedRange,s}})),l(e._uniformMapLoaded)&&(a=e._uniformMapLoaded(a)),e._drawCommand.uniformMap=a}function ete(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 tte(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 nte(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 gPt={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 _Pt(e,t,n){let i,o,r,a=t.context,s=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,A=e._isTranslucent,m=e._hasColors,_=e._hasNormals,y=e._hasBatchIds,C=e._backFaceCulling,E=e._normalShading,I=e._drawCommand.vertexArray,x=e.clippingPlanes,S=e._attenuation,w,v,R,N=A,L=Ye(gPt),g={},b=e._styleableShaderAttributes;for(o in b)b.hasOwnProperty(o)&&(r=b[o],L[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(s){let re={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";w=n.getColorShaderFunction(`getColorFromStyle${ye}`,L,re),v=n.getShowShaderFunction(`getShowFromStyle${ye}`,L,re),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,L,re),l(w)&&re.translucent&&(N=!0)}e._styleTranslucent=N;let T=l(w),B=l(v),M=l(R),O=e.isClipped,G=[],k=[];T&&(ete(w,G),tte(w,k)),B&&(ete(v,G),tte(v,k)),M&&(ete(R,G),tte(R,k));let z=k.indexOf("COLOR")>=0,F=k.indexOf("NORMAL")>=0;if(F&&!_)throw new ue("Style references the NORMAL semantic but the point cloud does not have normals");for(o in b)if(b.hasOwnProperty(o)){r=b[o];let re=G.indexOf(r.location)>=0,ye=nte(I,r.location);ye.enabled=re}let H=m&&(!T||z);if(m){let re=nte(I,o9);re.enabled=H}let Y=_&&(E||C||F);if(_){let re=nte(I,ite);re.enabled=Y}let $={a_position:jwe};H&&($.a_color=o9),Y&&($.a_normal=ite),y&&($.a_batchId=Ywe);let W="",K=G.length;for(i=0;i<K;++i){let re=G[i];r=g[re];let ye=r.componentCount,Ce=`czm_3dtiles_property_${re}`,ve;ye===1?ve="float":ve=`vec${ye}`,W+=`in ${ve} ${Ce};
|
|
`,$[Ce]=r.location}APt(e,t);let Z=`in vec3 a_position;
|
|
out vec4 v_color;
|
|
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
|
|
uniform vec4 u_constantColor;
|
|
uniform vec4 u_highlightColor;
|
|
`;Z+=`float u_pointSize;
|
|
float tiles3d_tileset_time;
|
|
`,S&&(Z+=`float u_geometricError;
|
|
float u_depthMultiplier;
|
|
`),Z+=W,H&&(A?Z+=`in vec4 a_color;
|
|
`:p?Z+=`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;
|
|
`:Z+=`in vec3 a_color;
|
|
`),Y&&(f||h?Z+=`in vec2 a_normal;
|
|
`:Z+=`in vec3 a_normal;
|
|
`),y&&(Z+=`in float a_batchId;
|
|
`),(c||u||h)&&(Z+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
|
|
`),T&&(Z+=w),B&&(Z+=v),M&&(Z+=R),Z+=`void main()
|
|
{
|
|
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
|
|
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
|
|
`,S&&(Z+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
|
|
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
|
|
`),H?A?Z+=` vec4 color = a_color;
|
|
`:p?Z+=` 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);
|
|
`:Z+=` vec4 color = vec4(a_color, 1.0);
|
|
`:Z+=` vec4 color = u_constantColor;
|
|
`,c||u?Z+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
|
|
`:Z+=` vec3 position = a_position;
|
|
`,Z+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
|
|
`,Y?(f?Z+=` vec3 normal = czm_octDecode(a_normal);
|
|
`:h?Z+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
|
|
`:Z+=` vec3 normal = a_normal;
|
|
`,Z+=` vec3 normalEC = czm_normal * normal;
|
|
`):Z+=` vec3 normal = vec3(1.0);
|
|
`,T&&(Z+=` color = getColorFromStyle(position, position_absolute, color, normal);
|
|
`),B&&(Z+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
|
|
`),M?Z+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
|
|
`:S?Z+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
|
|
float depth = -positionEC.z;
|
|
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
|
|
`:Z+=` gl_PointSize = u_pointSize;
|
|
`,Z+=` color = color * u_highlightColor;
|
|
`,Y&&E&&(Z+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
|
|
diffuseStrength = max(diffuseStrength, 0.4);
|
|
color.xyz *= diffuseStrength * czm_lightColor;
|
|
`),Z+=` v_color = color;
|
|
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
|
|
`,Y&&C&&(Z+=` float visible = step(-normalEC.z, 0.0);
|
|
gl_Position *= visible;
|
|
gl_PointSize *= visible;
|
|
`),B&&(Z+=` gl_Position.w *= float(show);
|
|
gl_PointSize *= float(show);
|
|
`),Z+=`}
|
|
`;let pe=`in vec4 v_color;
|
|
`;O&&(pe+=`uniform highp sampler2D u_clippingPlanes;
|
|
uniform mat4 u_clippingPlanesMatrix;
|
|
uniform vec4 u_clippingPlanesEdgeStyle;
|
|
`,pe+=`
|
|
`,pe+=SS(x,a),pe+=`
|
|
`),pe+=`void main()
|
|
{
|
|
out_FragColor = czm_gammaCorrect(v_color);
|
|
`,O&&(pe+=n9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),pe+=`}
|
|
`,e.splitDirection!==Qr.NONE&&(pe=vR.modifyFragmentShader(pe)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(pe=e._fragmentShaderLoaded(pe));let ge=e._drawCommand;l(ge.shaderProgram)&&ge.shaderProgram.destroy(),ge.shaderProgram=$t.fromCache({context:a,vertexShaderSource:Z,fragmentShaderSource:pe,attributeLocations:$});try{ge.shaderProgram._bind()}catch{throw new ue("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function yPt(e,t){if(e._decodingState===rI.READY)return!1;if(e._decodingState===rI.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=C_.decodePointCloud(i,t);l(o)&&(e._decodingState=rI.DECODING,o.then(function(r){e._decodingState=rI.READY;let a=l(r.POSITION)?r.POSITION.array:void 0,s=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,u=l(r.NORMAL)?r.NORMAL.array:void 0,f=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=l(a)&&l(r.POSITION.data.quantization),p=l(u)&&l(r.NORMAL.data.quantization);if(h){let y=r.POSITION.data.quantization,C=y.range;e._quantizedVolumeScale=d.fromElements(C,C,C),e._quantizedVolumeOffset=d.unpack(y.minValues),e._quantizedRange=(1<<y.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let A=n.styleableProperties,m=i.batchTableProperties;for(let y in m)if(m.hasOwnProperty(y)){let C=r[y];l(A)||(A={}),A[y]={typedArray:C.array,componentCount:C.data.componentsPerAttribute}}l(a)&&(n.positions={typedArray:a});let _=c??s;l(_)&&(n.colors={typedArray:_}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=A}).catch(function(r){e._decodingState=rI.FAILED,e._error=r}))}return!0}var CPt=new ie,EPt=new d;PR.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(yPt(this,t))return;let i=!1,o=!P.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(pPt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){P.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(P.clone(this._modelMatrix,u),l(this._rtcCenter)&&P.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&P.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=P.getColumn(u,3,CPt);ie.equals(p,ie.UNIT_W)||At.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;P.multiplyByPoint(u,h,h);let p=P.getScale(u,EPt);f.radius*=d.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!==Qr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&_Pt(this,e,this._style),this._drawCommand.castShadows=Bn.castShadows(this.shadows),this._drawCommand.receiveShadows=Bn.receiveShadows(this.shadows);let a=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=a?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=a?Be.TRANSLUCENT:this._opaquePass;let s=e.commandList,c=e.passes;(c.render||c.pick)&&s.push(this._drawCommand)};PR.prototype.isDestroyed=function(){return!1};PR.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),fe(this)};var r9=PR;function sI(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.shadows=e.shadows??Bn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new TA(e.shading),this.style=e.style,this.frameFailed=new _e,this.frameChanged=new _e,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new O_,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(sI.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ca.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function IPt(e){return`uniform vec4 czm_pickColor;
|
|
${e}`}function bPt(e){return function(t){return Pt(t,{czm_pickColor:function(){return e._pickId.color}})}}function xPt(){return"czm_pickColor"}sI.prototype.makeStyleDirty=function(){this._styleDirty=!0};sI.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var TPt=new X;function rte(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function aI(e,t){return e._intervals.indexOf(t.start)}function SPt(e,t){let n=e._intervals,i=e._clock,o=rte(e);if(o===0)return;let r=e._getAverageLoadTime(),a=X.addSeconds(i.currentTime,r*o,TPt),s=n.indexOf(a),c=aI(e,t);return s===c&&(o>=0?++s:--s),n.get(s)}function wPt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function BPt(e,t,n){let i=rte(e),o=aI(e,t),r=aI(e,n);return i>=0?o>=r:o<=r}function Kwe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function DPt(e,t,n){let i=aI(e,t),o=e._frames,r=o[i];if(!l(r)){let a=t.data.transform,s=l(a)?P.fromArray(a):void 0,c=t.data.uri;r={pointCloud:void 0,transform:s,timestamp:ki(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,De.fetchArrayBuffer({url:c}).then(function(u){r.pointCloud=new r9({arrayBuffer:u,cull:!0,fragmentShaderLoaded:IPt,uniformMapLoaded:bPt(e),pickIdLoaded:xPt})}).catch(Kwe(e,c))}return r}function vPt(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 PPt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,a=r.length;if(Xwe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=a,t.sequential)){let s=(ki()-t.timestamp)/1e3;vPt(e,s)}}t.touchedFrameNumber=i.frameNumber}var RPt=new P;function MPt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function NPt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var LPt=new TA;function Xwe(e,t,n,i){let o=e.shading??LPt,r=t.pointCloud,a=t.transform??P.IDENTITY;r.modelMatrix=P.multiplyTransformation(e.modelMatrix,a,RPt),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=MPt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=NPt(e);try{r.update(i)}catch(s){Kwe(e,t.uri)(s)}t.touchedFrameNumber=i.frameNumber}function ote(e,t,n,i){let o=DPt(e,t,i);PPt(e,o,n,i)}function OPt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function Jwe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let a=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=a.geometryByteLength),l(a)&&a.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function FPt(e,t){let n=aI(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function qwe(e,t,n,i,o){return l(n)?n.ready?!0:(ote(e,t,i,o),n.ready):!1}function QPt(e,t,n,i,o){let r,a,s,c=e._intervals,u=e._frames,f=aI(e,n),h=aI(e,t);if(f>=h){for(r=f;r>=h;--r)if(a=c.get(r),s=u[r],qwe(e,a,s,i,o))return a}else for(r=f;r<=h;++r)if(a=c.get(r),s=u[r],qwe(e,a,s,i,o))return a;return t}function kPt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let a=i[r];l(a)&&l(a.pointCloud)&&(a.pointCloud.clippingPlanesDirty=t,a.pointCloud.styleDirty=n)}}var ZS={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};sI.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=X.clone(e.time));let t=Math.max(X.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let a=this._styleDirty;this._styleDirty=!1,(o||a)&&kPt(this,o,a),ZS.timeSinceLoad=t,ZS.isClipped=r;let s=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,A=wPt(this);if(!l(A))return;let m=!1,_=rte(this),y=_===0;_!==this._clockMultiplier&&(m=!0,this._clockMultiplier=_),(!l(h)||y)&&(h=A),(!l(p)||m||BPt(this,A,p))&&(p=SPt(this,A)),h=QPt(this,h,A,ZS,e);let C=FPt(this,h);l(C)||(ote(this,h,ZS,e),C=this._lastRenderedFrame),l(C)&&Xwe(this,C,ZS,e),l(p)&&ote(this,p,ZS,e);let E=this;l(C)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(C)&&C!==this._lastRenderedFrame&&E.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return E.frameChanged.raiseEvent(E),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=C;let I=this._totalMemoryUsageInBytes,x=this.maximumMemoryUsage*1024*1024;I>x&&Jwe(this,OPt(e));let w=u.length-f;l(s)&&s.attenuation&&s.eyeDomeLighting&&w>0&&c.update(e,f,s,this.boundingSphere)};sI.prototype.isDestroyed=function(){return!1};sI.prototype.destroy=function(){return Jwe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),fe(this)};var RR=sI;function eBe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function UPt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,a=i-t;a>r&&(e.resize(),e.render(),t=i-a%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 tBe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function nBe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=tBe(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 iBe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Ko(e,t){e=zn(e),t=t??V.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=hn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=hn.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 s=document.createElement("div");s.className="cesium-widget-credits";let c=l(t.creditContainer)?zn(t.creditContainer):n;c.appendChild(s);let u=l(t.creditViewport)?zn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=s,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new _e,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new hp,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),nBe(this);try{let p=t.ellipsoid??te.default,A=new Z4({canvas:i,contextOptions:t.contextOptions,creditContainer:s,creditViewport:u,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=A,A.camera.constrainedAxis=d.UNIT_Z,tBe(this),iBe(this);let m=t.globe;l(m)||(m=new H8(p)),m!==!1&&(A.globe=m,A.globe.shadows=t.terrainShadows??Bn.RECEIVE_ONLY);let _=t.skyBox;!l(_)&&te.WGS84.equals(p)&&(_=e9.createEarthSkyBox()),_!==!1&&(A.skyBox=_,A.sun=new t9,te.WGS84.equals(p)&&(A.moon=new K8));let y=t.skyAtmosphere;!l(y)&&te.WGS84.equals(p)&&(y=new $4(p),y.show=t.globe!==!1&&m.show),y!==!1&&(A.skyAtmosphere=y);let C=t.baseLayer;t.globe!==!1&&C!==!1&&(l(C)||(C=Ta.fromWorldImagery()),A.imageryLayers.add(C)),l(t.terrainProvider)&&t.globe!==!1&&(A.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&A.setTerrain(t.terrain),this._screenSpaceEventHandler=new Ld(i),l(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let E=this;this._onRenderError=function(R,N){E._useDefaultRenderLoop=!1,E._renderLoopRunning=!1,E._showRenderLoopErrors&&E.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,N)},A.renderError.addEventListener(this._onRenderError);let I=t.dataSources,x=!1;l(I)||(I=new ez,x=!0);let S=new Kz({scene:A,dataSourceCollection:I}),w=new Hr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=I,this._destroyDataSourceCollection=x,this._dataSourceDisplay=S,this._eventHelper=w,this._canAnimateUpdateCallback=this._updateCanAnimate,w.add(this._clock.onTick,Ko.prototype._onTick,this),w.add(A.morphStart,Ko.prototype._clearTrackedObject,this),w.add(I.dataSourceAdded,Ko.prototype._onDataSourceAdded,this),w.add(I.dataSourceRemoved,Ko.prototype._onDataSourceRemoved,this),w.add(A.postRender,Ko.prototype._postRender,this);let v=I.length;for(let R=0;R<v;R++)this._dataSourceAdded(I,I.get(R));this._dataSourceAdded(void 0,S.defaultDataSource),w.add(I.dataSourceAdded,Ko.prototype._dataSourceAdded,this),w.add(I.dataSourceRemoved,Ko.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Ko.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&UPt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,ate(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(P.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,eBe(this.clock,e))}}});Ko.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 a=document.createElement("div");a.className="cesium-widget-errorPanel-header",a.appendChild(document.createTextNode(e)),r.appendChild(a);let s=document.createElement("div");s.className="cesium-widget-errorPanel-scroll",r.appendChild(s);function c(){s.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let A=document.createElement("div");if(A.className="cesium-widget-errorPanel-message",s.appendChild(A),f){let m=vA(n);u||(typeof n=="string"&&(n=new Error(n)),t=vA({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e}
|
|
${t}
|
|
${m}`);let _=document.createElement("div");_.className="cesium-widget-errorPanel-message-details collapsed";let y=document.createElement("span");y.className="cesium-widget-errorPanel-more-details",y.appendChild(document.createTextNode("See more...")),_.appendChild(y),_.onclick=function(C){_.removeChild(y),_.appendChild(document.createTextNode(m)),_.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",_.onclick=void 0},s.appendChild(_)}A.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Ko.prototype.isDestroyed=function(){return!1};Ko.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),fe(this)};Ko.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,nBe(this),iBe(this),this._scene.requestRender())};Ko.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Ko.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ko.prototype._onEntityCollectionChanged,this)};Ko.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ko.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Ko.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var zPt=new le;Ko.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??zPt)===Ct.DONE&&i.update(t)}};Ko.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)}};Ko.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ko.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&eBe(this.clock,e)};Ko.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ko.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ko.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}};Ko.prototype.zoomTo=function(e,t){return oBe(this,e,{offset:t},!1)};Ko.prototype.flyTo=function(e,t){return oBe(this,e,t,!0)};function oBe(e,t,n,i){ate(e);let o=new Promise(r=>{e._completeZoom=function(a){r(a)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Ta){let a;l(r.imageryProvider)?a=Promise.resolve(r.getImageryRectangle()):a=new Promise(s=>{let c=r.readyEvent.addEventListener(()=>{c(),s(r.getImageryRectangle())})}),a.then(function(s){return TS(s,e.scene)}).then(function(s){e._zoomPromise===o&&(e._zoomTarget=s)});return}if(r instanceof cs||r instanceof RR||r instanceof nI||r instanceof ss){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let a=r.loadingEvent.addEventListener(function(){a(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function MR(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function ate(e){let t=e._zoomPromise;l(t)&&(MR(e),e._completeZoom(!1))}Ko.prototype._postRender=function(){GPt(this),VPt(this)};var Zwe=new le;function GPt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function a(f){l(o.offset)||(o.offset=new Vh(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(P.IDENTITY),e._completeZoom(!0)),MR(e)}if(t instanceof RR){if(l(t.boundingSphere)){a(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){a(h.boundingSphere),f()});return}if(t instanceof cs||t instanceof nI){a(t.boundingSphere);return}if(t instanceof ss){a(t.boundingVolume);return}if(t instanceof me){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)),MR(e);return}let s=t,c=[];for(let f=0,h=s.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(s[f],!1,Zwe);if(p===Ct.PENDING)return;p!==Ct.FAILED&&c.push(le.clone(Zwe))}if(c.length===0){ate(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(c);e._zoomIsFlight?(MR(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(P.IDENTITY),MR(e),e._completeZoom(!0))}var $we=new le;function VPt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=q.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,$we);if(r===Ct.PENDING)return;let a=o.mode;(a===oe.COLUMBUS_VIEW||a===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(a===oe.COLUMBUS_VIEW||a===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let s=r!==Ct.FAILED?$we:void 0;e._entityView=new Jz(t,o,o.ellipsoid),e._entityView.update(n,s),e._needTrackedEntityUpdate=!1}var a9=Ko;var HPt=new d(1,1,1);function ste(e){e=e??HPt,this._dimensions=d.clone(e)}Object.defineProperties(ste.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){d.clone(e,this._dimensions)}}});var WPt=new d;ste.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,WPt),i=D.randomBetween(-n.x,n.x),o=D.randomBetween(-n.y,n.y),r=D.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var rBe=ste;function Yp(){this.featurePropertiesDirty=!1}Object.defineProperties(Yp.prototype,{featuresLength:{get:function(){de.throwInstantiationError()}},pointsLength:{get:function(){de.throwInstantiationError()}},trianglesLength:{get:function(){de.throwInstantiationError()}},geometryByteLength:{get:function(){de.throwInstantiationError()}},texturesByteLength:{get:function(){de.throwInstantiationError()}},batchTableByteLength:{get:function(){de.throwInstantiationError()}},innerContents:{get:function(){de.throwInstantiationError()}},ready:{get:function(){de.throwInstantiationError()}},tileset:{get:function(){de.throwInstantiationError()}},tile:{get:function(){de.throwInstantiationError()}},url:{get:function(){de.throwInstantiationError()}},batchTable:{get:function(){de.throwInstantiationError()}},metadata:{get:function(){de.throwInstantiationError()},set:function(e){de.throwInstantiationError()}},group:{get:function(){de.throwInstantiationError()},set:function(e){de.throwInstantiationError()}}});Yp.prototype.hasProperty=function(e,t){de.throwInstantiationError()};Yp.prototype.getFeature=function(e){de.throwInstantiationError()};Yp.prototype.applyDebugSettings=function(e,t){de.throwInstantiationError()};Yp.prototype.applyStyle=function(e){de.throwInstantiationError()};Yp.prototype.update=function(e,t){de.throwInstantiationError()};Yp.prototype.pick=function(e,t,n){de.throwInstantiationError()};Yp.prototype.isDestroyed=function(){de.throwInstantiationError()};Yp.prototype.destroy=function(){de.throwInstantiationError()};var aBe=Yp;function NR(e){e=e??V.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new eC({comparator:NR.comparator})}NR.prototype.addSubtree=function(e){let t=new jPt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};NR.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],s=r.subtree.implicitCoordinates;if(e.isEqual(s))return r.subtree}};NR.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 jPt(e,t){this.subtree=e,this.stamp=t}var s9=NR;function LR(e){e=e??V.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:a,paddingBefore:s=d.ZERO.clone(),paddingAfter:c=d.ZERO.clone(),globalTransform:u=P.IDENTITY.clone(),shapeTransform:f=P.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:A,maximumValues:m,maximumTileCount:_}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=a,this._paddingBefore=s,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===Sc.ELLIPSOID?Sg.Z_UP:Sg.Y_UP,this._minimumValues=A,this._maximumValues=m,this._maximumTileCount=_,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new s9}Object.defineProperties(LR.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}}});LR.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();qPt(n);let i=tRt(n,t);await i.load();let{root:o}=n,r=Si(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,a=new Yx({metadataJson:r,schema:i.schema}),s=o.content.extensions["3DTILES_content_voxels"],c=s.class,u=nRt(a,c);Object.assign(u,KPt(o)),l(o.transform)?u.globalTransform=P.unpack(o.transform):u.globalTransform=P.clone(P.IDENTITY),u.dimensions=d.unpack(s.dimensions),u.maximumTileCount=YPt(a),l(s.padding)&&(u.paddingBefore=d.unpack(s.padding.before),u.paddingAfter=d.unpack(s.padding.after));let f=new LR(u),h=new jA(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,Pi.unload(i),f};function YPt(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(mh.TILESET_TILE_COUNT)}function qPt(e){let t=e.root;if(!l(t.content))throw new ue("Root must have content");if(!Si(t.content,"3DTILES_content_voxels"))throw new ue("Root tile content must have 3DTILES_content_voxels extension");if(!Si(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ue("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!Si(e,"3DTILES_metadata"))throw new ue("Tileset must have a metadata schema")}function KPt(e){let t=e.boundingVolume;if(l(t.box))return $Pt(t.box);if(l(t.region))return XPt(t.region);if(Si(t,"3DTILES_bounding_volume_cylinder"))return eRt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ue("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function XPt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],a=e[5],s=P.fromScale(te.WGS84.radii),c=new d(t,n,r),u=new d(i,o,a);return{shape:Sc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:s}}var JPt=new d,ZPt=new J;function $Pt(e){let t=en.unpack(e),n=J.getScale(t.halfAxes,JPt),i=J.getRotation(t.halfAxes,ZPt);return{shape:Sc.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:P.fromRotationTranslation(i,t.center)}}function eRt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-D.PI,maxAngle:r=D.PI,translation:a=[0,0,0],rotation:s=[0,0,0,1]}=e,c=-.5*i+a[2],u=.5*i+a[2],f=P.fromTranslationQuaternionRotationScale(d.unpack(a),Qe.unpack(s),d.ONE);return{shape:Sc.CYLINDER,minBounds:d.fromElements(t,o,c),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function tRt(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Pi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Pi.getSchemaLoader({schema:i})}function nRt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,a=Object.entries(r).map(([A,m])=>{let{type:_,componentType:y}=m,C=o?.properties[A].min,E=o?.properties[A].max,I=It.getComponentCount(_),x=sBe(C,I),S=sBe(E,I);return{id:A,type:_,componentType:y,minValue:x,maxValue:S}}),s=a.map(A=>A.id),c=a.map(A=>A.type),u=a.map(A=>A.componentType),f=a.map(A=>A.minValue),h=a.map(A=>A.maxValue),p=f.some(l);return{className:t,names:s,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?h:void 0}}function sBe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function iRt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),a=n.baseResource.getDerivedResource({url:r.url}),s=await a.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=cy(s);return o=await T_.fromSubtreeJson(a,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}LR.prototype.requestData=async function(e){e=e??V.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let a=this._implicitTileset,s=new YA({subdivisionScheme:a.subdivisionScheme,subtreeLevels:a.subtreeLevels,level:t,x:n,y:i,z:o}),c=s.isSubtreeRoot()&&s.level>0,u=c?s.getParentSubtreeCoordinates():s.getSubtreeCoordinates(),h=await iRt(this,u);if(!(c?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,s))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:_}=a,y=m[0].getDerivedResource({templateValues:s.getTemplateValues()}),C=_.getDerivedResource({url:y.url});return WS.fromGltf(C)};var cBe=LR;function cte(e){e=e??1,this._radius=e??1}Object.defineProperties(cte.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});cte.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var c9=cte;var lte={CUMULUS:0};lte.validate=function(e){return e===lte.CUMULUS};var OR=Object.freeze(lte);function cm(e,t){if(e=e??V.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new Q(this._maximumSize.x,this._maximumSize.y);else{this._scale=Q.clone(e.scale??new Q(20,12));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=U.clone(e.color??U.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var oRt=cm.SHOW_INDEX=0,rRt=cm.POSITION_INDEX=1,aRt=cm.SCALE_INDEX=2,sRt=cm.MAXIMUM_SIZE_INDEX=3,cRt=cm.SLICE_INDEX=4,lRt=cm.BRIGHTNESS_INDEX=5,uRt=cm.COLOR_INDEX=6;cm.NUMBER_OF_PROPERTIES=7;function cI(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(cm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,cI(this,oRt))}},position:{get:function(){return this._position},set:function(e){let t=this._position;d.equals(t,e)||(d.clone(e,t),cI(this,rRt))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;Q.equals(t,e)||(Q.clone(e,t),cI(this,aRt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),cI(this,sRt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),cI(this,uRt))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,cI(this,cRt))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,cI(this,lRt))}}});cm.prototype._destroy=function(){this._cloudCollection=void 0};var Hd=cm;var vf,l9=new d,fRt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},dRt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},hRt=Hd.SHOW_INDEX,mRt=Hd.POSITION_INDEX,pRt=Hd.SCALE_INDEX,ARt=Hd.MAXIMUM_SIZE_INDEX,gRt=Hd.SLICE_INDEX,_Rt=Hd.BRIGHTNESS_INDEX,yRt=Hd.NUMBER_OF_PROPERTIES,CRt=Hd.COLOR_INDEX;function lm(e){e=e??V.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(yRt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=d.clone(e.noiseOffset??d.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:lBe(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 lBe(e){return function(){return l9.x=e._textureSliceWidth,l9.y=e._noiseTextureRows,l9.z=1/e._noiseTextureRows,l9}}Object.defineProperties(lm.prototype,{length:{get:function(){return fte(this),this._clouds.length}}});function uBe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}lm.prototype.add=function(e){e=e??V.EMPTY_OBJECT;let t=e.cloudType??OR.CUMULUS,n;return t===OR.CUMULUS&&(n=new Hd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};lm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};lm.prototype.removeAll=function(){uBe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function fte(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 a=n[o];l(a)&&(n._index=r++,t.push(a))}e._clouds=t}}lm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};lm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};lm.prototype.get=function(e){return fte(this),this._clouds[e]};var ERt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),IRt=new Uint16Array([0,1,2,0,2,3]);function bRt(e){let t=tt.createVertexBuffer({context:e,typedArray:ERt,usage:Re.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:IRt,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:j.FLOAT}];return new Vn({context:e,attributes:i,indexBuffer:n})}var dte;function xRt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,a=0;r<i;r+=6,a+=4)o[r]=a,o[r+1]=a+1,o[r+2]=a+2,o[r+3]=a,o[r+4]=a+2,o[r+5]=a+3;return n=tt.createIndexBuffer({context:e,typedArray:o,usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function TRt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Re.STATIC_DRAW,indexDatatype:Ue.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function SRt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Re.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function wRt(e,t,n){let i=[{index:vf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:vf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:vf.packedAttribute0,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:vf.packedAttribute1,componentsPerAttribute:4,componentDatatype:j.FLOAT,usage:Re.STATIC_DRAW},{index:vf.color,componentsPerAttribute:4,componentDatatype:j.UNSIGNED_BYTE,normalize:!0,usage:Re.STATIC_DRAW}];n&&i.push({index:vf.direction,componentsPerAttribute:2,componentDatatype:j.FLOAT,vertexBuffer:SRt(e)});let o=n?t:4*t;return new Zg(e,i,o,n)}var ute=new xn;function fBe(e,t,n,i){let o,r=n[vf.positionHighAndScaleX],a=n[vf.positionLowAndScaleY],s=i.position;xn.fromCartesian(s,ute);let c=i.scale,u=ute.high,f=ute.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,c.x),a(o,f.x,f.y,f.z,c.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,c.x),r(o+1,u.x,u.y,u.z,c.x),r(o+2,u.x,u.y,u.z,c.x),r(o+3,u.x,u.y,u.z,c.x),a(o+0,f.x,f.y,f.z,c.y),a(o+1,f.x,f.y,f.z,c.y),a(o+2,f.x,f.y,f.z,c.y),a(o+3,f.x,f.y,f.z,c.y))}function dBe(e,t,n,i){let o,r=n[vf.packedAttribute0],a=i.show,s=i.brightness;e._instanced?(o=i._index,r(o,a,s,0,0)):(o=i._index*4,r(o+0,a,s,0,0),r(o+1,a,s,1,0),r(o+2,a,s,1,1),r(o+3,a,s,0,1))}function hBe(e,t,n,i){let o,r=n[vf.packedAttribute1],a=i.maximumSize,s=i.slice;e._instanced?(o=i._index,r(o,a.x,a.y,a.z,s)):(o=i._index*4,r(o+0,a.x,a.y,a.z,s),r(o+1,a.x,a.y,a.z,s),r(o+2,a.x,a.y,a.z,s),r(o+3,a.x,a.y,a.z,s))}function mBe(e,t,n,i){let o,r=n[vf.color],a=i.color,s=U.floatToByte(a.red),c=U.floatToByte(a.green),u=U.floatToByte(a.blue),f=U.floatToByte(a.alpha);e._instanced?(o=i._index,r(o,s,c,u,f)):(o=i._index*4,r(o+0,s,c,u,f),r(o+1,s,c,u,f),r(o+2,s,c,u,f),r(o+3,s,c,u,f))}function BRt(e,t,n,i){fBe(e,t,n,i),dBe(e,t,n,i),hBe(e,t,n,i),mBe(e,t,n,i)}function DRt(e,t,n,i){let o=e,r=o._textureSliceWidth,a=o._noiseTextureRows,s=t.context;o._vaNoise=bRt(s),o._spNoise=$t.fromCache({context:s,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new vt({context:s,width:r*r/a,height:r*a,pixelDatatype:He.UNSIGNED_BYTE,pixelFormat:Ke.RGBA,sampler:new jt({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST})});let f=new Vl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:lBe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function vRt(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=wRt(i,r,n._instanced);let a=n._vaf.writers,s;for(s=0;s<r;++s){let c=o[s];BRt(e,t,a,c)}n._vaf.commit(dte(i))}}var PRt=[];function RRt(e,t){let n=t.context,i=e,r=i._clouds.length,a=i._cloudsToUpdate,s=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=PRt;u.length=0,(c[mRt]||c[pRt])&&u.push(fBe),(c[hRt]||c[_Rt])&&u.push(dBe),(c[ARt]||c[gRt])&&u.push(hBe),c[CRt]&&u.push(mBe);let f=u.length,h=i._vaf.writers,p,A,m;if(s/r>.1){for(p=0;p<s;++p)for(A=a[p],A._dirty=!1,m=0;m<f;++m)u[m](e,t,h,A);i._vaf.commit(dte(n))}else{for(p=0;p<s;++p){for(A=a[p],A._dirty=!1,m=0;m<f;++m)u[m](e,t,h,A);i._instanced?i._vaf.subCommit(A._index,1):i._vaf.subCommit(A._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function MRt(e,t,n,i){let o=t.context,r=e,a=new We({defines:[],sources:[n]});r._instanced&&a.defines.push("INSTANCED");let s=new We({defines:[],sources:[i]});r.debugBillboards&&s.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&s.defines.push("DEBUG_ELLIPSOIDS"),r._sp=$t.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:a,fragmentShaderSource:s,attributeLocations:vf}),r._rs=Ve.fromCache({depthTest:{enabled:!0,func:ee.LESS},depthMask:!1,blending:sn.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function NRt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let a=n._colorCommands,s=n._vaf.va,c=s.length;a.length=c;for(let u=0;u<c;u++){let f=a[u];l(f)||(f=a[u]=new it),f.pass=Be.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=s[u].indicesCount,f.vertexArray=s[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}lm.prototype.update=function(e){if(fte(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&DRt(this,e,a8,r8),this._instanced=e.context.instancedArrays,vf=this._instanced?dRt:fRt,dte=this._instanced?TRt:xRt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?vRt(this,e):r>0&&RRt(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&MRt(this,e,o8,i8),NRt(this,e))};lm.prototype.isDestroyed=function(){return!1};lm.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(),uBe(this._clouds),fe(this)};var pBe=lm;var LRt=D.toRadians(30);function hte(e){this._angle=e??LRt}Object.defineProperties(hte.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});hte.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),a=1;e.velocity=d.fromElements(o,r,a,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var ABe=hte;var ORt=new U,FRt=new U,QRt=new U,kRt=new U,gBe=new ie,FR=new Uint8Array(4);function _Be(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return U.lerp(t.color,n.color,o,i)}function u9(e,t){return{height:e,color:U.clone(t)}}function yBe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,a=o?t.height===i[n-1].height:!0,s=r?t.height===i[n+1].height:!0;return!a||!s}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,a=o?U.equals(t.color,i[n-1].color):!1,s=r?U.equals(t.color,i[n+1].color):!1;return!a||!s}),e=e.filter(function(t,n,i){let o=n>0,r=o?U.equals(t.color,i[n-1].color):!1,a=o?t.height===i[n-1].height:!0;return!r||!a}),e}function URt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],a=r.entries,s=a.length,c=[];for(n=0;n<s;n++){let A=a[n],m=D.clamp(A.height,Du._minimumHeight,Du._maximumHeight),_=U.clone(A.color,ORt);_.red*=_.alpha,_.green*=_.alpha,_.blue*=_.alpha,c.push(u9(m,_))}let u=!0,f=!0;for(n=0;n<s-1;n++){let A=c[n+0],m=c[n+1];u=u&&A.height<=m.height,f=f&&A.height>=m.height}f?c=c.reverse():u||Ag(c,function(A,m){return D.sign(A.height-m.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!h&&!p&&(h=!0,p=!0),h&&c.splice(0,0,u9(Du._minimumHeight,c[0].color)),p&&c.splice(c.length,0,u9(Du._maximumHeight,c[c.length-1].color)),c=yBe(c),i.push(c)}return i}function zRt(e){let t=URt(e),n=[],i=[],o;function r(u,f){n.push(u9(u,f))}function a(u,f,h){let p=U.multiplyByScalar(h,1-f.alpha,kRt);p=U.add(p,f,p),r(u,p)}let s=t.length;for(o=0;o<s;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,A=i.length;for(;f<p||h<A;){let m=f<p?u[f]:void 0,_=f>0?u[f-1]:void 0,y=f<p-1?u[f+1]:void 0,C=h<A?i[h]:void 0,E=h>0?i[h-1]:void 0,I=h<A-1?i[h+1]:void 0;if(l(m)&&l(C)&&m.height===C.height){let x=l(I)&&C.height===I.height,S=!l(E),w=!l(I),v=l(y)&&m.height===y.height,R=!l(_),N=!l(y);x?v?(a(m.height,m.color,C.color),a(m.height,y.color,I.color)):R?(r(m.height,C.color),a(m.height,m.color,I.color)):N?(a(m.height,m.color,C.color),r(m.height,I.color)):(a(m.height,m.color,C.color),a(m.height,m.color,I.color)):S?v?(r(m.height,m.color),a(m.height,y.color,C.color)):N?(r(m.height,m.color),r(m.height,C.color)):(R||r(m.height,m.color),a(m.height,m.color,C.color)):w?v?(a(m.height,m.color,C.color),r(m.height,y.color)):R?(r(m.height,C.color),r(m.height,m.color)):N?a(m.height,m.color,C.color):(a(m.height,m.color,C.color),r(m.height,m.color)):v?(a(m.height,m.color,C.color),a(m.height,y.color,C.color)):R?(r(m.height,C.color),a(m.height,m.color,C.color)):N?(a(m.height,m.color,C.color),r(m.height,C.color)):a(m.height,m.color,C.color),f+=v?2:1,h+=x?2:1}else if(l(m)&&l(C)&&l(E)&&m.height<C.height){let x=_Be(m.height,E,C,QRt);l(_)?l(y)?a(m.height,m.color,x):(a(m.height,m.color,x),r(m.height,x)):(r(m.height,x),a(m.height,m.color,x)),f++}else if(l(C)&&l(m)&&l(_)&&C.height<m.height){let x=_Be(C.height,_,m,FRt);l(E)?l(I)?a(C.height,x,C.color):(a(C.height,x,C.color),r(C.height,x)):(r(C.height,x),a(C.height,x,C.color)),h++}else l(m)&&(!l(C)||m.height<C.height)?(l(C)&&!l(E)&&!l(y)?(r(m.height,m.color),r(m.height,Du._emptyColor),r(C.height,Du._emptyColor)):(!l(C)&&l(E)&&!l(_)&&(r(E.height,Du._emptyColor),r(m.height,Du._emptyColor)),r(m.height,m.color)),f++):l(C)&&(!l(m)||C.height<m.height)&&(r(C.height,C.color),h++)}}return yBe(n)}function Du(e){let{scene:t,layers:n}=e??V.EMPTY_OBJECT,{context:i}=t,o=zRt(n),r=o.length,a,s,c;if(!Du._useFloatTexture(i)){s=He.UNSIGNED_BYTE,c=Ke.RGBA,a=new Uint8Array(r*4);for(let A=0;A<r;A++)ie.packFloat(o[A].height,gBe),ie.pack(gBe,a,A*4)}else{s=He.FLOAT,c=i.webgl2?Ke.RED:Ke.LUMINANCE,a=new Float32Array(r);for(let A=0;A<r;A++)a[A]=o[A].height}let f=vt.create({context:i,pixelFormat:c,pixelDatatype:s,source:{arrayBufferView:a,width:r,height:1},sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:si.NEAREST})}),h=new Uint8Array(r*4);for(let A=0;A<r;A++)o[A].color.toBytes(FR),h[A*4+0]=FR[0],h[A*4+1]=FR[1],h[A*4+2]=FR[2],h[A*4+3]=FR[3];let p=vt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:He.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new jt({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:si.LINEAR})});return Xi.fromType("ElevationBand",{heights:f,colors:p})}Du._useFloatTexture=function(e){return e.floatingPointTexture};Du._maximumHeight=5906376425472;Du._minimumHeight=-5906376425472;Du._emptyColor=new U(0,0,0,0);var CBe=Du;async function GRt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??V.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||bt("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??Ss.defaultApiKey;if(!l(n))return VRt(t);let i,o=Ss.getDefaultCredit();l(o)&&(i=[o]);let r=new De({url:`${Ss.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return cs.fromUrl(r,t)}var EBe={};async function VRt(e){let i=EBe[2275207];l(i)||(i=_a.fromAssetId(2275207),EBe[2275207]=i);let o=await i;return cs.fromUrl(o,e)}var IBe=GRt;async function HRt(e){let t=await cs.fromIonAssetId(96188,e);e=e??V.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new sy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var bBe=HRt;function WRt(e){e=e??V.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=P.clone(e.modelMatrix??P.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Lt({geometry:jn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new Jt(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Lt({geometry:jn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new Jt(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Lt({geometry:jn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new Jt(0,0,1,1)},modelMatrix:o})),t.length>0)return new Ln({asynchronous:!1,geometryInstances:t,appearance:new gn({flat:!0,translucent:!1})})}var xBe=WRt;function QR(e){e=e??V.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
|
|
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
|
|
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
|
|
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
|
|
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
|
|
`;break}let a=`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;
|
|
}`,s=`in ${i} ${o};
|
|
${r}
|
|
void main()
|
|
{
|
|
out_FragColor = getColor();
|
|
}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??a,this._fragmentShaderSource=e.fragmentShaderSource??s,this._renderState=xo.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(QR.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}}});QR.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;QR.prototype.isTranslucent=xo.prototype.isTranslucent;QR.prototype.getRenderState=xo.prototype.getRenderState;var TBe=QR;function f9(e){e=e??V.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this.id=e.id,this._id=void 0,this._primitive=void 0}f9.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!P.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=P.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Lt({geometry:new Oy({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:Qa.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),n=new Lt({geometry:new Oy({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:Qa.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),i=new Lt({geometry:new Oy({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:Qa.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this});this._primitive=new Ln({geometryInstances:[t,n,i],appearance:new Qa,asynchronous:!1})}this._primitive.update(e)}};f9.prototype.isDestroyed=function(){return!1};f9.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};var d9=f9;function jRt(e){this.direction=d.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var SBe=jRt;var 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);
|
|
|
|
// Convert tangent space material normal to eye space
|
|
materialInput.normalEC = normalEC;
|
|
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
|
|
|
|
// Convert view vector to world space
|
|
vec3 positionToEyeEC = -v_positionEC;
|
|
materialInput.positionToEyeEC = positionToEyeEC;
|
|
|
|
czm_material material = czm_getMaterial(materialInput);
|
|
|
|
#ifdef FLAT
|
|
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
|
|
#else
|
|
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
|
|
#endif
|
|
}
|
|
`;var m9=`in vec3 position3DHigh;
|
|
in vec3 position3DLow;
|
|
in vec2 st;
|
|
in float batchId;
|
|
|
|
out vec3 v_positionMC;
|
|
out vec3 v_positionEC;
|
|
out vec2 v_st;
|
|
|
|
void main()
|
|
{
|
|
vec4 p = czm_computePosition();
|
|
|
|
v_positionMC = position3DHigh + position3DLow; // position in model coordinates
|
|
v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates
|
|
v_st = st;
|
|
|
|
gl_Position = czm_modelViewProjectionRelativeToEye * p;
|
|
}
|
|
`;function lI(e){e=e??V.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??m9,this._fragmentShaderSource=e.fragmentShaderSource??h9,this._renderState=xo.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(lI.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 lI.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});lI.VERTEX_FORMAT=ke.POSITION_AND_ST;lI.prototype.getFragmentShaderSource=xo.prototype.getFragmentShaderSource;lI.prototype.isTranslucent=xo.prototype.isTranslucent;lI.prototype.getRenderState=xo.prototype.getRenderState;var wBe=lI;var YRt=1e5;function kR(e){e=e??V.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._radius=l(e.radius)?e.radius:YRt,this._image=e.image,this._transform=l(e.transform)?e.transform:P.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new $V({radius:this._radius,vertexFormat:ke.ALL}),i=new Lt({geometry:n,modelMatrix:this._transform}),o=new Xi({fabric:{type:"Image",uniforms:{image:this._image,repeat:new Q(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Ln({geometryInstances:i,appearance:new _o({material:o,closed:!0,faceForward:!1,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(kR.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});kR.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};kR.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),fe(this)};kR.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var BBe=kR;function vu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??vu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??vu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??vu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??vu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??vu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new _e,this._nominalFrameRate=new _e,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){qRt(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(){KRt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}vu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};vu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new vu({scene:e})),e._frameRateMonitor};Object.defineProperties(vu.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}}});vu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};vu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};vu.prototype.isDestroyed=function(){return!1};vu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),fe(this)};function qRt(e,t){if(e._pauseCount>0)return;let n=ki();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/ci.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/ci.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/ci.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 KRt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var p9=vu;var DBe=Na($Z(),1);function mte(){this._image=new Image}mte.prototype.isReady=function(){return!0};mte.prototype.shouldDiscardImage=function(e){return e===this._image};function uI(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Ji({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Et(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new mte),this._errorEvent=new _e}Object.defineProperties(uI.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}}});uI.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ue(`The server ${e.url} doesn't have imagery`);let n=new uI(t);return n._metadata=e,n};uI.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};uI.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,a=iC.tileXYToQuadKey(e,t,n),s=r.getTileInformation(e,t,n);if(!l(s)){if(r.isValid(a)){let u=new Br({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!s.hasImagery())return Promise.resolve(o);let c=XRt(this,s,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){PV(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!l(p)||!p)&&(h=JRt(f)),!l(h)&&(!l(p)||p)){let A=ZRt(f);h=A.imageType,f=A.imageData}return!l(h)||!l(f)?o:E_({uint8Array:f,format:h,flipY:!0})})};uI.prototype.pickFeatures=function(e,t,n,i,o){};function XRt(e,t,n,i,o,r){let a=iC.tileXYToQuadKey(n,i,o),s=t.imageryVersion;return s=l(s)&&s>0?s:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${a}-i.${s.toString()}`,request:r})}function JRt(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 ZRt(e){let t=DBe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let a=t.uint32(),s;switch(a>>>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(s=i.copyrightIds,l(s)||(s=i.copyrightIds=[]),(a&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)s.push(t.uint32())}else s.push(t.uint32());break;default:t.skipType(a&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ue("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var vBe=uI;var $Rt=600;function qp(e){e=e??V.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ss.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ss.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??$Rt}Object.defineProperties(qp.prototype,{});qp.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,o=e.signature,{panoId:r}=e;l(r)||(r=(await this.getNearestPanoId(t)).panoId);let a=Ss.getDefaultCredit(),s=d.fromDegrees(D.toDegrees(t.longitude),D.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:r,signature:o})],[u,f,h,p,A,m]=await Promise.all(c),_=At.localFrameToFixedFrameGenerator("north","down"),y=P.getMatrix3(_(s,te.default),new J);return new XS({sources:{positiveX:u,negativeX:f,positiveY:h,negativeY:p,positiveZ:A,negativeZ:m},transform:y,credit:a})};qp.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.toDegrees(e.longitude)].join(","),r=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(r.status!=="OK")throw new de(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${r.status}`);return{panoId:r.pano_id,latitude:r.location.lat,longitude:r.location.lng}};qp.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new de(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};qp.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new de(`Failed to load Street View face image: ${t}`)}};qp.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:o,signature:r}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:o,heading:t,pitch:n,key:this._key,...l(r)&&{signature:r}}}).url};qp.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ss.defaultStreetViewStaticApiKey??Ss.defaultApiKey,!l(e.key)&&!l(Ss.defaultStreetViewStaticApiKey)&&!l(Ss.defaultApiKey))throw new de("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new qp({...e})};qp._parseMetadata=function(e){return{cartographic:me.fromDegrees(e.location.lng,e.location.lat,0)}};var PBe=qp;var eMt=new U(1,1,1,.4),tMt=new U(0,1,0,.05),nMt=new U(0,.5,0,.2);function fI(e){e=e??V.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Ji({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??eMt,this._glowColor=e.glowColor??tMt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??nMt,this._errorEvent=new _e,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(fI.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}}});fI.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()};fI.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 a=this._color.toCssColorString();return i.strokeStyle=a,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};fI.prototype.getTileCredits=function(e,t,n){};fI.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};fI.prototype.pickFeatures=function(e,t,n,i,o){};var RBe=fI;function um(){}um._maxDecodingConcurrency=Math.max(hn.hardwareConcurrency-1,1);um._decodeTaskProcessor=new Zn("decodeI3S",um._maxDecodingConcurrency);um._promise=void 0;async function iMt(){if(await um._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return um._decodeTaskProcessor;throw new ue("I3S decoder could not be initialized.")}um.decode=async function(e,t,n,i,o){return l(um._promise)||(um._promise=iMt()),um._promise.then(function(r){let a=n._parent._data,s=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(a.obb)?(c=a.obb.center[0],u=a.obb.center[1],f=a.obb.center[2]):l(a.mbs)&&(c=a.mbs[0],u=a.mbs[1],f=a.mbs[2]);let h=J.fromRotationX(-D.PI_OVER_TWO),p=new J;J.multiply(h,s,p);let A=me.fromDegrees(c,u,f),m=te.WGS84.cartographicToCartesian(A),_={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:te.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:A,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(_)})};var A9=um;function pte(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(pte.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});pte.prototype.load=async function(){return this._data=await Kp.loadJson(this._resource),this._data};var g9=pte;function Bg(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(Bg.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function _9(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 oMt(e){return e==="String"?1:_9(e)}async function rMt(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)}Bg.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=rMt(this).catch(function(e){console.error(e)}),this._loadPromise)};Bg.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}};Bg.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};Bg.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let a=0;a<this._header.count;++a)if(r.valueType!=="String"){let s=this._parseValue(e,r.valueType,t);this._values[o].push(s.value),t=s.offset}else{let s=this._values.attributeByteCounts[a],c="";for(let u=0;u<s;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[o].push(c)}}}};Bg.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=_9(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=_9(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};Bg.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=oMt(i.valueType)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};Bg.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ue(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,a=this._storageInfo[r];if(l(a))if(a.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let s=_9(a.valueType);t+=s*this._header.count}else{if(!l(n))throw new ue(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let s=0;s<this._header.count&&t<e.byteLength;++s){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ue(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ue(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var y9=Bg;function UR(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(UR.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});UR.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var aMt=new d,sMt=new d,cMt=new d,lMt=new d,uMt=new d;function Ate(e,t,n,i){let o=d.subtract(i,n,aMt),r=d.cross(o,d.subtract(e,n,sMt),lMt),a=d.cross(o,d.subtract(t,n,cMt),uMt);return d.dot(r,a)>=0}var fMt=new d,dMt=new d,hMt=new d,mMt=new d,pMt=new d,AMt=new d,gMt=new d,_Mt=new d,yMt=new d,CMt=new d;UR.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,J.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,a,s,c,u=this._customAttributes.positions,f=this._customAttributes.indices,h;l(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let A,m,_;l(f)?(A=f[p],m=f[p+1],_=f[p+2]):(A=p*3,m=p*3+1,_=p*3+2);let y=d.fromElements(u[A*3],u[A*3+1],u[A*3+2],fMt),C=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],dMt),E=new d(u[_*3],u[_*3+1],u[_*3+2],hMt);if(!Ate(i,y,C,E)||!Ate(i,C,y,E)||!Ate(i,E,y,C))continue;let I=d.subtract(C,y,mMt),x=d.subtract(E,y,pMt),S=d.cross(I,x,AMt);if(d.magnitude(S)===0)continue;let w=d.normalize(S,gMt),v=d.subtract(i,y,_Mt),R=Math.abs(d.dot(v,w));if(R<o){o=R,r=p;let N=d.magnitudeSquared(d.subtract(i,y,v)),L=d.magnitudeSquared(d.subtract(i,C,yMt)),g=d.magnitudeSquared(d.subtract(i,E,CMt));N<L&&N<g?(s=A,c=y,a=N):L<g?(s=m,c=C,a=L):(s=_,c=E,a=g)}}if(l(r))return{index:s,distanceSquared:a,distance:Math.sqrt(a),queriedPosition:i,closestPosition:d.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function MBe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(xS(e[i])):t.push(e[i]);return t}UR.prototype._generateGltf=function(e,t,n,i,o,r,a,s){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let I=this._parent._data.mesh.material.definition;if(I>=0&&I<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[I],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let x="0";if(l(this._layer._data.textureSetDefinitions))for(let S=0;S<this._layer._data.textureSetDefinitions.length;S++){let w=this._layer._data.textureSetDefinitions[S];for(let v=0;v<w.formats.length;v++){let R=w.formats[v];if(R.format==="jpg"){x=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${x}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=MBe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=MBe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],A=[],m=[];u&&(p=[{sampler:0,source:0}],A=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let _=[],y=n.length;for(let E=0;E<y;E++){let I=n[E].primitives,x=I.length;for(let S=0;S<x;S++){let w=I[S];if(l(w.material)){for(;w.material>=_.length;){let R=Ye(c,!0);_.push(R)}let v=_[w.material];l(w.extra)&&w.extra.isTransparent?l(v.alphaMode)||(v.alphaMode="BLEND"):v.alphaMode==="BLEND"&&(v.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:_,textures:p,images:A,samplers:m,asset:{version:"2.0"},extensions:a,extensionsUsed:s}};var zR=UR;function nl(e,t,n){let i,o,r,a;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:a=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=a,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(nl.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}}});nl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Dh(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await Kp.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function NBe(e,t){let n=new y9(e,t);return e._fields[t.name]=n,n.load()}nl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(NBe(this,i))}return Promise.all(t)};nl.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return NBe(this,o)}return Promise.resolve()};nl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};nl.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};nl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new nl(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};nl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new zR(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new zR(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};nl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new g9(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};nl.prototype._clearGeometryData=function(){this._geometryData=[]};nl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=me.fromDegrees(e.center[0],e.center[1],e.center[2]):n=me.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let C=0;C<this._dataProvider._geoidDataList.length;C++){let E=this._dataProvider._geoidDataList[C],I=E.projection.project(n);if(I.x>E.nativeExtent.west&&I.x<E.nativeExtent.east&&I.y>E.nativeExtent.south&&I.y<E.nativeExtent.north){n.height+=xMt(I.x,I.y,E);break}}let i={},o,r=0;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=te.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=te.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let a=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let C=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));a=r/C}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let C=this._data.lodThreshold;a=r/C}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let C=0;C<this._data.lodSelection.length;C++)this._data.lodSelection[C].metricType==="maxScreenThreshold"&&(a=r/this._data.lodSelection[C].maxError);a===1/0&&(a=1e5);let s=a*16,c=new Rc(0,0,0),u=At.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(u=new Qe(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=J.fromQuaternion(u),h=J.inverse(f,new J),p=new P(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),A=P.inverse(p,new P),m=P.clone(p);l(this._parent._globalTransform)&&P.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=A,this._inverseRotationMatrix=h;let _=[];for(let C=0;C<this._children.length;C++)_.push(this._children[C]._create3DTileDefinition());return{children:_,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:s}};nl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};nl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,a=this._geometryData[0],s=await A9.decode(o,r,a,this._featureData[0],this._symbologyData);if(!l(s))return;e=a._generateGltf(s.meshData.nodesInScene,s.meshData.nodes,s.meshData.meshes,s.meshData.buffers,s.meshData.bufferViews,s.meshData.accessors,s.meshData.rootExtensions,s.meshData.extensionsUsed),this._geometryData[0]._customAttributes=s.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function EMt(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 IMt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let a=0;a<n.values.length;a++)if(n.values[a]===o){r=!0;break}return r}async function LBe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await EMt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let a=i[r];if(!IMt(o,e._fields[a.name],a)){n.setShow(o,!1);break}}}t.show=!0}nl.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=LBe(this,t);e.push(n)}return Promise.all(e)};Dh.prototype._hookedRequestContent=Dh.prototype.requestContent;Dh.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new De({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{LBe(e._i3sNode,n)})),e._isLoading=!1,t})}};function bMt(e,t,n,i,o,r){let a=n*(1-e)+i*e,s=o*(1-e)+r*e;return a*(1-t)+s*t}function C9(e,t,n,i){let o=e+t*n;return i[o]}function xMt(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),a=Math.floor(o),s=Math.floor(r);o-=a,r-=s;let c=a<n.width?a+1:a,u=s<n.height?s+1:s;s=n.height-1-s,u=n.height-1-u;let f=C9(a,s,n.width,n.buffer),h=C9(c,s,n.width,n.buffer),p=C9(a,u,n.width,n.buffer),A=C9(c,u,n.width,n.buffer),m=bMt(o,r,f,h,p,A);return m=m*n.scale+n.offset,m}Object.defineProperties(Dh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var GR=nl;function E9(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(E9.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function gte(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(xS(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function $S(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,a=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=gte(r.color,r.transparency))):l(a)&&(n.edges={},l(a.color)&&(n.edges.color=gte(a.color,a.transparency))),!t){let s=o.material;l(s)&&(n.material={colorMixMode:s.colorMixMode},l(s.color)&&(n.material.color=gte(s.color,s.transparency)))}break}}return n}function TMt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let a=$S(o[r].symbol,t),s=o[r].values;for(let c=0;c<s.length;c++){let u=s[c],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=a:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=$S(o.symbol,t)}return n}}function SMt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let a=o.classMaxValue??o.classMinValue,s=r.classMaxValue??r.classMinValue;return a-s});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push($S(r.symbol,t)))}return i.symbols.push(void 0),i}}E9.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=$S(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=$S(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=TMt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=$S(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=SMt(i,n))}};function OBe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],a=e[r];return l(a)&&++n<t.length?OBe(a,t,n,i):a}}function wMt(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 BMt(e,t,n){let i=t[n],o=wMt(e.ranges,i);return e.symbols[o]}E9.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>OBe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>BMt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let a=0;a<r.length;a++){let s=o(a);l(s)&&(t[a]=s)}}}return t};var I9=E9;function Pu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new De({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(Pu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Pu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ue(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new I9(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()};Pu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],a=[],s=!1;if(l(r.compressedAttributes)&&e){s=!0;let c=r.compressedAttributes.attributes;for(let u=0;u<c.length;u++)a.push(c[u])}else for(let c in r)c!=="offset"&&a.push(c);n.push({compressed:s,attributes:a,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)}};Pu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,a=o.attributes;for(let s=0;s<t.length;s++)if(!a.includes(t[s])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Pu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new GR(this,t,!0)}else this._rootNode=new GR(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Pu.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]})};Pu._fetchJson=function(e){return e.fetchJson()};Pu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Pu._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Pu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Pu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?Ye(e):{},e.outlineColor=U.fromCartesian4(ie.fromArray(o))),this._tileset=await cs.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};Pu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Pu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ye(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var ew=Pu;function b9(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(b9.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});b9.prototype.load=async function(){return this._data=await Kp.loadJson(this._resource),this._data};b9.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var x9=b9;function VR(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(VR.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});VR._fromData=async function(e,t,n,i){let o=new VR(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let a=[];for(let c=0;c<r.length;c++){let u=VR._fromData(e,t,r[c],o);a.push(u)}let s=await Promise.all(a);for(let c=0;c<s.length;c++){let u=s[c];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),a=new De({url:r});a.setQueryParameters(e.resource.queryParameters),a.appendForwardSlash(),o._resource=a;let s=await Kp.loadJson(o._resource),c=new ew(e,s,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var T9=VR;var kBe=Na(FBe(),1);function Ka(e){e=e??V.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??V.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(Ka.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});Ka.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return fe(this)};Ka.prototype.isDestroyed=function(){return!1};Ka.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};Ka.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};Ka.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};Ka.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function DMt(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 QBe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=DMt(e,t.id);if(l(t.sublayers)){let o=[];for(let a=0;a<t.sublayers.length;a++){let s=T9._fromData(e,i,t.sublayers[a],e);o.push(s)}let r=await Promise.all(o);for(let a=0;a<r.length;a++){let s=r[a];e._sublayers.push(s),e._layers.push(...s._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new x9(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=ce.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new ew(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}Ka.fromUrl=async function(e,t){t=t??V.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await Ka.loadJson(n),o=new Ka(t);if(o._resource=n,o._data=i,l(i.layers)){let a=[];for(let s=0;s<i.layers.length;s++){let c=QBe(o,i.layers[s],t);a.push(c)}await Promise.all(a)}else await QBe(o,i,t);o._computeExtent();let r=[];for(let a=0;a<o._layers.length;a++)r.push(o._layers[a].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};Ka._fetchJson=function(e){return e.fetchJson()};Ka.loadJson=async function(e){let t=await Ka._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ue(t.error)}return t};Ka.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ue(`Failed to load binary: ${e.url}`);return t};Ka.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 vMt=new Q;function PMt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,a=me.fromRadians(t.west,t.north),s=me.fromRadians(t.east,t.south),c=n.positionToTileXY(a,r),u=n.positionToTileXY(s,r);for(let h=c.x;h<=u.x;h++)for(let p=c.y;p<=u.y;p++){let A=Q.fromElements(h,p,vMt),m=A.toString();if(!o.hasOwnProperty(m)){let _={x:A.x,y:A.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=_,i.push(_)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],A=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(A)}return Promise.all(f).then(function(h){let p=[];for(let A=0;A<h.length;A++){let m={tilingScheme:n,x:i[A].x,y:i[A].y,level:i[A].level},_=h[A],y="Geographic";n._projection instanceof mi&&(y="WebMercator");let C={projectionType:y,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:_._height,width:_._width,scale:_._structure.heightScale,offset:_._structure.heightOffset};if(_._encoding===Jh.LERC){let E=kBe.default.decode(_._buffer);C.buffer=E.pixels[0]}else C.buffer=_._buffer;p.push(C)}return p})}async function RMt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await PMt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}Ka.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=RMt(this),this._geoidDataPromise)};Ka.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};Ka.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};Ka.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};Ka.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 Kp=Ka;var HR={};HR.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ds.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ds.ExportStatus.Invalid))throw new ue(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===ds.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let a=r.toString(),s=new De({url:a});return cs.fromUrl(s,n)};HR.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await ds.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ds.RealityDataType.Cesium3DTiles,ds.RealityDataType.PNTS,ds.RealityDataType.RealityMesh3DTiles,ds.RealityDataType.Terrain3DTiles,ds.RealityDataType.GaussianSplat3DTiles].includes(n))throw new ue(`Reality data type is not a mesh type: ${n}`);let a=await ds.getRealityDataURL(e,t,i),s={maximumScreenSpaceError:4,...o};return cs.fromUrl(a,s)};HR.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let a=await ds.getRealityDataMetadata(e,t);i=a.rootDocument,n=a.type}if(![ds.RealityDataType.KML,ds.RealityDataType.GeoJSON].includes(n))throw new ue(`Reality data type is not a data source type: ${n}`);let r=await ds.getRealityDataURL(e,t,i);return n===ds.RealityDataType.GeoJSON?v0.load(r):aS.load(r)};HR.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${ds.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new De({url:o,headers:{Authorization:ds._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return v0.load(r)};var UBe=HR;function zBe(){}Object.defineProperties(zBe.prototype,{color:{get:de.throwInstantiationError},intensity:{get:de.throwInstantiationError}});var GBe=zBe;var MMt=/\/$/,VBe=new Et('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function tw(e){e=e??V.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.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 a=l(e.scaleFactor)?"@2x":"",s=i.getUrlComponent();MMt.test(s)||(s+="/"),s+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${a}`,i.url=s,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Et(c))):c=VBe,this._resource=i,this._imageryProvider=new ba({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(tw.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}}});tw.prototype.getTileCredits=function(e,t,n){};tw.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};tw.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};tw._defaultCredit=VBe;var HBe=tw;function _te(e){}_te.prototype.isReady=function(){return!0};_te.prototype.shouldDiscardImage=function(e){return!1};var WBe=_te;var NMt=new Et("MapQuest, Open Street Map and contributors, CC-BY-SA");function w9(e){e=e??V.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new za({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,a=e.maximumLevel,s=e.rectangle??n.rectangle,c=n.positionToTileXY(ce.southwest(s),r),u=n.positionToTileXY(ce.northeast(s),r),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),h=e.credit??NMt;typeof h=="string"&&(h=new Et(h)),ba.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:a,rectangle:s})}l(Object.create)&&(w9.prototype=Object.create(ba.prototype),w9.prototype.constructor=w9);var bC=w9;function jBe(){de.throwInstantiationError()}Object.defineProperties(jBe.prototype,{show:{get:de.throwInstantiationError,set:de.throwInstantiationError},transform:{get:de.throwInstantiationError},credit:{get:de.throwInstantiationError}});var YBe=jBe;function B9(){de.throwInstantiationError()}Object.defineProperties(B9.prototype,{});B9.fromUrl=function(e){de.throwInstantiationError()};B9.prototype.loadPanorama=function(e){de.throwInstantiationError()};var qBe=B9;var LMt=new Q(1,1);function yte(e){e=e??V.EMPTY_OBJECT,this.mass=e.mass??1,this.position=d.clone(e.position??d.ZERO),this.velocity=d.clone(e.velocity??d.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=U.clone(e.startColor??U.WHITE),this.endColor=U.clone(e.endColor??U.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=Q.clone(e.imageSize??LMt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(yte.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var KBe=new d;yte.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,KBe),d.add(this.position,KBe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var WR=yte;function XBe(e){e=e??V.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(XBe.prototype,{complete:{get:function(){return this._complete}}});var JBe=XBe;function ZBe(e){}ZBe.prototype.emit=function(e){de.throwInstantiationError()};var $Be=ZBe;var eDe=new Q(1,1);function jR(e){e=e??V.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new c9(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._emitterModelMatrix=P.clone(e.emitterModelMatrix??P.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new P,this._startColor=U.clone(e.color??e.startColor??U.WHITE),this._endColor=U.clone(e.color??e.endColor??U.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=Q.clone(e.imageSize??e.minimumImageSize??eDe),this._maximumImageSize=Q.clone(e.imageSize??e.maximumImageSize??eDe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new _e,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(jR.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._modelMatrix,e),P.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._emitterModelMatrix,e),P.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){U.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){U.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function OMt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,a=e.image,s=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(s-c.length-u.length,0);for(let h=0;h<f;++h){let p=new WR;p._billboard=r.add({image:a,show:!1}),u.push(p)}e._particleEstimate=s}function FMt(e){let t=e._particlePool.pop();return l(t)||(t=new WR),t}function QMt(e,t){e._particlePool.push(t)}function kMt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,a=e._particleEstimate,s=r-Math.max(a-o-r,0);for(let c=s;c<r;++c){let u=n[c];i.remove(u._billboard)}n.length=s}function UMt(e){l(e._billboard)&&(e._billboard.show=!1)}function tDe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),a=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new U(i,o,r,a),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function zMt(e,t){t.startColor=U.clone(e._startColor,t.startColor),t.endColor=U.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function GMt(e,t){if(e._isComplete)return 0;t=D.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let a=e.bursts[r],s=e._currentTime;l(a)&&!a._complete&&s>a.time&&(i+=D.randomBetween(a.minimum,a.maximum),a._complete=!0)}}return i}var D9=new d;jR.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new fd),this._updateParticlePool&&(OMt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=X.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,a,s=n.length;for(r=0;r<s;++r)a=n[r],a.update(t,o)?tDe(this,a):(UMt(a),QMt(this,a),n[r]=n[s-1],--r,--s);n.length=s;let c=GMt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=P.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<c;r++)a=FMt(this),this._emitter.emit(a),d.add(a.position,a.velocity,D9),P.multiplyByPoint(u,D9,D9),a.position=P.multiplyByPoint(u,a.position,a.position),d.subtract(D9,a.position,a.velocity),d.normalize(a.velocity,a.velocity),zMt(this,a),tDe(this,a)}if(this._billboardCollection.update(e),this._previousTime=X.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&kMt(this)};jR.prototype.isDestroyed=function(){return!1};jR.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),fe(this)};var nDe=jR;function Pf(){de.throwInstantiationError()}Pf.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Pf.prototype,{quadtree:{get:de.throwInstantiationError,set:de.throwInstantiationError},tilingScheme:{get:de.throwInstantiationError},errorEvent:{get:de.throwInstantiationError}});Pf.prototype.update=de.throwInstantiationError;Pf.prototype.beginUpdate=de.throwInstantiationError;Pf.prototype.endUpdate=de.throwInstantiationError;Pf.prototype.getLevelMaximumGeometricError=de.throwInstantiationError;Pf.prototype.loadTile=de.throwInstantiationError;Pf.prototype.computeTileVisibility=de.throwInstantiationError;Pf.prototype.showTileThisFrame=de.throwInstantiationError;Pf.prototype.computeDistanceToTile=de.throwInstantiationError;Pf.prototype.isDestroyed=de.throwInstantiationError;Pf.prototype.destroy=de.throwInstantiationError;var iDe=Pf;function Cte(e){e=e??1,this._radius=e??1}Object.defineProperties(Cte.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Cte.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),a=i*Math.cos(n);e.position=d.fromElements(o,r,a,e.position),e.velocity=d.normalize(e.position,e.velocity)};var oDe=Cte;function YR(){}YR.prototype.evaluate=function(e,t){de.throwInstantiationError()};YR.prototype.evaluateColor=function(e,t){de.throwInstantiationError()};YR.prototype.getShaderFunction=function(e,t,n,i){de.throwInstantiationError()};YR.prototype.getVariables=function(){de.throwInstantiationError()};var rDe=YR;function nw(e){this._ready=!1,this._provider=void 0,this._errorEvent=new _e,this._readyEvent=new _e,HMt(this,e)}Object.defineProperties(nw.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}}});nw.fromWorldTerrain=function(e){return new nw(mS(e))};nw.fromWorldBathymetry=function(e){return new nw(vV(e))};function VMt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function HMt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){VMt(e._errorEvent,i)}}var v9=nw;function iw(){}iw.prototype.boundingVolume=void 0;iw.prototype.boundingSphere=void 0;iw.prototype.distanceToCamera=function(e){de.throwInstantiationError()};iw.prototype.intersectPlane=function(e){de.throwInstantiationError()};iw.prototype.createDebugVolume=function(e){de.throwInstantiationError()};var aDe=iw;function qR(e){e=e??V.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Ji({ellipsoid:e.ellipsoid}),this._color=e.color??U.YELLOW,this._errorEvent=new _e,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(qR.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}}});qR.prototype.getTileCredits=function(e,t,n){};qR.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),a=this._color.toCssColorString();return r.strokeStyle=a,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=a,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};qR.prototype.pickFeatures=function(e,t,n,i,o){};var P9=qR;function Ete(e){de.throwInstantiationError()}Ete.prototype.isReady=de.throwInstantiationError;Ete.prototype.shouldDiscardImage=de.throwInstantiationError;var sDe=Ete;var WMt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},cDe=Object.freeze(WMt);function R9(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=Xi.fromType(Xi.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}R9.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ve.fromCache({blending:sn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new We({sources:[this._material.shaderSource,I8]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Be.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};R9.prototype.isDestroyed=function(){return!1};R9.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),fe(this)};var lDe=R9;function Ite(){de.throwInstantiationError()}Object.defineProperties(Ite.prototype,{globalTransform:{get:de.throwInstantiationError},shapeTransform:{get:de.throwInstantiationError},shape:{get:de.throwInstantiationError},minBounds:{get:de.throwInstantiationError},maxBounds:{get:de.throwInstantiationError},dimensions:{get:de.throwInstantiationError},paddingBefore:{get:de.throwInstantiationError},paddingAfter:{get:de.throwInstantiationError},names:{get:de.throwInstantiationError},types:{get:de.throwInstantiationError},componentTypes:{get:de.throwInstantiationError},minimumValues:{get:de.throwInstantiationError},maximumValues:{get:de.throwInstantiationError},maximumTileCount:{get:de.throwInstantiationError},availableLevels:{get:de.throwInstantiationError},keyframeCount:{get:de.throwInstantiationError},timeIntervalCollection:{get:de.throwInstantiationError}});Ite.prototype.requestData=function(e){de.throwInstantiationError()};var uDe=Ite;function Dg(){de.throwInstantiationError()}Object.defineProperties(Dg.prototype,{orientedBoundingBox:{get:de.throwInstantiationError},boundingSphere:{get:de.throwInstantiationError},boundTransform:{get:de.throwInstantiationError},shapeTransform:{get:de.throwInstantiationError},shaderUniforms:{get:de.throwInstantiationError},shaderDefines:{get:de.throwInstantiationError},shaderMaximumIntersectionsLength:{get:de.throwInstantiationError}});Dg.prototype.update=de.throwInstantiationError;Dg.prototype.updateViewTransforms=de.throwInstantiationError;Dg.prototype.convertLocalToShapeUvSpace=de.throwInstantiationError;Dg.prototype.computeOrientedBoundingBoxForTile=de.throwInstantiationError;Dg.prototype.computeOrientedBoundingBoxForSample=de.throwInstantiationError;Dg.DefaultMinBounds=de.throwInstantiationError;Dg.DefaultMaxBounds=de.throwInstantiationError;var fDe=Dg;var dDe=`uniform sampler2D u_depthTexture;
|
|
|
|
in vec2 v_textureCoordinates;
|
|
|
|
void main()
|
|
{
|
|
float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
|
|
z_window = czm_reverseLogDepth(z_window);
|
|
float n_range = czm_depthRange.near;
|
|
float f_range = czm_depthRange.far;
|
|
float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
|
|
float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
|
|
out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
|
|
}
|
|
`;function jMt(e){e=e??V.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Ke.RGBA,this.pixelDatatype=e.pixelDatatype??He.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?pn.REPEAT:pn.CLAMP_TO_EDGE;this.sampler=new jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var hDe=jMt;var YMt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},mDe=Object.freeze(YMt);var qMt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},pDe=Object.freeze(qMt);function KMt(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 a=await e(i.parameters,o);r.result=a}catch(a){a instanceof Error?r.error={name:a.name,message:a.message,stack:a.stack}:r.error=a}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(a){r.result=void 0,r.error=`postMessage failed with error: ${vA(a)}
|
|
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 ADe=KMt;globalThis.CESIUM_VERSION="1.140.0";var KR;typeof ko<"u"&&(KR=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(a){a(t.ko={})})(function(a,s){function c(g,b){return g===null||typeof g in _?g===b:!1}function u(g,b){var T;return function(){T||(T=m.a.setTimeout(function(){T=e,g()},b))}}function f(g,b){var T;return function(){clearTimeout(T),T=m.a.setTimeout(g,b)}}function h(g,b){b&&b!=="change"?b==="beforeChange"?this.pc(g):this.gb(g,b):this.qc(g)}function p(g,b){b!==null&&b.s&&b.s()}function A(g,b){var T=this.qd,B=T[x];B.ra||(this.Qb&&this.mb[b]?(T.uc(b,g,this.mb[b]),this.mb[b]=null,--this.Qb):B.I[b]||T.uc(b,g,B.J?{da:g}:T.$c(g)),g.Ja&&g.gd())}var m=typeof a<"u"?a:{};m.b=function(g,b){for(var T=g.split("."),B=m,M=0;M<T.length-1;M++)B=B[T[M]];B[T[T.length-1]]=b},m.L=function(g,b,T){g[b]=T},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=(function(){function g(W,K){for(var Z in W)M.call(W,Z)&&K(Z,W[Z])}function b(W,K){if(K)for(var Z in K)M.call(K,Z)&&(W[Z]=K[Z]);return W}function T(W,K){return W.__proto__=K,W}function B(W,K,Z,pe){var ge=W[K].match(Y)||[];m.a.D(Z.match(Y),function(re){m.a.Na(ge,re,pe)}),W[K]=ge.join(" ")}var M=Object.prototype.hasOwnProperty,O={__proto__:[]}instanceof Array,G=typeof Symbol=="function",k={},z={};k[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],k.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),g(k,function(W,K){if(K.length)for(var Z=0,pe=K.length;Z<pe;Z++)z[K[Z]]=W});var F={propertychange:!0},H=n&&(function(){for(var W=3,K=n.createElement("div"),Z=K.getElementsByTagName("i");K.innerHTML="<!--[if gt IE "+ ++W+"]><i></i><![endif]-->",Z[0];);return 4<W?W:e})(),Y=/\S+/g,$;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(W,K,Z){for(var pe=0,ge=W.length;pe<ge;pe++)K.call(Z,W[pe],pe,W)},A:typeof Array.prototype.indexOf=="function"?function(W,K){return Array.prototype.indexOf.call(W,K)}:function(W,K){for(var Z=0,pe=W.length;Z<pe;Z++)if(W[Z]===K)return Z;return-1},Lb:function(W,K,Z){for(var pe=0,ge=W.length;pe<ge;pe++)if(K.call(Z,W[pe],pe,W))return W[pe];return e},Pa:function(W,K){var Z=m.a.A(W,K);0<Z?W.splice(Z,1):Z===0&&W.shift()},wc:function(W){var K=[];return W&&m.a.D(W,function(Z){0>m.a.A(K,Z)&&K.push(Z)}),K},Mb:function(W,K,Z){var pe=[];if(W)for(var ge=0,re=W.length;ge<re;ge++)pe.push(K.call(Z,W[ge],ge));return pe},jb:function(W,K,Z){var pe=[];if(W)for(var ge=0,re=W.length;ge<re;ge++)K.call(Z,W[ge],ge)&&pe.push(W[ge]);return pe},Nb:function(W,K){if(K instanceof Array)W.push.apply(W,K);else for(var Z=0,pe=K.length;Z<pe;Z++)W.push(K[Z]);return W},Na:function(W,K,Z){var pe=m.a.A(m.a.bc(W),K);0>pe?Z&&W.push(K):Z||W.splice(pe,1)},Ba:O,extend:b,setPrototypeOf:T,Ab:O?T:b,P:g,Ga:function(W,K,Z){if(!W)return W;var pe={},ge;for(ge in W)M.call(W,ge)&&(pe[ge]=K.call(Z,W[ge],ge,W));return pe},Tb:function(W){for(;W.firstChild;)m.removeNode(W.firstChild)},Yb:function(W){W=m.a.la(W);for(var K=(W[0]&&W[0].ownerDocument||n).createElement("div"),Z=0,pe=W.length;Z<pe;Z++)K.appendChild(m.oa(W[Z]));return K},Ca:function(W,K){for(var Z=0,pe=W.length,ge=[];Z<pe;Z++){var re=W[Z].cloneNode(!0);ge.push(K?m.oa(re):re)}return ge},va:function(W,K){if(m.a.Tb(W),K)for(var Z=0,pe=K.length;Z<pe;Z++)W.appendChild(K[Z])},Xc:function(W,K){var Z=W.nodeType?[W]:W;if(0<Z.length){for(var pe=Z[0],ge=pe.parentNode,re=0,ye=K.length;re<ye;re++)ge.insertBefore(K[re],pe);for(re=0,ye=Z.length;re<ye;re++)m.removeNode(Z[re])}},Ua:function(W,K){if(W.length){for(K=K.nodeType===8&&K.parentNode||K;W.length&&W[0].parentNode!==K;)W.splice(0,1);for(;1<W.length&&W[W.length-1].parentNode!==K;)W.length--;if(1<W.length){var Z=W[0],pe=W[W.length-1];for(W.length=0;Z!==pe;)W.push(Z),Z=Z.nextSibling;W.push(pe)}}return W},Zc:function(W,K){7>H?W.setAttribute("selected",K):W.selected=K},Db:function(W){return W===null||W===e?"":W.trim?W.trim():W.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(W,K){return W=W||"",K.length>W.length?!1:W.substring(0,K.length)===K},vd:function(W,K){if(W===K)return!0;if(W.nodeType===11)return!1;if(K.contains)return K.contains(W.nodeType!==1?W.parentNode:W);if(K.compareDocumentPosition)return(K.compareDocumentPosition(W)&16)==16;for(;W&&W!=K;)W=W.parentNode;return!!W},Sb:function(W){return m.a.vd(W,W.ownerDocument.documentElement)},kd:function(W){return!!m.a.Lb(W,m.a.Sb)},R:function(W){return W&&W.tagName&&W.tagName.toLowerCase()},Ac:function(W){return m.onError?function(){try{return W.apply(this,arguments)}catch(K){throw m.onError&&m.onError(K),K}}:W},setTimeout:function(W,K){return setTimeout(m.a.Ac(W),K)},Gc:function(W){setTimeout(function(){throw m.onError&&m.onError(W),W},0)},B:function(W,K,Z){var pe=m.a.Ac(Z);if(Z=F[K],m.options.useOnlyNativeEvents||Z||!o)if(Z||typeof W.addEventListener!="function")if(typeof W.attachEvent<"u"){var ge=function(ye){pe.call(W,ye)},re="on"+K;W.attachEvent(re,ge),m.a.K.za(W,function(){W.detachEvent(re,ge)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else W.addEventListener(K,pe,!1);else $||($=typeof o(W).on=="function"?"on":"bind"),o(W)[$](K,pe)},Fb:function(W,K){if(!W||!W.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var Z;if(m.a.R(W)==="input"&&W.type&&K.toLowerCase()=="click"?(Z=W.type,Z=Z=="checkbox"||Z=="radio"):Z=!1,m.options.useOnlyNativeEvents||!o||Z)if(typeof n.createEvent=="function")if(typeof W.dispatchEvent=="function")Z=n.createEvent(z[K]||"HTMLEvents"),Z.initEvent(K,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,W),W.dispatchEvent(Z);else throw Error("The supplied element doesn't support dispatchEvent");else if(Z&&W.click)W.click();else if(typeof W.fireEvent<"u")W.fireEvent("on"+K);else throw Error("Browser doesn't support triggering events");else o(W).trigger(K)},f:function(W){return m.O(W)?W():W},bc:function(W){return m.O(W)?W.v():W},Eb:function(W,K,Z){var pe;K&&(typeof W.classList=="object"?(pe=W.classList[Z?"add":"remove"],m.a.D(K.match(Y),function(ge){pe.call(W.classList,ge)})):typeof W.className.baseVal=="string"?B(W.className,"baseVal",K,Z):B(W,"className",K,Z))},Bb:function(W,K){var Z=m.a.f(K);(Z===null||Z===e)&&(Z="");var pe=m.h.firstChild(W);!pe||pe.nodeType!=3||m.h.nextSibling(pe)?m.h.va(W,[W.ownerDocument.createTextNode(Z)]):pe.data=Z,m.a.Ad(W)},Yc:function(W,K){if(W.name=K,7>=H)try{var Z=W.name.replace(/[&<>'"]/g,function(pe){return"&#"+pe.charCodeAt(0)+";"});W.mergeAttributes(n.createElement("<input name='"+Z+"'/>"),!1)}catch{}},Ad:function(W){9<=H&&(W=W.nodeType==1?W:W.parentNode,W.style&&(W.style.zoom=W.style.zoom))},wd:function(W){if(H){var K=W.style.width;W.style.width=0,W.style.width=K}},Pd:function(W,K){W=m.a.f(W),K=m.a.f(K);for(var Z=[],pe=W;pe<=K;pe++)Z.push(pe);return Z},la:function(W){for(var K=[],Z=0,pe=W.length;Z<pe;Z++)K.push(W[Z]);return K},Da:function(W){return G?Symbol(W):W},Zd:H===6,$d:H===7,W:H,Lc:function(W,K){for(var Z=m.a.la(W.getElementsByTagName("input")).concat(m.a.la(W.getElementsByTagName("textarea"))),pe=typeof K=="string"?function(ye){return ye.name===K}:function(ye){return K.test(ye.name)},ge=[],re=Z.length-1;0<=re;re--)pe(Z[re])&&ge.push(Z[re]);return ge},Nd:function(W){return typeof W=="string"&&(W=m.a.Db(W))?r&&r.parse?r.parse(W):new Function("return "+W)():null},hc:function(W,K,Z){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(m.a.f(W),K,Z)},Od:function(W,K,Z){Z=Z||{};var pe=Z.params||{},ge=Z.includeFields||this.Jc,re=W;if(typeof W=="object"&&m.a.R(W)==="form")for(var re=W.action,ye=ge.length-1;0<=ye;ye--)for(var Ce=m.a.Lc(W,ge[ye]),ve=Ce.length-1;0<=ve;ve--)pe[Ce[ve].name]=Ce[ve].value;K=m.a.f(K);var Ne=n.createElement("form");Ne.style.display="none",Ne.action=re,Ne.method="post";for(var Le in K)W=n.createElement("input"),W.type="hidden",W.name=Le,W.value=m.a.hc(m.a.f(K[Le])),Ne.appendChild(W);g(pe,function(Oe,nt){var Fe=n.createElement("input");Fe.type="hidden",Fe.name=Oe,Fe.value=nt,Ne.appendChild(Fe)}),n.body.appendChild(Ne),Z.submitter?Z.submitter(Ne):Ne.submit(),setTimeout(function(){Ne.parentNode.removeChild(Ne)},0)}}})(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(g){var b=this;if(arguments.length===1)return function(){return b.apply(g,arguments)};var T=Array.prototype.slice.call(arguments,1);return function(){var B=T.slice(0);return B.push.apply(B,arguments),b.apply(g,B)}}),m.a.g=new function(){var g=0,b="__ko__"+new Date().getTime(),T={},B,M;return m.a.W?(B=function(O,G){var k=O[b];if(!k||k==="null"||!T[k]){if(!G)return e;k=O[b]="ko"+g++,T[k]={}}return T[k]},M=function(O){var G=O[b];return G?(delete T[G],O[b]=null,!0):!1}):(B=function(O,G){var k=O[b];return!k&&G&&(k=O[b]={}),k},M=function(O){return O[b]?(delete O[b],!0):!1}),{get:function(O,G){var k=B(O,!1);return k&&k[G]},set:function(O,G,k){(O=B(O,k!==e))&&(O[G]=k)},Ub:function(O,G,k){return O=B(O,!0),O[G]||(O[G]=k)},clear:M,Z:function(){return g+++b}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function g(G,k){var z=m.a.g.get(G,B);return z===e&&k&&(z=[],m.a.g.set(G,B,z)),z}function b(G){var k=g(G,!1);if(k)for(var k=k.slice(0),z=0;z<k.length;z++)k[z](G);m.a.g.clear(G),m.a.K.cleanExternalData(G),O[G.nodeType]&&T(G.childNodes,!0)}function T(G,k){for(var z=[],F,H=0;H<G.length;H++)if((!k||G[H].nodeType===8)&&(b(z[z.length]=F=G[H]),G[H]!==F))for(;H--&&m.a.A(z,G[H])==-1;);}var B=m.a.g.Z(),M={1:!0,8:!0,9:!0},O={1:!0,9:!0};return{za:function(G,k){if(typeof k!="function")throw Error("Callback must be a function");g(G,!0).push(k)},yb:function(G,k){var z=g(G,!1);z&&(m.a.Pa(z,k),z.length==0&&m.a.g.set(G,B,e))},oa:function(G){return m.u.G(function(){M[G.nodeType]&&(b(G),O[G.nodeType]&&T(G.getElementsByTagName("*")))}),G},removeNode:function(G){m.oa(G),G.parentNode&&G.parentNode.removeChild(G)},cleanExternalData:function(G){o&&typeof o.cleanData=="function"&&o.cleanData([G])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),(function(){var g=[0,"",""],b=[1,"<table>","</table>"],T=[3,"<table><tbody><tr>","</tr></tbody></table>"],B=[1,"<select multiple='multiple'>","</select>"],M={thead:b,tbody:b,tfoot:b,tr:[2,"<table><tbody>","</tbody></table>"],td:T,th:T,option:B,optgroup:B},O=8>=m.a.W;m.a.ua=function(G,k){var z;if(o){if(o.parseHTML)z=o.parseHTML(G,k)||[];else if((z=o.clean([G],k))&&z[0]){for(var F=z[0];F.parentNode&&F.parentNode.nodeType!==11;)F=F.parentNode;F.parentNode&&F.parentNode.removeChild(F)}}else{(z=k)||(z=n);var F=z.parentWindow||z.defaultView||t,H=m.a.Db(G).toLowerCase(),Y=z.createElement("div"),$;for($=(H=H.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&M[H[1]]||g,H=$[0],$="ignored<div>"+$[1]+G+$[2]+"</div>",typeof F.innerShiv=="function"?Y.appendChild(F.innerShiv($)):(O&&z.body.appendChild(Y),Y.innerHTML=$,O&&Y.parentNode.removeChild(Y));H--;)Y=Y.lastChild;z=m.a.la(Y.lastChild.childNodes)}return z},m.a.Md=function(G,k){var z=m.a.ua(G,k);return z.length&&z[0].parentElement||m.a.Yb(z)},m.a.fc=function(G,k){if(m.a.Tb(G),k=m.a.f(k),k!==null&&k!==e)if(typeof k!="string"&&(k=k.toString()),o)o(G).html(k);else for(var z=m.a.ua(k,G.ownerDocument),F=0;F<z.length;F++)G.appendChild(z[F])}})(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=(function(){function g(T,B){if(T){if(T.nodeType==8){var M=m.aa.Uc(T.nodeValue);M!=null&&B.push({ud:T,Kd:M})}else if(T.nodeType==1)for(var M=0,O=T.childNodes,G=O.length;M<G;M++)g(O[M],B)}}var b={};return{Xb:function(T){if(typeof T!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var B=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return b[B]=T,"<!--[ko_memo:"+B+"]-->"},bd:function(T,B){var M=b[T];if(M===e)throw Error("Couldn't find any memo with ID "+T+". Perhaps it's already been unmemoized.");try{return M.apply(null,B||[]),!0}finally{delete b[T]}},cd:function(T,B){var M=[];g(T,M);for(var O=0,G=M.length;O<G;O++){var k=M[O].ud,z=[k];B&&m.a.Nb(z,B),m.aa.bd(M[O].Kd,z),k.nodeValue="",k.parentNode&&k.parentNode.removeChild(k)}},Uc:function(T){return(T=T.match(/^\[ko_memo\:(.*?)\]$/))?T[1]:null}}})(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=(function(){function g(){if(M){for(var k=M,z=0,F;G<M;)if(F=B[G++]){if(G>k){if(5e3<=++z){G=M,m.a.Gc(Error("'Too much recursion' after processing "+z+" task groups."));break}k=M}try{F()}catch(H){m.a.Gc(H)}}}}function b(){g(),G=M=B.length=0}var T,B=[],M=0,O=1,G=0;return t.MutationObserver?T=(function(k){var z=n.createElement("div");return new MutationObserver(k).observe(z,{attributes:!0}),function(){z.classList.toggle("foo")}})(b):T=n&&"onreadystatechange"in n.createElement("script")?function(k){var z=n.createElement("script");z.onreadystatechange=function(){z.onreadystatechange=null,n.documentElement.removeChild(z),z=null,k()},n.documentElement.appendChild(z)}:function(k){setTimeout(k,0)},{scheduler:T,zb:function(k){return M||m.na.scheduler(b),B[M++]=k,O++},cancel:function(k){k=k-(O-M),k>=G&&k<M&&(B[k]=null)},resetForTesting:function(){var k=M-G;return G=M=B.length=0,k},Sd:g}})(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(g,b){g.throttleEvaluation=b;var T=null;return m.$({read:g,write:function(B){clearTimeout(T),T=m.a.setTimeout(function(){g(B)},b)}})},rateLimit:function(g,b){var T,B,M;typeof b=="number"?T=b:(T=b.timeout,B=b.method),g.Hb=!1,M=typeof B=="function"?B:B=="notifyWhenChangesStop"?f:u,g.ub(function(O){return M(O,T,b)})},deferred:function(g,b){if(b!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");g.Hb||(g.Hb=!0,g.ub(function(T){var B,M=!1;return function(){if(!M){m.na.cancel(B),B=m.na.zb(T);try{M=!0,g.notifySubscribers(e,"dirty")}finally{M=!1}}}}))},notify:function(g,b){g.equalityComparer=b=="always"?null:c}};var _={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(g,b,T){this.da=g,this.lc=b,this.mc=T,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(g){this.Jb=g,m.a.K.za(g,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,y),y.qb(this)};var y={qb:function(g){g.U={change:[]},g.sc=1},subscribe:function(g,b,T){var B=this;T=T||"change";var M=new m.ic(B,b?g.bind(b):g,function(){m.a.Pa(B.U[T],M),B.hb&&B.hb(T)});return B.Qa&&B.Qa(T),B.U[T]||(B.U[T]=[]),B.U[T].push(M),M},notifySubscribers:function(g,b){if(b=b||"change",b==="change"&&this.Gb(),this.Wa(b)){var T=b==="change"&&this.ed||this.U[b].slice(0);try{m.u.xc();for(var B=0,M;M=T[B];++B)M.Ib||M.lc(g)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(g){return this.ob()!==g},Gb:function(){++this.sc},ub:function(g){var b=this,T=m.O(b),B,M,O,G,k;b.gb||(b.gb=b.notifySubscribers,b.notifySubscribers=h);var z=g(function(){b.Ja=!1,T&&G===b&&(G=b.nc?b.nc():b());var F=M||k&&b.sb(O,G);k=M=B=!1,F&&b.gb(O=G)});b.qc=function(F,H){H&&b.Ja||(k=!H),b.ed=b.U.change.slice(0),b.Ja=B=!0,G=F,z()},b.pc=function(F){B||(O=F,b.gb(F,"beforeChange"))},b.rc=function(){k=!0},b.gd=function(){b.sb(O,b.v(!0))&&(M=!0)}},Wa:function(g){return this.U[g]&&this.U[g].length},Bd:function(g){if(g)return this.U[g]&&this.U[g].length||0;var b=0;return m.a.P(this.U,function(T,B){T!=="dirty"&&(b+=B.length)}),b},sb:function(g,b){return!this.equalityComparer||!this.equalityComparer(g,b)},toString:function(){return"[object Object]"},extend:function(g){var b=this;return g&&m.a.P(g,function(T,B){var M=m.Ta[T];typeof M=="function"&&(b=M(b,B)||b)}),b}};m.L(y,"init",y.qb),m.L(y,"subscribe",y.subscribe),m.L(y,"extend",y.extend),m.L(y,"getSubscriptionsCount",y.Bd),m.a.Ba&&m.a.setPrototypeOf(y,Function.prototype),m.T.fn=y,m.Qc=function(g){return g!=null&&typeof g.subscribe=="function"&&typeof g.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=(function(){function g(O){T.push(B),B=O}function b(){B=T.pop()}var T=[],B,M=0;return{xc:g,end:b,cc:function(O){if(B){if(!m.Qc(O))throw Error("Only subscribable things can act as dependencies");B.od.call(B.pd,O,O.fd||(O.fd=++M))}},G:function(O,G,k){try{return g(),O.apply(G,k||[])}finally{b()}},qa:function(){if(B)return B.o.qa()},Va:function(){if(B)return B.o.Va()},Ya:function(){if(B)return B.Ya},o:function(){if(B)return B.o}}})(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var C=m.a.Da("_latestValue");m.ta=function(g){function b(){return 0<arguments.length?(b.sb(b[C],arguments[0])&&(b.ya(),b[C]=arguments[0],b.xa()),this):(m.u.cc(b),b[C])}return b[C]=g,m.a.Ba||m.a.extend(b,m.T.fn),m.T.fn.qb(b),m.a.Ab(b,E),m.options.deferUpdates&&m.Ta.deferred(b,!0),b};var E={equalityComparer:c,v:function(){return this[C]},xa:function(){this.notifySubscribers(this[C],"spectate"),this.notifySubscribers(this[C])},ya:function(){this.notifySubscribers(this[C],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(E,m.T.fn);var I=m.ta.Ma="__ko_proto__";E[I]=m.ta,m.O=function(g){if((g=typeof g=="function"&&g[I])&&g!==E[I]&&g!==m.o.fn[I])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!g},m.Za=function(g){return typeof g=="function"&&(g[I]===E[I]||g[I]===m.o.fn[I]&&g.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",E),m.L(E,"peek",E.v),m.L(E,"valueHasMutated",E.xa),m.L(E,"valueWillMutate",E.ya),m.Ha=function(g){if(g=g||[],typeof g!="object"||!("length"in g))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return g=m.ta(g),m.a.Ab(g,m.Ha.fn),g.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(g){for(var b=this.v(),T=[],B=typeof g!="function"||m.O(g)?function(G){return G===g}:g,M=0;M<b.length;M++){var O=b[M];if(B(O)){if(T.length===0&&this.ya(),b[M]!==O)throw Error("Array modified during remove; cannot remove item");T.push(O),b.splice(M,1),M--}}return T.length&&this.xa(),T},removeAll:function(g){if(g===e){var b=this.v(),T=b.slice(0);return this.ya(),b.splice(0,b.length),this.xa(),T}return g?this.remove(function(B){return 0<=m.a.A(g,B)}):[]},destroy:function(g){var b=this.v(),T=typeof g!="function"||m.O(g)?function(O){return O===g}:g;this.ya();for(var B=b.length-1;0<=B;B--){var M=b[B];T(M)&&(M._destroy=!0)}this.xa()},destroyAll:function(g){return g===e?this.destroy(function(){return!0}):g?this.destroy(function(b){return 0<=m.a.A(g,b)}):[]},indexOf:function(g){var b=this();return m.a.A(b,g)},replace:function(g,b){var T=this.indexOf(g);0<=T&&(this.ya(),this.v()[T]=b,this.xa())},sorted:function(g){var b=this().slice(0);return g?b.sort(g):b.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(g){m.Ha.fn[g]=function(){var b=this.v();this.ya(),this.zc(b,g,arguments);var T=b[g].apply(b,arguments);return this.xa(),T===b?this:T}}),m.a.D(["slice"],function(g){m.Ha.fn[g]=function(){var b=this();return b[g].apply(b,arguments)}}),m.Pc=function(g){return m.O(g)&&typeof g.remove=="function"&&typeof g.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(g,b){function T(){function Y(){if(k){var $=[].concat(g.v()||[]),W;g.Wa("arrayChange")&&((!M||1<k)&&(M=m.a.Pb(z,$,g.Ob)),W=M),z=$,M=null,k=0,W&&W.length&&g.notifySubscribers(W,"arrayChange")}}B?Y():(B=!0,G=g.subscribe(function(){++k},null,"spectate"),z=[].concat(g.v()||[]),M=null,O=g.subscribe(Y))}if(g.Ob={},b&&typeof b=="object"&&m.a.extend(g.Ob,b),g.Ob.sparse=!0,!g.zc){var B=!1,M=null,O,G,k=0,z,F=g.Qa,H=g.hb;g.Qa=function(Y){F&&F.call(g,Y),Y==="arrayChange"&&T()},g.hb=function(Y){H&&H.call(g,Y),Y!=="arrayChange"||g.Wa("arrayChange")||(O&&O.s(),G&&G.s(),G=O=null,B=!1,z=e)},g.zc=function(Y,$,W){function K(Ne,Le,Oe){return Z[Z.length]={status:Ne,value:Le,index:Oe}}if(B&&!k){var Z=[],pe=Y.length,ge=W.length,re=0;switch($){case"push":re=pe;case"unshift":for($=0;$<ge;$++)K("added",W[$],re+$);break;case"pop":re=pe-1;case"shift":pe&&K("deleted",Y[re],re);break;case"splice":$=Math.min(Math.max(0,0>W[0]?pe+W[0]:W[0]),pe);for(var pe=ge===1?pe:Math.min($+(W[1]||0),pe),ge=$+ge-2,re=Math.max(pe,ge),ye=[],Ce=[],ve=2;$<re;++$,++ve)$<pe&&Ce.push(K("deleted",Y[$],$)),$<ge&&ye.push(K("added",W[ve],$));m.a.Kc(Ce,ye);break;default:return}M=Z}}}};var x=m.a.Da("_state");m.o=m.$=function(g,b,T){function B(){if(0<arguments.length){if(typeof M=="function")M.apply(O.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return O.ra||m.u.cc(B),(O.ka||O.J&&B.Xa())&&B.ha(),O.X}if(typeof g=="object"?T=g:(T=T||{},g&&(T.read=g)),typeof T.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var M=T.write,O={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:T.read,nb:b||T.owner,l:T.disposeWhenNodeIsRemoved||T.l||null,Sa:T.disposeWhen||T.Sa,Rb:null,I:{},V:0,Ic:null};return B[x]=O,B.Nc=typeof M=="function",m.a.Ba||m.a.extend(B,m.T.fn),m.T.fn.qb(B),m.a.Ab(B,S),T.pure?(O.wb=!0,O.J=!0,m.a.extend(B,w)):T.deferEvaluation&&m.a.extend(B,v),m.options.deferUpdates&&m.Ta.deferred(B,!0),O.l&&(O.jc=!0,O.l.nodeType||(O.l=null)),O.J||T.deferEvaluation||B.ha(),O.l&&B.ja()&&m.a.K.za(O.l,O.Rb=function(){B.s()}),B};var S={equalityComparer:c,qa:function(){return this[x].V},Va:function(){var g=[];return m.a.P(this[x].I,function(b,T){g[T.Ka]=T.da}),g},Vb:function(g){if(!this[x].V)return!1;var b=this.Va();return m.a.A(b,g)!==-1?!0:!!m.a.Lb(b,function(T){return T.Vb&&T.Vb(g)})},uc:function(g,b,T){if(this[x].wb&&b===this)throw Error("A 'pure' computed must not be called recursively");this[x].I[g]=T,T.Ka=this[x].V++,T.La=b.ob()},Xa:function(){var g,b,T=this[x].I;for(g in T)if(Object.prototype.hasOwnProperty.call(T,g)&&(b=T[g],this.Ia&&b.da.Ja||b.da.Dd(b.La)))return!0},Jd:function(){this.Ia&&!this[x].rb&&this.Ia(!1)},ja:function(){var g=this[x];return g.ka||0<g.V},Rd:function(){this.Ja?this[x].ka&&(this[x].sa=!0):this.Hc()},$c:function(g){if(g.Hb){var b=g.subscribe(this.Jd,this,"dirty"),T=g.subscribe(this.Rd,this);return{da:g,s:function(){b.s(),T.s()}}}return g.subscribe(this.Hc,this)},Hc:function(){var g=this,b=g.throttleEvaluation;b&&0<=b?(clearTimeout(this[x].Ic),this[x].Ic=m.a.setTimeout(function(){g.ha(!0)},b)):g.Ia?g.Ia(!0):g.ha(!0)},ha:function(g){var b=this[x],T=b.Sa,B=!1;if(!b.rb&&!b.ra){if(b.l&&!m.a.Sb(b.l)||T&&T()){if(!b.jc){this.s();return}}else b.jc=!1;b.rb=!0;try{B=this.zd(g)}finally{b.rb=!1}return B}},zd:function(g){var b=this[x],B=!1,T=b.wb?e:!b.V,B={qd:this,mb:b.I,Qb:b.V};m.u.xc({pd:B,od:A,o:this,Ya:T}),b.I={},b.V=0;var M=this.yd(b,B);return b.V?B=this.sb(b.X,M):(this.s(),B=!0),B&&(b.J?this.Gb():this.notifySubscribers(b.X,"beforeChange"),b.X=M,this.notifySubscribers(b.X,"spectate"),!b.J&&g&&this.notifySubscribers(b.X),this.rc&&this.rc()),T&&this.notifySubscribers(b.X,"awake"),B},yd:function(g,b){try{var T=g.Wc;return g.nb?T.call(g.nb):T()}finally{m.u.end(),b.Qb&&!g.J&&m.a.P(b.mb,p),g.sa=g.ka=!1}},v:function(g){var b=this[x];return(b.ka&&(g||!b.V)||b.J&&this.Xa())&&this.ha(),b.X},ub:function(g){m.T.fn.ub.call(this,g),this.nc=function(){return this[x].J||(this[x].sa?this.ha():this[x].ka=!1),this[x].X},this.Ia=function(b){this.pc(this[x].X),this[x].ka=!0,b&&(this[x].sa=!0),this.qc(this,!b)}},s:function(){var g=this[x];!g.J&&g.I&&m.a.P(g.I,function(b,T){T.s&&T.s()}),g.l&&g.Rb&&m.a.K.yb(g.l,g.Rb),g.I=e,g.V=0,g.ra=!0,g.sa=!1,g.ka=!1,g.J=!1,g.l=e,g.Sa=e,g.Wc=e,this.Nc||(g.nb=e)}},w={Qa:function(g){var b=this,T=b[x];if(!T.ra&&T.J&&g=="change"){if(T.J=!1,T.sa||b.Xa())T.I=null,T.V=0,b.ha()&&b.Gb();else{var B=[];m.a.P(T.I,function(M,O){B[O.Ka]=M}),m.a.D(B,function(M,O){var G=T.I[M],k=b.$c(G.da);k.Ka=O,k.La=G.La,T.I[M]=k}),b.Xa()&&b.ha()&&b.Gb()}T.ra||b.notifySubscribers(T.X,"awake")}},hb:function(g){var b=this[x];b.ra||g!="change"||this.Wa("change")||(m.a.P(b.I,function(T,B){B.s&&(b.I[T]={da:B.da,Ka:B.Ka,La:B.La},B.s())}),b.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var g=this[x];return g.J&&(g.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},v={Qa:function(g){g!="change"&&g!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(S,m.T.fn);var R=m.ta.Ma;S[R]=m.o,m.Oc=function(g){return typeof g=="function"&&g[R]===S[R]},m.Fd=function(g){return m.Oc(g)&&g[x]&&g[x].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",S),m.L(S,"peek",S.v),m.L(S,"dispose",S.s),m.L(S,"isActive",S.ja),m.L(S,"getDependenciesCount",S.qa),m.L(S,"getDependencies",S.Va),m.xb=function(g,b){return typeof g=="function"?m.o(g,b,{pure:!0}):(g=m.a.extend({},g),g.pure=!0,m.o(g,b))},m.b("pureComputed",m.xb),(function(){function g(B,M,O){if(O=O||new T,B=M(B),typeof B!="object"||B===null||B===e||B instanceof RegExp||B instanceof Date||B instanceof String||B instanceof Number||B instanceof Boolean)return B;var G=B instanceof Array?[]:{};return O.save(B,G),b(B,function(k){var z=M(B[k]);switch(typeof z){case"boolean":case"number":case"string":case"function":G[k]=z;break;case"object":case"undefined":var F=O.get(z);G[k]=F!==e?F:g(z,M,O)}}),G}function b(B,M){if(B instanceof Array){for(var O=0;O<B.length;O++)M(O);typeof B.toJSON=="function"&&M("toJSON")}else for(O in B)M(O)}function T(){this.keys=[],this.values=[]}m.ad=function(B){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return g(B,function(M){for(var O=0;m.O(M)&&10>O;O++)M=M();return M})},m.toJSON=function(B,M,O){return B=m.ad(B),m.a.hc(B,M,O)},T.prototype={constructor:T,save:function(B,M){var O=m.a.A(this.keys,B);0<=O?this.values[O]=M:(this.keys.push(B),this.values.push(M))},get:function(B){return B=m.a.A(this.keys,B),0<=B?this.values[B]:e}}})(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(g,b,T){function B(M){var O=m.xb(g,T).extend({ma:"always"}),G=O.subscribe(function(k){k&&(G.s(),M(k))});return O.notifySubscribers(O.v()),G}return typeof Promise!="function"||b?B(b.bind(T)):new Promise(B)},m.b("when",m.Wd),(function(){m.w={M:function(g){switch(m.a.R(g)){case"option":return g.__ko__hasDomDataOptionValue__===!0?m.a.g.get(g,m.c.options.$b):7>=m.a.W?g.getAttributeNode("value")&&g.getAttributeNode("value").specified?g.value:g.text:g.value;case"select":return 0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex]):e;default:return g.value}},cb:function(g,b,T){switch(m.a.R(g)){case"option":typeof b=="string"?(m.a.g.set(g,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in g&&delete g.__ko__hasDomDataOptionValue__,g.value=b):(m.a.g.set(g,m.c.options.$b,b),g.__ko__hasDomDataOptionValue__=!0,g.value=typeof b=="number"?b:"");break;case"select":(b===""||b===null)&&(b=e);for(var B=-1,M=0,O=g.options.length,G;M<O;++M)if(G=m.w.M(g.options[M]),G==b||G===""&&b===e){B=M;break}(T||0<=B||b===e&&1<g.size)&&(g.selectedIndex=B,m.a.W===6&&m.a.setTimeout(function(){g.selectedIndex=B},0));break;default:(b===null||b===e)&&(b=""),g.value=b}}}})(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=(function(){function g(k){k=m.a.Db(k),k.charCodeAt(0)===123&&(k=k.slice(1,-1)),k+=`
|
|
,`;var z=[],F=k.match(B),H,Y=[],$=0;if(1<F.length){for(var W=0,K;K=F[W];++W){var Z=K.charCodeAt(0);if(Z===44){if(0>=$){z.push(H&&Y.length?{key:H,value:Y.join("")}:{unknown:H||Y.join("")}),H=$=0,Y=[];continue}}else if(Z===58){if(!$&&!H&&Y.length===1){H=Y.pop();continue}}else{if(Z===47&&1<K.length&&(K.charCodeAt(1)===47||K.charCodeAt(1)===42))continue;Z===47&&W&&1<K.length?(Z=F[W-1].match(M))&&!O[Z[0]]&&(k=k.substr(k.indexOf(K)+1),F=k.match(B),W=-1,K="/"):Z===40||Z===123||Z===91?++$:Z===41||Z===125||Z===93?--$:H||Y.length||Z!==34&&Z!==39||(K=K.slice(1,-1))}Y.push(K)}if(0<$)throw Error("Unbalanced parentheses, braces, or brackets")}return z}var b=["true","false","null","undefined"],T=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,B=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|
|
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,O={in:1,return:1,typeof:1},G={};return{Ra:[],wa:G,ac:g,vb:function(k,z){function F(Z,pe){var ge;if(!W){var re=m.getBindingHandler(Z);if(re&&re.preprocess&&!(pe=re.preprocess(pe,Z,F)))return;(re=G[Z])&&(ge=pe,0<=m.a.A(b,ge)?ge=!1:(re=ge.match(T),ge=re===null?!1:re[1]?"Object("+re[1]+")"+re[2]:ge),re=ge),re&&Y.push("'"+(typeof G[Z]=="string"?G[Z]:Z)+"':function(_z){"+ge+"=_z}")}$&&(pe="function(){return "+pe+" }"),H.push("'"+Z+"':"+pe)}z=z||{};var H=[],Y=[],$=z.valueAccessors,W=z.bindingParams,K=typeof k=="string"?g(k):k;return m.a.D(K,function(Z){F(Z.key||Z.unknown,Z.value)}),Y.length&&F("_ko_property_writers","{"+Y.join(",")+" }"),H.join(",")},Id:function(k,z){for(var F=0;F<k.length;F++)if(k[F].key==z)return!0;return!1},eb:function(k,z,F,H,Y){k&&m.O(k)?!m.Za(k)||Y&&k.v()===H||k(H):(k=z.get("_ko_property_writers"))&&k[F]&&k[F](H)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function g(F){return F.nodeType==8&&O.test(M?F.text:F.nodeValue)}function b(F){return F.nodeType==8&&G.test(M?F.text:F.nodeValue)}function T(F,H){for(var Y=F,$=1,W=[];Y=Y.nextSibling;){if(b(Y)&&(m.a.g.set(Y,z,!0),$--,$===0))return W;W.push(Y),g(Y)&&$++}if(!H)throw Error("Cannot find closing comment tag to match: "+F.nodeValue);return null}function B(F,H){var Y=T(F,H);return Y?0<Y.length?Y[Y.length-1].nextSibling:F.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",O=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,G=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,k={ul:!0,ol:!0},z="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(F){return g(F)?T(F):F.childNodes},Ea:function(F){if(g(F)){F=m.h.childNodes(F);for(var H=0,Y=F.length;H<Y;H++)m.removeNode(F[H])}else m.a.Tb(F)},va:function(F,H){if(g(F)){m.h.Ea(F);for(var Y=F.nextSibling,$=0,W=H.length;$<W;$++)Y.parentNode.insertBefore(H[$],Y)}else m.a.va(F,H)},Vc:function(F,H){var Y;g(F)?(Y=F.nextSibling,F=F.parentNode):Y=F.firstChild,Y?H!==Y&&F.insertBefore(H,Y):F.appendChild(H)},Wb:function(F,H,Y){Y?(Y=Y.nextSibling,g(F)&&(F=F.parentNode),Y?H!==Y&&F.insertBefore(H,Y):F.appendChild(H)):m.h.Vc(F,H)},firstChild:function(F){if(g(F))return!F.nextSibling||b(F.nextSibling)?null:F.nextSibling;if(F.firstChild&&b(F.firstChild))throw Error("Found invalid end comment, as the first child of "+F);return F.firstChild},nextSibling:function(F){if(g(F)&&(F=B(F)),F.nextSibling&&b(F.nextSibling)){var H=F.nextSibling;if(b(H)&&!m.a.g.get(H,z))throw Error("Found end comment without a matching opening comment, as child of "+F);return null}return F.nextSibling},Cd:g,Vd:function(F){return(F=(M?F.text:F.nodeValue).match(O))?F[1]:null},Sc:function(F){if(k[m.a.R(F)]){var H=F.firstChild;if(H)do if(H.nodeType===1){var Y;Y=H.firstChild;var $=null;if(Y)do if($)$.push(Y);else if(g(Y)){var W=B(Y,!0);W?Y=W:$=[Y]}else b(Y)&&($=[Y]);while(Y=Y.nextSibling);if(Y=$)for($=H.nextSibling,W=0;W<Y.length;W++)$?F.insertBefore(Y[W],$):F.appendChild(Y[W])}while(H=H.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(g);case 8:return m.h.Cd(g);default:return!1}},getBindings:function(g,b){var T=this.getBindingsString(g,b),T=T?this.parseBindingsString(T,b,g):null;return m.j.tc(T,g,b,!1)},getBindingAccessors:function(g,b){var T=this.getBindingsString(g,b),T=T?this.parseBindingsString(T,b,g,{valueAccessors:!0}):null;return m.j.tc(T,g,b,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return m.h.Vd(g);default:return null}},parseBindingsString:function(g,b,T,B){try{var M=this.nd,O=g+(B&&B.valueAccessors||""),G;if(!(G=M[O])){var k,z="with($context){with($data||{}){return{"+m.m.vb(g,B)+"}}}";k=new Function("$context","$element",z),G=M[O]=k}return G(b,T)}catch(F){throw F.message=`Unable to parse bindings.
|
|
Bindings value: `+g+`
|
|
Message: `+F.message,F}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function g(re){var ye=(re=m.a.g.get(re,ge))&&re.N;ye&&(re.N=null,ye.Tc())}function b(re,ye,Ce){this.node=re,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(re,g),Ce&&Ce.N&&(Ce.N.kb.push(re),this.Kb=Ce)}function T(re){return function(){return re}}function B(re){return re()}function M(re){return m.a.Ga(m.u.G(re),function(ye,Ce){return function(){return re()[Ce]}})}function O(re,ye,Ce){return typeof re=="function"?M(re.bind(null,ye,Ce)):m.a.Ga(re,T)}function G(re,ye){return M(this.getBindings.bind(this,re,ye))}function k(re,ye){var Ce=m.h.firstChild(ye);if(Ce){var ve,Ne=m.ga.instance,Le=Ne.preprocessNode;if(Le){for(;ve=Ce;)Ce=m.h.nextSibling(ve),Le.call(Ne,ve);Ce=m.h.firstChild(ye)}for(;ve=Ce;)Ce=m.h.nextSibling(ve),z(re,ve)}m.i.ma(ye,m.i.H)}function z(re,ye){var Ce=re,ve=ye.nodeType===1;ve&&m.h.Sc(ye),(ve||m.ga.instance.nodeHasBindings(ye))&&(Ce=H(ye,null,re).bindingContextForDescendants),Ce&&!Z[m.a.R(ye)]&&k(Ce,ye)}function F(re){var ye=[],Ce={},ve=[];return m.a.P(re,function Ne(Le){if(!Ce[Le]){var Oe=m.getBindingHandler(Le);Oe&&(Oe.after&&(ve.push(Le),m.a.D(Oe.after,function(nt){if(re[nt]){if(m.a.A(ve,nt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+ve.join(", "));Ne(nt)}}),ve.length--),ye.push({key:Le,Mc:Oe})),Ce[Le]=!0}}),ye}function H(re,ye,Ce){var ve=m.a.g.Ub(re,ge,{}),Ne=ve.hd;if(!ye){if(Ne)throw Error("You cannot apply bindings multiple times to the same element.");ve.hd=!0}Ne||(ve.context=Ce),ve.Zb||(ve.Zb={});var Le;if(ye&&typeof ye!="function")Le=ye;else{var Oe=m.ga.instance,nt=Oe.getBindingAccessors||G,Fe=m.$(function(){return(Le=ye?ye(Ce,re):nt.call(Oe,re,Ce))&&(Ce[$]&&Ce[$](),Ce[K]&&Ce[K]()),Le},null,{l:re});Le&&Fe.ja()||(Fe=null)}var _t=Ce,rt;if(Le){var je=function(){return m.a.Ga(Fe?Fe():Le,B)},st=Fe?function(ft){return function(){return B(Fe()[ft])}}:function(ft){return Le[ft]};je.get=function(ft){return Le[ft]&&B(st(ft))},je.has=function(ft){return ft in Le},m.i.H in Le&&m.i.subscribe(re,m.i.H,function(){var ft=(0,Le[m.i.H])();if(ft){var St=m.h.childNodes(re);St.length&&ft(St,m.Ec(St[0]))}}),m.i.pa in Le&&(_t=m.i.Cb(re,Ce),m.i.subscribe(re,m.i.pa,function(){var ft=(0,Le[m.i.pa])();ft&&m.h.firstChild(re)&&ft(re)})),ve=F(Le),m.a.D(ve,function(ft){var St=ft.Mc.init,be=ft.Mc.update,Se=ft.key;if(re.nodeType===8&&!m.h.ea[Se])throw Error("The binding '"+Se+"' cannot be used with virtual elements");try{typeof St=="function"&&m.u.G(function(){var qt=St(re,st(Se),je,_t.$data,_t);if(qt&&qt.controlsDescendantBindings){if(rt!==e)throw Error("Multiple bindings ("+rt+" and "+Se+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");rt=Se}}),typeof be=="function"&&m.$(function(){be(re,st(Se),je,_t.$data,_t)},null,{l:re})}catch(qt){throw qt.message='Unable to process binding "'+Se+": "+Le[Se]+`"
|
|
Message: `+qt.message,qt}})}return ve=rt===e,{shouldBindDescendants:ve,bindingContextForDescendants:ve&&_t}}function Y(re,ye){return re&&re instanceof m.fa?re:new m.fa(re,e,e,ye)}var $=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),K=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(re){return m.c[re]};var pe={};m.fa=function(re,ye,Ce,ve,Ne){function Le(){var st=_t?Fe():Fe,ft=m.a.f(st);return ye?(m.a.extend(Oe,ye),W in ye&&(Oe[W]=ye[W])):(Oe.$parents=[],Oe.$root=ft,Oe.ko=m),Oe[$]=rt,nt?ft=Oe.$data:(Oe.$rawData=st,Oe.$data=ft),Ce&&(Oe[Ce]=ft),ve&&ve(Oe,ye,ft),ye&&ye[$]&&!m.S.o().Vb(ye[$])&&ye[$](),je&&(Oe[K]=je),Oe.$data}var Oe=this,nt=re===pe,Fe=nt?e:re,_t=typeof Fe=="function"&&!m.O(Fe),rt,je=Ne&&Ne.dataDependency;Ne&&Ne.exportDependencies?Le():(rt=m.xb(Le),rt.v(),rt.ja()?rt.equalityComparer=null:Oe[$]=e)},m.fa.prototype.createChildContext=function(re,ye,Ce,ve){if(!ve&&ye&&typeof ye=="object"&&(ve=ye,ye=ve.as,Ce=ve.extend),ye&&ve&&ve.noChildContext){var Ne=typeof re=="function"&&!m.O(re);return new m.fa(pe,this,null,function(Le){Ce&&Ce(Le),Le[ye]=Ne?re():re},ve)}return new m.fa(re,this,ye,function(Le,Oe){Le.$parentContext=Oe,Le.$parent=Oe.$data,Le.$parents=(Oe.$parents||[]).slice(0),Le.$parents.unshift(Le.$parent),Ce&&Ce(Le)},ve)},m.fa.prototype.extend=function(re,ye){return new m.fa(pe,this,null,function(Ce){m.a.extend(Ce,typeof re=="function"?re(Ce):re)},ye)};var ge=m.a.g.Z();b.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},b.prototype.sd=function(re){m.a.Pa(this.kb,re),!this.kb.length&&this.H&&this.Cc()},b.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,g),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(re,ye,Ce,ve,Ne){var Le=m.a.g.Ub(re,ge,{});return Le.Fa||(Le.Fa=new m.T),Ne&&Ne.notifyImmediately&&Le.Zb[ye]&&m.u.G(Ce,ve,[re]),Le.Fa.subscribe(Ce,ve,ye)},ma:function(re,ye){var Ce=m.a.g.get(re,ge);if(Ce&&(Ce.Zb[ye]=!0,Ce.Fa&&Ce.Fa.notifySubscribers(re,ye),ye==m.i.H)){if(Ce.N)Ce.N.Cc();else if(Ce.N===e&&Ce.Fa&&Ce.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(re,ye){var Ce=m.a.g.Ub(re,ge,{});return Ce.N||(Ce.N=new b(re,Ce,ye[W])),ye[W]==Ce?ye:ye.extend(function(ve){ve[W]=Ce})}},m.Td=function(re){return(re=m.a.g.get(re,ge))&&re.context},m.ib=function(re,ye,Ce){return re.nodeType===1&&m.h.Sc(re),H(re,ye,Y(Ce))},m.ld=function(re,ye,Ce){return Ce=Y(Ce),m.ib(re,O(ye,Ce,re),Ce)},m.Oa=function(re,ye){ye.nodeType!==1&&ye.nodeType!==8||k(Y(re),ye)},m.vc=function(re,ye,Ce){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");z(Y(re,Ce),ye)},m.Dc=function(re){return!re||re.nodeType!==1&&re.nodeType!==8?e:m.Td(re)},m.Ec=function(re){return(re=m.Dc(re))?re.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(g){function b(G,k){var z=Object.prototype.hasOwnProperty.call(M,G)?M[G]:g,F;z?z.subscribe(k):(z=M[G]=new m.T,z.subscribe(k),T(G,function(H,Y){var $=!(!Y||!Y.synchronous);O[G]={definition:H,Gd:$},delete M[G],F||$?z.notifySubscribers(H):m.na.zb(function(){z.notifySubscribers(H)})}),F=!0)}function T(G,k){B("getConfig",[G],function(z){z?B("loadComponent",[G,z],function(F){k(F,z)}):k(null,null)})}function B(G,k,z,F){F||(F=m.j.loaders.slice(0));var H=F.shift();if(H){var Y=H[G];if(Y){var $=!1;if(Y.apply(H,k.concat(function(W){$?z(null):W!==null?z(W):B(G,k,z,F)}))!==g&&($=!0,!H.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else B(G,k,z,F)}else z(null)}var M={},O={};m.j={get:function(G,k){var z=Object.prototype.hasOwnProperty.call(O,G)?O[G]:g;z?z.Gd?m.u.G(function(){k(z.definition)}):m.na.zb(function(){k(z.definition)}):b(G,k)},Bc:function(G){delete O[G]},oc:B},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function g(z,F,H,Y){function $(){--K===0&&Y(W)}var W={},K=2,Z=H.template;H=H.viewModel,Z?M(F,Z,function(pe){m.j.oc("loadTemplate",[z,pe],function(ge){W.template=ge,$()})}):$(),H?M(F,H,function(pe){m.j.oc("loadViewModel",[z,pe],function(ge){W[k]=ge,$()})}):$()}function b(z,F,H){if(typeof F=="function")H(function($){return new F($)});else if(typeof F[k]=="function")H(F[k]);else if("instance"in F){var Y=F.instance;H(function(){return Y})}else"viewModel"in F?b(z,F.viewModel,H):z("Unknown viewModel value: "+F)}function T(z){switch(m.a.R(z)){case"script":return m.a.ua(z.text);case"textarea":return m.a.ua(z.value);case"template":if(B(z.content))return m.a.Ca(z.content.childNodes)}return m.a.Ca(z.childNodes)}function B(z){return t.DocumentFragment?z instanceof DocumentFragment:z&&z.nodeType===11}function M(z,F,H){typeof F.require=="string"?s||t.require?(s||t.require)([F.require],function(Y){Y&&typeof Y=="object"&&Y.Xd&&Y.default&&(Y=Y.default),H(Y)}):z("Uses require, but no AMD loader is present"):H(F)}function O(z){return function(F){throw Error("Component '"+z+"': "+F)}}var G={};m.j.register=function(z,F){if(!F)throw Error("Invalid configuration for "+z);if(m.j.tb(z))throw Error("Component "+z+" is already registered");G[z]=F},m.j.tb=function(z){return Object.prototype.hasOwnProperty.call(G,z)},m.j.unregister=function(z){delete G[z],m.j.Bc(z)},m.j.Fc={getConfig:function(z,F){F(m.j.tb(z)?G[z]:null)},loadComponent:function(z,F,H){var Y=O(z);M(Y,F,function($){g(z,Y,$,H)})},loadTemplate:function(z,F,H){if(z=O(z),typeof F=="string")H(m.a.ua(F));else if(F instanceof Array)H(F);else if(B(F))H(m.a.la(F.childNodes));else if(F.element)if(F=F.element,t.HTMLElement?F instanceof HTMLElement:F&&F.tagName&&F.nodeType===1)H(T(F));else if(typeof F=="string"){var Y=n.getElementById(F);Y?H(T(Y)):z("Cannot find element with ID "+F)}else z("Unknown element type: "+F);else z("Unknown template value: "+F)},loadViewModel:function(z,F,H){b(O(z),F,H)}};var k="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=G})(),(function(){function g(T,B){var M=T.getAttribute("params");if(M){var M=b.parseBindingsString(M,B,T,{valueAccessors:!0,bindingParams:!0}),M=m.a.Ga(M,function(k){return m.o(k,null,{l:T})}),O=m.a.Ga(M,function(k){var z=k.v();return k.ja()?m.o({read:function(){return m.a.f(k())},write:m.Za(z)&&function(F){k()(F)},l:T}):z});return Object.prototype.hasOwnProperty.call(O,"$raw")||(O.$raw=M),O}return{$raw:{}}}m.j.getComponentNameForNode=function(T){var B=m.a.R(T);if(m.j.tb(B)&&(B.indexOf("-")!=-1||""+T=="[object HTMLUnknownElement]"||8>=m.a.W&&T.tagName===B))return B},m.j.tc=function(T,B,M,O){if(B.nodeType===1){var G=m.j.getComponentNameForNode(B);if(G){if(T=T||{},T.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var k={name:G,params:g(B,M)};T.component=O?function(){return k}:k}}return T};var b=new m.ga;9>m.a.W&&(m.j.register=(function(T){return function(B){return T.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(T){return function(){var B=T(),M=m.j.dd,O;for(O in M);return B}})(n.createDocumentFragment))})(),(function(){function g(B,M,O){if(M=M.template,!M)throw Error("Component '"+B+"' has no template");B=m.a.Ca(M),m.h.va(O,B)}function b(B,M,O){var G=B.createViewModel;return G?G.call(B,M,O):M}var T=0;m.c.component={init:function(B,M,O,G,k){function z(){var W=F&&F.dispose;typeof W=="function"&&W.call(F),Y&&Y.s(),H=F=Y=null}var F,H,Y,$=m.a.la(m.h.childNodes(B));return m.h.Ea(B),m.a.K.za(B,z),m.o(function(){var W=m.a.f(M()),K,Z;if(typeof W=="string"?K=W:(K=m.a.f(W.name),Z=m.a.f(W.params)),!K)throw Error("No component name specified");var pe=m.i.Cb(B,k),ge=H=++T;m.j.get(K,function(re){if(H===ge){if(z(),!re)throw Error("Unknown component '"+K+"'");g(K,re,B);var ye=b(re,Z,{element:B,templateNodes:$});re=pe.createChildContext(ye,{extend:function(Ce){Ce.$component=ye,Ce.$componentTemplateNodes=$}}),ye&&ye.koDescendantsComplete&&(Y=m.i.subscribe(B,m.i.pa,ye.koDescendantsComplete,ye)),F=ye,m.Oa(re,B)}})},null,{l:B}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var N={class:"className",for:"htmlFor"};m.c.attr={update:function(g,b){var T=m.a.f(b())||{};m.a.P(T,function(B,M){M=m.a.f(M);var O=B.indexOf(":"),O="lookupNamespaceURI"in g&&0<O&&g.lookupNamespaceURI(B.substr(0,O)),G=M===!1||M===null||M===e;G?O?g.removeAttributeNS(O,B):g.removeAttribute(B):M=M.toString(),8>=m.a.W&&B in N?(B=N[B],G?g.removeAttribute(B):g[B]=M):G||(O?g.setAttributeNS(O,B,M):g.setAttribute(B,M)),B==="name"&&m.a.Yc(g,G?"":M)})}},(function(){m.c.checked={after:["value","attr"],init:function(g,b,T){function B(){var W=g.checked,K=O();if(!m.S.Ya()&&(W||!k&&!m.S.qa())){var Z=m.u.G(b);if(F){var pe=H?Z.v():Z,ge=$;$=K,ge!==K?W&&(m.a.Na(pe,K,!0),m.a.Na(pe,ge,!1)):m.a.Na(pe,K,W),H&&m.Za(Z)&&Z(pe)}else G&&(K===e?K=W:W||(K=e)),m.m.eb(Z,T,"checked",K,!0)}}function M(){var W=m.a.f(b()),K=O();F?(g.checked=0<=m.a.A(W,K),$=K):g.checked=G&&K===e?!!W:O()===W}var O=m.xb(function(){if(T.has("checkedValue"))return m.a.f(T.get("checkedValue"));if(Y)return T.has("value")?m.a.f(T.get("value")):g.value}),G=g.type=="checkbox",k=g.type=="radio";if(G||k){var z=b(),F=G&&m.a.f(z)instanceof Array,H=!(F&&z.push&&z.splice),Y=k||F,$=F?O():e;k&&!g.name&&m.c.uniqueName.init(g,function(){return!0}),m.o(B,null,{l:g}),m.a.B(g,"click",B),m.o(M,null,{l:g}),z=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(g,b){g.value=m.a.f(b())}}})(),m.c.class={update:function(g,b){var T=m.a.Db(m.a.f(b()));m.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=T,m.a.Eb(g,T,!0)}},m.c.css={update:function(g,b){var T=m.a.f(b());T!==null&&typeof T=="object"?m.a.P(T,function(B,M){M=m.a.f(M),m.a.Eb(g,B,M)}):m.c.class.update(g,b)}},m.c.enable={update:function(g,b){var T=m.a.f(b());T&&g.disabled?g.removeAttribute("disabled"):T||g.disabled||(g.disabled=!0)}},m.c.disable={update:function(g,b){m.c.enable.update(g,function(){return!m.a.f(b())})}},m.c.event={init:function(g,b,T,B,M){var O=b()||{};m.a.P(O,function(G){typeof G=="string"&&m.a.B(g,G,function(k){var z,F=b()[G];if(F){try{var H=m.a.la(arguments);B=M.$data,H.unshift(B),z=F.apply(B,H)}finally{z!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}T.get(G+"Bubble")===!1&&(k.cancelBubble=!0,k.stopPropagation&&k.stopPropagation())}})})}},m.c.foreach={Rc:function(g){return function(){var b=g(),T=m.a.bc(b);return!T||typeof T.length=="number"?{foreach:b,templateEngine:m.ba.Ma}:(m.a.f(b),{foreach:T.data,as:T.as,noChildContext:T.noChildContext,includeDestroyed:T.includeDestroyed,afterAdd:T.afterAdd,beforeRemove:T.beforeRemove,afterRender:T.afterRender,beforeMove:T.beforeMove,afterMove:T.afterMove,templateEngine:m.ba.Ma})}},init:function(g,b){return m.c.template.init(g,m.c.foreach.Rc(b))},update:function(g,b,T,B,M){return m.c.template.update(g,m.c.foreach.Rc(b),T,B,M)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(g,b,T){function B(G){g.__ko_hasfocusUpdating=!0;var k=g.ownerDocument;if("activeElement"in k){var z;try{z=k.activeElement}catch{z=k.body}G=z===g}k=b(),m.m.eb(k,T,"hasfocus",G,!0),g.__ko_hasfocusLastValue=G,g.__ko_hasfocusUpdating=!1}var M=B.bind(null,!0),O=B.bind(null,!1);m.a.B(g,"focus",M),m.a.B(g,"focusin",M),m.a.B(g,"blur",O),m.a.B(g,"focusout",O),g.__ko_hasfocusLastValue=!1},update:function(g,b){var T=!!m.a.f(b());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===T||(T?g.focus():g.blur(),!T&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[g,T?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,b){m.a.fc(g,b())}},(function(){function g(b,T,B){m.c[b]={init:function(M,O,G,k,z){var F,H,Y={},$,W,K;if(T){k=G.get("as");var Z=G.get("noChildContext");K=!(k&&Z),Y={as:k,noChildContext:Z,exportDependencies:K}}return W=($=G.get("completeOn")=="render")||G.has(m.i.pa),m.o(function(){var pe=m.a.f(O()),ge=!B!=!pe,re=!H,ye;(K||ge!==F)&&(W&&(z=m.i.Cb(M,z)),ge&&((!T||K)&&(Y.dataDependency=m.S.o()),ye=T?z.createChildContext(typeof pe=="function"?pe:O,Y):m.S.qa()?z.extend(null,Y):z),re&&m.S.qa()&&(H=m.a.Ca(m.h.childNodes(M),!0)),ge?(re||m.h.va(M,m.a.Ca(H)),m.Oa(ye,M)):(m.h.Ea(M),$||m.i.ma(M,m.i.H)),F=ge)},null,{l:M}),{controlsDescendantBindings:!0}}},m.m.Ra[b]=!1,m.h.ea[b]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)})(),m.c.let={init:function(g,b,T,B,M){return b=M.extend(b),m.Oa(b,g),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(g){if(m.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,b,T){function B(){return m.a.jb(g.options,function(Z){return Z.selected})}function M(Z,pe,ge){var re=typeof pe;return re=="function"?pe(Z):re=="string"?Z[pe]:ge}function O(Z,pe){if(W&&F)m.i.ma(g,m.i.H);else if($.length){var ge=0<=m.a.A($,m.w.M(pe[0]));m.a.Zc(pe[0],ge),W&&!ge&&m.u.G(m.a.Fb,null,[g,"change"])}}var G=g.multiple,k=g.length!=0&&G?g.scrollTop:null,z=m.a.f(b()),F=T.get("valueAllowUnset")&&T.has("value"),H=T.get("optionsIncludeDestroyed");b={};var Y,$=[];F||(G?$=m.a.Mb(B(),m.w.M):0<=g.selectedIndex&&$.push(m.w.M(g.options[g.selectedIndex]))),z&&(typeof z.length>"u"&&(z=[z]),Y=m.a.jb(z,function(Z){return H||Z===e||Z===null||!m.a.f(Z._destroy)}),T.has("optionsCaption")&&(z=m.a.f(T.get("optionsCaption")),z!==null&&z!==e&&Y.unshift(L)));var W=!1;if(b.beforeRemove=function(Z){g.removeChild(Z)},z=O,T.has("optionsAfterRender")&&typeof T.get("optionsAfterRender")=="function"&&(z=function(Z,pe){O(0,pe),m.u.G(T.get("optionsAfterRender"),null,[pe[0],Z!==L?Z:e])}),m.a.ec(g,Y,function(Z,pe,ge){return ge.length&&($=!F&&ge[0].selected?[m.w.M(ge[0])]:[],W=!0),pe=g.ownerDocument.createElement("option"),Z===L?(m.a.Bb(pe,T.get("optionsCaption")),m.w.cb(pe,e)):(ge=M(Z,T.get("optionsValue"),Z),m.w.cb(pe,m.a.f(ge)),Z=M(Z,T.get("optionsText"),ge),m.a.Bb(pe,Z)),[pe]},b,z),!F){var K;G?K=$.length&&B().length<$.length:K=$.length&&0<=g.selectedIndex?m.w.M(g.options[g.selectedIndex])!==$[0]:$.length||0<=g.selectedIndex,K&&m.u.G(m.a.Fb,null,[g,"change"])}(F||m.S.Ya())&&m.i.ma(g,m.i.H),m.a.wd(g),k&&20<Math.abs(k-g.scrollTop)&&(g.scrollTop=k)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(g,b,T){function B(){var G=b(),k=[];m.a.D(g.getElementsByTagName("option"),function(z){z.selected&&k.push(m.w.M(z))}),m.m.eb(G,T,"selectedOptions",k)}function M(){var G=m.a.f(b()),k=g.scrollTop;G&&typeof G.length=="number"&&m.a.D(g.getElementsByTagName("option"),function(z){var F=0<=m.a.A(G,m.w.M(z));z.selected!=F&&m.a.Zc(z,F)}),g.scrollTop=k}if(m.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var O;m.i.subscribe(g,m.i.H,function(){O?B():(m.a.B(g,"change",B),O=m.o(M,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(g,b){var T=m.a.f(b()||{});m.a.P(T,function(B,M){if(M=m.a.f(M),(M===null||M===e||M===!1)&&(M=""),o)o(g).css(B,M);else if(/^--/.test(B))g.style.setProperty(B,M);else{B=B.replace(/-(\w)/g,function(G,k){return k.toUpperCase()});var O=g.style[B];g.style[B]=M,M===O||g.style[B]!=O||isNaN(M)||(g.style[B]=M+"px")}})}},m.c.submit={init:function(g,b,T,B,M){if(typeof b()!="function")throw Error("The value for a submit binding must be a function");m.a.B(g,"submit",function(O){var G,k=b();try{G=k.call(M.$data,g)}finally{G!==!0&&(O.preventDefault?O.preventDefault():O.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,b){m.a.Bb(g,b())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var g=function(Y){if(Y)return parseFloat(Y[1])},b=t.navigator.userAgent,T,B,M,O,G;(T=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(G=g(b.match(/Edge\/([^ ]+)$/)))||g(b.match(/Chrome\/([^ ]+)/))||(B=g(b.match(/Version\/([^ ]+) Safari/)))||(M=g(b.match(/Firefox\/([^ ]+)/)))||(O=m.a.W||g(b.match(/MSIE ([^ ]+)/)))||(O=g(b.match(/rv:([^ )]+)/)))}if(8<=O&&10>O)var k=m.a.g.Z(),z=m.a.g.Z(),F=function(Y){var $=this.activeElement;($=$&&m.a.g.get($,z))&&$(Y)},H=function(Y,$){var W=Y.ownerDocument;m.a.g.get(W,k)||(m.a.g.set(W,k,!0),m.a.B(W,"selectionchange",F)),m.a.g.set(Y,z,$)};m.c.textInput={init:function(Y,$,W){function K(Le,Oe){m.a.B(Y,Le,Oe)}function Z(){var Le=m.a.f($());(Le===null||Le===e)&&(Le=""),Ce!==e&&Le===Ce?m.a.setTimeout(Z,4):Y.value!==Le&&(Ne=!0,Y.value=Le,Ne=!1,re=Y.value)}function pe(){ye||(Ce=Y.value,ye=m.a.setTimeout(ge,4))}function ge(){clearTimeout(ye),Ce=ye=e;var Le=Y.value;re!==Le&&(re=Le,m.m.eb($(),W,"textInput",Le))}var re=Y.value,ye,Ce,ve=m.a.W==9?pe:ge,Ne=!1;O&&K("keypress",ge),11>O&&K("propertychange",function(Le){Ne||Le.propertyName!=="value"||ve(Le)}),O==8&&(K("keyup",ge),K("keydown",ge)),H&&(H(Y,ve),K("dragend",pe)),(!O||9<=O)&&K("input",ve),5>B&&m.a.R(Y)==="textarea"?(K("keydown",pe),K("paste",pe),K("cut",pe)):11>T?K("keydown",pe):4>M?(K("DOMAutoComplete",ge),K("dragdrop",ge),K("drop",ge)):G&&Y.type==="number"&&K("keydown",pe),K("change",ge),K("blur",ge),m.o(Z,null,{l:Y})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(Y,$,W){W("textInput",Y)}}})(),m.c.uniqueName={init:function(g,b){if(b()){var T="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(g,T)}}},m.c.uniqueName.rd=0,m.c.using={init:function(g,b,T,B,M){var O;return T.has("as")&&(O={as:T.get("as"),noChildContext:T.get("noChildContext")}),b=M.createChildContext(b,O),m.Oa(b,g),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(g,b,T){var B=m.a.R(g),M=B=="input";if(!M||g.type!="checkbox"&&g.type!="radio"){var O=[],G=T.get("valueUpdate"),k=!1,z=null;G&&(typeof G=="string"?O=[G]:O=m.a.wc(G),m.a.Pa(O,"change"));var F=function(){z=null,k=!1;var $=b(),W=m.w.M(g);m.m.eb($,T,"value",W)};!m.a.W||!M||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||m.a.A(O,"propertychange")!=-1||(m.a.B(g,"propertychange",function(){k=!0}),m.a.B(g,"focus",function(){k=!1}),m.a.B(g,"blur",function(){k&&F()})),m.a.D(O,function($){var W=F;m.a.Ud($,"after")&&(W=function(){z=m.w.M(g),m.a.setTimeout(F,0)},$=$.substring(5)),m.a.B(g,$,W)});var H;if(H=M&&g.type=="file"?function(){var $=m.a.f(b());$===null||$===e||$===""?g.value="":m.u.G(F)}:function(){var $=m.a.f(b()),W=m.w.M(g);z!==null&&$===z?m.a.setTimeout(H,0):($!==W||W===e)&&(B==="select"?(W=T.get("valueAllowUnset"),m.w.cb(g,$,W),W||$===m.w.M(g)||m.u.G(F)):m.w.cb(g,$))},B==="select"){var Y;m.i.subscribe(g,m.i.H,function(){Y?T.get("valueAllowUnset")?H():F():(m.a.B(g,"change",F),Y=m.o(H,null,{l:g}))},null,{notifyImmediately:!0})}else m.a.B(g,"change",F),m.o(H,null,{l:g})}else m.ib(g,{checkedValue:b})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(g,b){var T=m.a.f(b()),B=g.style.display!="none";T&&!B?g.style.display="":!T&&B&&(g.style.display="none")}},m.c.hidden={update:function(g,b){m.c.visible.update(g,function(){return!m.a.f(b())})}},(function(g){m.c[g]={init:function(b,T,B,M,O){return m.c.event.init.call(this,b,function(){var G={};return G[g]=T(),G},B,M,O)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(g,b){if(typeof g=="string"){b=b||n;var T=b.getElementById(g);if(!T)throw Error("Cannot find template with ID "+g);return new m.C.F(T)}if(g.nodeType==1||g.nodeType==8)return new m.C.ia(g);throw Error("Unknown template type: "+g)},m.ca.prototype.renderTemplate=function(g,b,T,B){return g=this.makeTemplateSource(g,B),this.renderTemplateSource(g,b,T,B)},m.ca.prototype.isTemplateRewritten=function(g,b){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,b).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(g,b,T){g=this.makeTemplateSource(g,T),b=b(g.text()),g.text(b),g.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function g(B,M,O,G){B=m.m.ac(B);for(var k=m.m.Ra,z=0;z<B.length;z++){var F=B[z].key;if(Object.prototype.hasOwnProperty.call(k,F)){var H=k[F];if(typeof H=="function"){if(F=H(B[z].value))throw Error(F)}else if(!H)throw Error("This template engine does not support the '"+F+"' binding within its templates")}}return O="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(B,{valueAccessors:!0})+" } })()},'"+O.toLowerCase()+"')",G.createJavaScriptEvaluatorBlock(O)+M}var b=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,T=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(B,M,O){M.isTemplateRewritten(B,O)||M.rewriteTemplate(B,function(G){return m.kc.Ld(G,M)},O)},Ld:function(B,M){return B.replace(b,function(O,G,k,z,F){return g(F,G,k,M)}).replace(T,function(O,G){return g(G,"<!-- ko -->","#comment",M)})},md:function(B,M){return m.aa.Xb(function(O,G){var k=O.nextSibling;k&&k.nodeName.toLowerCase()===M&&m.ib(k,B,G)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(T){if(this.F=T){var B=m.a.R(T);this.ab=B==="script"?1:B==="textarea"?2:B=="template"&&T.content&&T.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var T=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[T];var B=arguments[0];T==="innerHTML"?m.a.fc(this.F,B):this.F[T]=B};var g=m.a.g.Z()+"_";m.C.F.prototype.data=function(T){if(arguments.length===1)return m.a.g.get(this.F,g+T);m.a.g.set(this.F,g+T,arguments[1])};var b=m.a.g.Z();m.C.F.prototype.nodes=function(){var T=this.F;if(arguments.length==0){var B=m.a.g.get(T,b)||{},M=B.lb||(this.ab===3?T.content:this.ab===4?T:e);if(!M||B.jd){var O=this.text();O&&O!==B.bb&&(M=m.a.Md(O,T.ownerDocument),m.a.g.set(T,b,{lb:M,bb:O,jd:!0}))}return M}B=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(T,b,{lb:B})},m.C.ia=function(T){this.F=T},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var T=m.a.g.get(this.F,b)||{};return T.bb===e&&T.lb&&(T.bb=T.lb.innerHTML),T.bb}m.a.g.set(this.F,b,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function g(z,F,H){var Y;for(F=m.h.nextSibling(F);z&&(Y=z)!==F;)z=m.h.nextSibling(Y),H(Y,z)}function b(z,F){if(z.length){var H=z[0],Y=z[z.length-1],$=H.parentNode,W=m.ga.instance,K=W.preprocessNode;if(K){if(g(H,Y,function(Z,pe){var ge=Z.previousSibling,re=K.call(W,Z);re&&(Z===H&&(H=re[0]||pe),Z===Y&&(Y=re[re.length-1]||ge))}),z.length=0,!H)return;H===Y?z.push(H):(z.push(H,Y),m.a.Ua(z,$))}g(H,Y,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(F,Z)}),g(H,Y,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[F])}),m.a.Ua(z,$)}}function T(z){return z.nodeType?z:0<z.length?z[0]:null}function B(z,F,H,Y,$){$=$||{};var W=(z&&T(z)||H||{}).ownerDocument,K=$.templateEngine||O;if(m.kc.xd(H,K,W),H=K.renderTemplate(H,Y,$,W),typeof H.length!="number"||0<H.length&&typeof H[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,F){case"replaceChildren":m.h.va(z,H),W=!0;break;case"replaceNode":m.a.Xc(z,H),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+F)}return W&&(b(H,Y),$.afterRender&&m.u.G($.afterRender,null,[H,Y[$.as||"$data"]]),F=="replaceChildren"&&m.i.ma(z,m.i.H)),H}function M(z,F,H){return m.O(z)?z():typeof z=="function"?z(F,H):z}var O;m.gc=function(z){if(z!=e&&!(z instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");O=z},m.dc=function(z,F,H,Y,$){if(H=H||{},(H.templateEngine||O)==e)throw Error("Set a template engine before calling renderTemplate");if($=$||"replaceChildren",Y){var W=T(Y);return m.$(function(){var Z=F&&F instanceof m.fa?F:new m.fa(F,null,null,null,{exportDependencies:!0}),K=M(z,Z.$data,Z),Z=B(Y,$,K,Z,H);$=="replaceNode"&&(Y=Z,W=T(Y))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&$=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(K){m.dc(z,F,H,K,"replaceNode")})},m.Qd=function(z,F,H,Y,$){function W(Ce,ve){m.u.G(m.a.ec,null,[Y,Ce,Z,H,K,ve]),m.i.ma(Y,m.i.H)}function K(Ce,ve){b(ve,pe),H.afterRender&&H.afterRender(ve,Ce),pe=null}function Z(Ce,ve){pe=$.createChildContext(Ce,{as:ge,noChildContext:H.noChildContext,extend:function(Le){Le.$index=ve,ge&&(Le[ge+"Index"]=ve)}});var Ne=M(z,Ce,pe);return B(Y,"ignoreTargetNode",Ne,pe,H)}var pe,ge=H.as,re=H.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!H.includeDestroyed;if(re||H.beforeRemove||!m.Pc(F))return m.$(function(){var Ce=m.a.f(F)||[];typeof Ce.length>"u"&&(Ce=[Ce]),re&&(Ce=m.a.jb(Ce,function(ve){return ve===e||ve===null||!m.a.f(ve._destroy)})),W(Ce)},null,{l:Y});W(F.v());var ye=F.subscribe(function(Ce){W(F(),Ce)},null,"arrayChange");return ye.l(Y),ye};var G=m.a.g.Z(),k=m.a.g.Z();m.c.template={init:function(z,F){var H=m.a.f(F());if(typeof H=="string"||"name"in H)m.h.Ea(z);else if("nodes"in H){if(H=H.nodes||[],m.O(H))throw Error('The "nodes" option must be a plain, non-observable array.');var Y=H[0]&&H[0].parentNode;Y&&m.a.g.get(Y,k)||(Y=m.a.Yb(H),m.a.g.set(Y,k,!0)),new m.C.ia(z).nodes(Y)}else if(H=m.h.childNodes(z),0<H.length)Y=m.a.Yb(H),new m.C.ia(z).nodes(Y);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(z,F,H,Y,$){var W=F();F=m.a.f(W),H=!0,Y=null,typeof F=="string"?F={}:(W="name"in F?F.name:z,"if"in F&&(H=m.a.f(F.if)),H&&"ifnot"in F&&(H=!m.a.f(F.ifnot)),H&&!W&&(H=!1)),"foreach"in F?Y=m.Qd(W,H&&F.foreach||[],F,z,$):H?(H=$,"data"in F&&(H=$.createChildContext(F.data,{as:F.as,noChildContext:F.noChildContext,exportDependencies:!0})),Y=m.dc(W,H,F,z)):m.h.Ea(z),$=Y,(F=m.a.g.get(z,G))&&typeof F.s=="function"&&F.s(),m.a.g.set(z,G,!$||$.ja&&!$.ja()?e:$)}},m.m.Ra.template=function(z){return z=m.m.ac(z),z.length==1&&z[0].unknown||m.m.Id(z,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(g,b,T){if(g.length&&b.length){var B,M,O,G,k;for(B=M=0;(!T||B<T)&&(G=g[M]);++M){for(O=0;k=b[O];++O)if(G.value===k.value){G.moved=k.index,k.moved=G.index,b.splice(O,1),B=O=0;break}B+=O}}},m.a.Pb=(function(){function g(b,T,B,M,O){var G=Math.min,k=Math.max,z=[],F,H=b.length,Y,$=T.length,W=$-H||1,K=H+$+1,Z,pe,ge;for(F=0;F<=H;F++)for(pe=Z,z.push(Z=[]),ge=G($,F+W),Y=k(0,F-1);Y<=ge;Y++)Z[Y]=Y?F?b[F-1]===T[Y-1]?pe[Y-1]:G(pe[Y]||K,Z[Y-1]||K)+1:Y+1:F+1;for(G=[],k=[],W=[],F=H,Y=$;F||Y;)$=z[F][Y]-1,Y&&$===z[F][Y-1]?k.push(G[G.length]={status:B,value:T[--Y],index:Y}):F&&$===z[F-1][Y]?W.push(G[G.length]={status:M,value:b[--F],index:F}):(--Y,--F,O.sparse||G.push({status:"retained",value:T[Y]}));return m.a.Kc(W,k,!O.dontLimitMoves&&10*H),G.reverse()}return function(b,T,B){return B=typeof B=="boolean"?{dontLimitMoves:B}:B||{},b=b||[],T=T||[],b.length<T.length?g(b,T,"added","deleted",B):g(T,b,"deleted","added",B)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function g(B,M,O,G,k){var z=[],F=m.$(function(){var H=M(O,k,m.a.Ua(z,B))||[];0<z.length&&(m.a.Xc(z,H),G&&m.u.G(G,null,[O,H,k])),z.length=0,m.a.Nb(z,H)},null,{l:B,Sa:function(){return!m.a.kd(z)}});return{Y:z,$:F.ja()?F:e}}var b=m.a.g.Z(),T=m.a.g.Z();m.a.ec=function(B,M,O,G,k,z){function F(ft){Ne={Aa:ft,pb:m.ta(pe++)},K.push(Ne),W||ve.push(Ne)}function H(ft){Ne=$[ft],pe!==Ne.pb.v()&&Ce.push(Ne),Ne.pb(pe++),m.a.Ua(Ne.Y,B),K.push(Ne)}function Y(ft,St){if(ft)for(var be=0,Se=St.length;be<Se;be++)m.a.D(St[be].Y,function(qt){ft(qt,be,St[be].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),G=G||{};var $=m.a.g.get(B,b),W=!$,K=[],Z=0,pe=0,ge=[],re=[],ye=[],Ce=[],ve=[],Ne,Le=0;if(W)m.a.D(M,F);else{if(!z||$&&$._countWaitingForRemove){var Oe=m.a.Mb($,function(ft){return ft.Aa});z=m.a.Pb(Oe,M,{dontLimitMoves:G.dontLimitMoves,sparse:!0})}for(var Oe=0,nt,Fe,_t;nt=z[Oe];Oe++)switch(Fe=nt.moved,_t=nt.index,nt.status){case"deleted":for(;Z<_t;)H(Z++);Fe===e&&(Ne=$[Z],Ne.$&&(Ne.$.s(),Ne.$=e),m.a.Ua(Ne.Y,B).length&&(G.beforeRemove&&(K.push(Ne),Le++,Ne.Aa===T?Ne=null:ye.push(Ne)),Ne&&ge.push.apply(ge,Ne.Y))),Z++;break;case"added":for(;pe<_t;)H(Z++);Fe!==e?(re.push(K.length),H(Fe)):F(nt.value)}for(;pe<M.length;)H(Z++);K._countWaitingForRemove=Le}m.a.g.set(B,b,K),Y(G.beforeMove,Ce),m.a.D(ge,G.beforeRemove?m.oa:m.removeNode);var rt,je,st;try{st=B.ownerDocument.activeElement}catch{}if(re.length)for(;(Oe=re.shift())!=e;){for(Ne=K[Oe],rt=e;Oe;)if((je=K[--Oe].Y)&&je.length){rt=je[je.length-1];break}for(M=0;Z=Ne.Y[M];rt=Z,M++)m.h.Wb(B,Z,rt)}for(Oe=0;Ne=K[Oe];Oe++){for(Ne.Y||m.a.extend(Ne,g(B,O,Ne.Aa,k,Ne.pb)),M=0;Z=Ne.Y[M];rt=Z,M++)m.h.Wb(B,Z,rt);!Ne.Ed&&k&&(k(Ne.Aa,Ne.Y,Ne.pb),Ne.Ed=!0,rt=Ne.Y[Ne.Y.length-1])}for(st&&B.ownerDocument.activeElement!=st&&st.focus(),Y(G.beforeRemove,ye),Oe=0;Oe<ye.length;++Oe)ye[Oe].Aa=T;Y(G.afterMove,Ce),Y(G.afterAdd,ve)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(g,b,T,B){return(b=!(9>m.a.W)&&g.nodes?g.nodes():null)?m.a.la(b.cloneNode(!0).childNodes):(g=g.text(),m.a.ua(g,B))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var b=this.Hd=(function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(T,B,M,O){if(O=O||n,M=M||{},2>b)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var G=T.data("precompiled");return G||(G=T.text()||"",G=o.template(null,"{{ko_with $item.koBindingContext}}"+G+"{{/ko_with}}"),T.data("precompiled",G)),T=[B.$data],B=o.extend({koBindingContext:B},M.templateOptions),B=o.tmpl(G,T,B),B.appendTo(O.createElement("div")),o.fragments={},B},this.createJavaScriptEvaluatorBlock=function(T){return"{{ko_code ((function() { return "+T+" })()) }}"},this.addTemplate=function(T,B){n.write("<script type='text/html' id='"+T+"'>"+B+"<\/script>")},0<b&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var g=new m.$a;0<g.Hd&&m.gc(g),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var XMt=ko;typeof window<"u"?(ko=window.ko,typeof KR<"u"?window.ko=KR:delete window.ko):(ko=global.ko,typeof KR<"u"?global.ko=KR:delete global.ko);var ow=XMt;/**
|
|
* @license
|
|
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
|
|
* Copyright (c) Steve Sanderson
|
|
* MIT license
|
|
*/var bte="__knockoutObservables",xte="__knockoutSubscribable";function gDe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=_De(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===bte||o===xte)&&!(o in i)){var r=e[o],a=r instanceof Array,s=n.isObservable(r)?r:a?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:s,set:n.isWriteableObservable(s)?s:void 0}),i[o]=s,a&&ZMt(n,s)}}),e}function _De(e,t){var n=e[bte];return!n&&t&&(n={},Object.defineProperty(e,bte,{value:n})),n}function JMt(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),gDe.call(i,e,[t]),e}function ZMt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=$Mt(e,t,i))})}function $Mt(e,t,n){var i=eNt(e,n);return i.subscribe(t)}function eNt(e,t){var n=t[xte];if(!n){n=new e.subscribable,Object.defineProperty(t,xte,{value:n});var i={};tNt(t,n,i),nNt(e,t,n,i)}return n}function tNt(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 nNt(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 yDe(e,t){if(!e)return null;var n=_De(e,!1);return n&&n[t]||null}function iNt(e,t){var n=yDe(e,t);n&&n.valueHasMutated()}function oNt(e){e.track=gDe,e.getObservable=yDe,e.valueHasMutated=iNt,e.defineProperty=JMt}var M9={attachToKo:oNt};var CDe="http://www.w3.org/2000/svg",EDe="cesium-svgPath-svg",rNt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(CDe,"svg:svg");i.setAttribute("class",EDe);let o=document.createElementNS(CDe,"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 a=e.unwrap(r.width),s=e.unwrap(r.height);i.setAttribute("width",a),i.setAttribute("height",s),i.setAttribute("viewBox",`0 0 ${a} ${s}`),r.css&&i.setAttribute("class",`${EDe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},N9=rNt;M9.attachToKo(ow);N9.register(ow);var xe=ow;function XR(e){l(e)||(e=new hp),this._clock=e,this._eventHelper=new Hr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=xe.observable(X.now()),this.systemTime.equalityComparer=X.equals,this.startTime=xe.observable(e.startTime),this.startTime.equalityComparer=X.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=xe.observable(e.stopTime),this.stopTime.equalityComparer=X.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=xe.observable(e.currentTime),this.currentTime.equalityComparer=X.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=xe.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=xe.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=xe.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=xe.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=xe.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),xe.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(XR.prototype,{clock:{get:function(){return this._clock}}});XR.prototype.synchronize=function(){let e=this._clock;this.systemTime=X.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};XR.prototype.isDestroyed=function(){return!1};XR.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var L9=XR;function aNt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,de.throwInstantiationError()}var IDe=aNt;function sNt(e,t){t=t??!0;let n=new _e,i=new _e;function o(){let r={args:arguments,cancel:!1},a;return n.raiseEvent(r),r.cancel||(a=e.apply(null,arguments),i.raiseEvent(a)),a}return o.canExecute=t,xe.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Mn=sNt;var rw={};rw.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let a=`checked: ${t}`;return l(n)&&(a+=`, enable: ${n}`),r.setAttribute("data-bind",a),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};rw.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-sectionContent",o.appendChild(a),a};rw.createRangeInput=function(e,t,n,i,o,r){r=r??t;let a=document.createElement("input");a.setAttribute("data-bind",`value: ${r}`),a.type="number";let s=document.createElement("input");s.type="range",s.min=n,s.max=i,s.step=o??"any",s.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(s);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(a),u.appendChild(c),u};rw.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let a=document.createElement("div");a.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-slider",s.appendChild(document.createTextNode(e)),s.appendChild(o),s.appendChild(a),s};rw.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Rf=rw;function cNt(e,t,n,i,o){return n.call(i,e[t]),xe.getObservable(e,t).subscribe(n,i,o)}var wc=cNt;function bDe(e,t){this._command=e,t=t??V.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",xe.track(this,["toggled","tooltip"])}Object.defineProperties(bDe.prototype,{command:{get:function(){return this._command}}});var dI=bDe;var hI="http://www.w3.org/2000/svg",SDe="http://www.w3.org/1999/xlink",O9,JR=U.fromCssColorString("rgba(247,250,255,0.384)"),F9=U.fromCssColorString("rgba(143,191,255,0.216)"),Tte=U.fromCssColorString("rgba(153,197,255,0.098)"),Q9=U.fromCssColorString("rgba(255,255,255,0.086)"),lNt=U.fromCssColorString("rgba(255,255,255,0.267)"),uNt=U.fromCssColorString("rgba(255,255,255,0)"),xDe=U.fromCssColorString("rgba(66,67,68,0.3)"),TDe=U.fromCssColorString("rgba(0,0,0,0.5)");function xC(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var ZR={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 fm(e){let t=document.createElementNS(hI,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(fm(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(SDe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Ste(e,t,n){let i=document.createElementNS(hI,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(hI,"tspan");return o.textContent=n,i.appendChild(o),i}function fNt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var k9=new U;function Ra(e,t){let n=t.alpha,i=1-n;return k9.red=e.red*i+t.red*n,k9.green=e.green*i+t.green*n,k9.blue=e.blue*i+t.blue*n,k9.toCssColorString()}function wte(e,t,n){let i=ZR[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 fm(o)}function dNt(e,t,n){let i=ZR[n],o=ZR.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 fm(r)}function hNt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&O9!==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,s=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>s.right||c<s.left||u<s.top||u>s.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=c-o-s.left,p=u-r-s.top,A=Math.atan2(p,h)*180/Math.PI+90;A>180&&(A-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(O9=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=A):A<m?n.slower():A>m&&n.faster(),t.preventDefault()}else e===O9&&(O9=void 0),n.shuttleRingDragging=!1}function vg(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=[wc(t,"toggled",this.setToggled,this),wc(t,"tooltip",this.setTooltip,this),wc(t.command,"canExecute",this.setEnabled,this)]}vg.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();fe(this)};vg.prototype.isDestroyed=function(){return!1};vg.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")}};vg.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")))};vg.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function aw(e,t){e=zn(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(hI,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",SDe);let a=document.createElementNS(hI,"g");this._topG=a,this._realtimeSVG=new vg(dNt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new vg(wte(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new vg(wte(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new vg(wte(84,99,"animation_pathPause"),t.pauseViewModel);let s=document.createElementNS(hI,"g");s.appendChild(this._realtimeSVG.svgElement),s.appendChild(this._playReverseSVG.svgElement),s.appendChild(this._playForwardSVG.svgElement),s.appendChild(this._pauseSVG.svgElement);let c=fm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=ZR.animation_pathSwooshFX,f=ZR.animation_pathPointer,h=fm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=fm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=fm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=fm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let A=61,m=fm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:A});this._knobDate=Ste(0,-24,""),this._knobTime=Ste(0,-7,""),this._knobStatus=Ste(0,-41,"");let _=fm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:A}),y=document.createElementNS(hI,"g");y.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),a.appendChild(y),a.appendChild(p),a.appendChild(s),y.appendChild(c),y.appendChild(h),y.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(_),r.appendChild(a),e.appendChild(r);let C=this;function E(v){hNt(C,v)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),h.addEventListener("mousedown",E,!0),h.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let I=this._knobTime.childNodes[0],x=this._knobDate.childNodes[0],S=this._knobStatus.childNodes[0],w;this._subscriptions=[wc(t.pauseViewModel,"toggled",function(v){w!==v&&(w=v,w?C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):C._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),wc(t,"shuttleRingAngle",function(v){fNt(C._shuttleRingPointer,C._knobOuter,v)}),wc(t,"dateLabel",function(v){x.textContent!==v&&(x.textContent=v)}),wc(t,"timeLabel",function(v){I.textContent!==v&&(I.textContent=v)}),wc(t,"multiplierLabel",function(v){S.textContent!==v&&(S.textContent=v)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(aw.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aw.prototype.isDestroyed=function(){return!1};aw.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return fe(this)};aw.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,a=t;e===0&&t===0?(r=i,a=o):e===0?(a=t,r=i*(t/o)):t===0&&(r=e,a=o*(e/i));let s=r/i,c=a/o;n.style.cssText=`width: ${r}px; height: ${a}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",a),n.setAttribute("viewBox",`0 0 ${r} ${a}`),this._topG.setAttribute("transform",`scale(${s},${c})`),this._centerX=Math.max(1,100*s),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};aw.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=xC(this._themeNormal),n=xC(this._themeHover),i=xC(this._themeSelect),o=xC(this._themeDisabled),r=xC(this._themeKnob),a=xC(this._themePointer),s=xC(this._themeSwoosh),c=xC(this._themeSwooshHover),u=fm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ra(t,JR)},{tagName:"stop",offset:"12%","stop-color":Ra(t,F9)},{tagName:"stop",offset:"46%","stop-color":Ra(t,Tte)},{tagName:"stop",offset:"81%","stop-color":Ra(t,Q9)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ra(n,JR)},{tagName:"stop",offset:"12%","stop-color":Ra(n,F9)},{tagName:"stop",offset:"46%","stop-color":Ra(n,Tte)},{tagName:"stop",offset:"81%","stop-color":Ra(n,Q9)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ra(i,JR)},{tagName:"stop",offset:"12%","stop-color":Ra(i,F9)},{tagName:"stop",offset:"46%","stop-color":Ra(i,Tte)},{tagName:"stop",offset:"81%","stop-color":Ra(i,Q9)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Ra(o,lNt)},{tagName:"stop",offset:"75%","stop-color":Ra(o,uNt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":s.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":s.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":a.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Ra(a,TDe)},{tagName:"stop",offset:"100%","stop-color":Ra(a,TDe)}]},{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":Ra(r,JR)},{tagName:"stop",offset:"60%","stop-color":Ra(r,xDe)},{tagName:"stop",offset:"85%","stop-color":Ra(r,F9)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Ra(r,xDe)},{tagName:"stop",offset:"60%","stop-color":Ra(r,JR)},{tagName:"stop",offset:"85%","stop-color":Ra(r,Q9)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var U9=aw;var mNt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],TC=15,sw=105;function wDe(e,t){return e-t}function Bte(e,t){let n=Io(t,e,wDe);return n<0?~n:n}function pNt(e,t){if(Math.abs(e)<=TC)return e/TC;let n=TC,i=sw,o,r=0,a;return e>0?(o=Math.log(t[t.length-1]),a=(o-r)/(i-n),Math.exp(r+a*(e-n))):(o=Math.log(-t[0]),a=(o-r)/(i-n),-Math.exp(r+a*(Math.abs(e)-n)))}function ANt(e,t,n){if(n.clockStep===Qo.SYSTEM_CLOCK)return TC;if(Math.abs(e)<=1)return e*TC;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=TC,r=sw,a,s=0,c;return e>0?(a=Math.log(i),c=(a-s)/(r-o),(Math.log(e)-s)/c+o):(a=Math.log(-t[0]),c=(a-s)/(r-o),-((Math.log(Math.abs(e))-s)/c+o))}function Wd(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Wd.defaultDateFormatter,this._timeFormatter=Wd.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,xe.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Wd.defaultTicks),this.timeLabel=void 0,xe.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,xe.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,xe.defineProperty(this,"multiplierLabel",function(){let a=t._clockViewModel;if(a.clockStep===Qo.SYSTEM_CLOCK)return"Today";let s=a.multiplier;return s%1===0?`${s.toFixed(0)}x`:`${s.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,xe.defineProperty(this,"shuttleRingAngle",{get:function(){return ANt(e.multiplier,t._allShuttleRingTicks,e)},set:function(a){a=Math.max(Math.min(a,sw),-sw);let s=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Qo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(a)===sw){c.multiplier=a>0?s[s.length-1]:s[0];return}let u=pNt(a,s);if(t.snapToTicks)u=s[Bte(u,s)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>TC?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,xe.defineProperty(this,"_canAnimate",function(){let a=t._clockViewModel,s=a.clockRange;if(t.shuttleRingDragging||s===va.UNBOUNDED)return!0;let c=a.multiplier,u=a.currentTime,f=a.startTime,h=!1;if(s===va.LOOP_STOP)h=X.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=a.stopTime;h=X.greaterThan(u,f)&&X.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return h||(a.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,xe.defineProperty(this,"_isSystemTimeAvailable",function(){let a=t._clockViewModel;if(a.clockRange===va.UNBOUNDED)return!0;let c=a.systemTime;return X.greaterThanOrEquals(c,a.startTime)&&X.lessThanOrEquals(c,a.stopTime)}),this._isAnimating=void 0,xe.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Mn(function(){let a=t._clockViewModel;a.shouldAnimate?a.shouldAnimate=!1:t._canAnimate&&(a.shouldAnimate=!0)});this._pauseViewModel=new dI(n,{toggled:xe.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Mn(function(){let a=t._clockViewModel,s=a.multiplier;s>0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playReverseViewModel=new dI(i,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Mn(function(){let a=t._clockViewModel,s=a.multiplier;s<0&&(a.multiplier=-s),a.shouldAnimate=!0});this._playForwardViewModel=new dI(o,{toggled:xe.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Qo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Mn(function(){t._clockViewModel.clockStep=Qo.SYSTEM_CLOCK},xe.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new dI(r,{toggled:xe.computed(function(){return e.clockStep===Qo.SYSTEM_CLOCK}),tooltip:xe.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Mn(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=Bte(c,s)-1;u>=0&&(a.multiplier=s[u])}),this._faster=Mn(function(){let a=t._clockViewModel,s=t._allShuttleRingTicks,c=a.multiplier,u=Bte(c,s)+1;u<s.length&&(a.multiplier=s[u])})}Wd.defaultDateFormatter=function(e,t){let n=X.toGregorianDate(e);return`${mNt[n.month-1]} ${n.day} ${n.year}`};Wd.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];Wd.defaultTimeFormatter=function(e,t){let n=X.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`};Wd.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Wd.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(wDe);let a=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&a.push(-i);oi(a,r),this._allShuttleRingTicks=a};Object.defineProperties(Wd.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Wd._maxShuttleRingAngle=sw;Wd._realtimeShuttleRingAngle=TC;var z9=Wd;function gNt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof cs&&(e.tileset=n.primitive),e.pickActive=!1}}function DDe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof cs&&(e.tileset=i.primitive)},Dn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Dn.MOUSE_MOVE),e.picking=e.picking)}var _Nt={maximumFractionDigits:3};function $R(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,_Nt):Math.round(t).toLocaleString()}function eM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[ur.PICK]:e._statisticsPerPass[ur.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>${$R(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${$R(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${$R(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function vDe(){let e=Pi.statistics;return`
|
|
<ul class="cesium-cesiumInspector-statistics">
|
|
<li><strong>Geometry Memory (MB): </strong>${$R(e.geometryByteLength)}</li>
|
|
<li><strong>Texture Memory (MB): </strong>${$R(e.texturesByteLength)}</li>
|
|
</ul>
|
|
`}var yNt=[{text:"Highlight",value:Yu.HIGHLIGHT},{text:"Replace",value:Yu.REPLACE},{text:"Mix",value:Yu.MIX}],BDe=new U(1,1,0,.4),CNt=new U,G9=new U;function uc(e,t){let n=this,i=e.canvas;this._eventHandler=new Ld(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new hC({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,xe.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=xe.observable({}),this.properties=[],xe.defineProperty(this,"properties",function(){let F=[],H=n._properties();for(let Y in H)H.hasOwnProperty(Y)&&F.push(Y);return F});let o=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(F){o(F),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=F)}}),this.dynamicScreenSpaceError=!1;let r=xe.observable();xe.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(F){r(F),l(n._tileset)&&(n._tileset.colorBlendMode=F,n._scene.requestRender())}}),this.colorBlendMode=Yu.HIGHLIGHT;let a=xe.observable(),s=xe.observable();xe.defineProperty(this,"picking",{get:function(){return s()},set:function(F){s(F),F?n._eventHandler.setInputAction(function(H){let Y=e.pick(H.endPosition);if(Y instanceof Vs?(n.feature=Y,n.tile=Y.content.tile):l(Y)&&l(Y.content)?(n.feature=void 0,n.tile=Y.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(a&&l(Y)&&l(Y.content)){let $;e.pickPositionSupported&&($=e.pickPosition(H.endPosition),l($)&&(n._tileset.debugPickPosition=$)),n._tileset.debugPickedTile=Y.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Dn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Dn.MOUSE_MOVE))}}),this.picking=!0;let c=xe.observable();xe.defineProperty(this,"colorize",{get:function(){return c()},set:function(F){c(F),l(n._tileset)&&(n._tileset.debugColorizeTiles=F,n._scene.requestRender())}}),this.colorize=!1;let u=xe.observable();xe.defineProperty(this,"wireframe",{get:function(){return u()},set:function(F){u(F),l(n._tileset)&&(n._tileset.debugWireframe=F,n._scene.requestRender())}}),this.wireframe=!1;let f=xe.observable();xe.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(F){f(F),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=F,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=xe.observable();xe.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(F){h(F),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=F,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=xe.observable();xe.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(F){p(F),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=F,n._scene.requestRender())}}),this.showRequestVolumes=!1;let A=xe.observable();xe.defineProperty(this,"freezeFrame",{get:function(){return A()},set:function(F){A(F),l(n._tileset)&&(n._tileset.debugFreezeFrame=F,n._scene.debugShowFrustumPlanes=F,n._scene.requestRender())}}),this.freezeFrame=!1,xe.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return a()},set:function(F){a(F),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=F,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=xe.observable();xe.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(F){m(F),l(n._tileset)&&(n._tileset.debugShowGeometricError=F,n._scene.requestRender())}}),this.showGeometricError=!1;let _=xe.observable();xe.defineProperty(this,"showRenderingStatistics",{get:function(){return _()},set:function(F){_(F),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=F,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let y=xe.observable();xe.defineProperty(this,"showMemoryUsage",{get:function(){return y()},set:function(F){y(F),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=F,n._scene.requestRender())}}),this.showMemoryUsage=!1;let C=xe.observable();xe.defineProperty(this,"showUrl",{get:function(){return C()},set:function(F){C(F),l(n._tileset)&&(n._tileset.debugShowUrl=F,n._scene.requestRender())}}),this.showUrl=!1;let E=xe.observable();xe.defineProperty(this,"maximumScreenSpaceError",{get:function(){return E()},set:function(F){F=Number(F),isNaN(F)||(E(F),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=F))}}),this.maximumScreenSpaceError=16;let I=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return I()},set:function(F){F=Number(F),isNaN(F)||(I(F),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=F))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,xe.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(I(),1/6)},set:function(F){let H=Math.pow(F,6);I(H),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=H)}});let x=xe.observable();xe.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return x()},set:function(F){F=Number(F),isNaN(F)||(x(F),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=F))}}),this.dynamicScreenSpaceErrorFactor=24;let S=gNt(this),w=xe.observable();xe.defineProperty(this,"pickActive",{get:function(){return w()},set:function(F){w(F),F?n._eventHandler.setInputAction(S,Dn.LEFT_CLICK):n._eventHandler.removeInputAction(Dn.LEFT_CLICK)}});let v=xe.observable();xe.defineProperty(this,"pointCloudShading",{get:function(){return v()},set:function(F){v(F),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=F)}}),this.pointCloudShading=!1;let R=xe.observable();xe.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(F){F=Number(F),isNaN(F)||(R(F),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=F))}}),this.geometricErrorScale=1;let N=xe.observable();xe.defineProperty(this,"maximumAttenuation",{get:function(){return N()},set:function(F){F=Number(F),isNaN(F)||(N(F),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=F===0?void 0:F))}}),this.maximumAttenuation=0;let L=xe.observable();xe.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(F){F=Number(F),isNaN(F)||(L(F),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=F===0?void 0:F))}}),this.baseResolution=0;let g=xe.observable();xe.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(F){g(F),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=F)}}),this.eyeDomeLighting=!1;let b=xe.observable();xe.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return b()},set:function(F){F=Number(F),isNaN(F)||(b(F),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=F))}}),this.eyeDomeLightingStrength=1;let T=xe.observable();xe.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return T()},set:function(F){F=Number(F),isNaN(F)||(T(F),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=F))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let B=xe.observable();xe.defineProperty(this,"skipLevelOfDetail",{get:function(){return B()},set:function(F){B(F),l(n._tileset)&&(n._tileset.skipLevelOfDetail=F)}}),this.skipLevelOfDetail=!0;let M=xe.observable();xe.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(F){F=Number(F),isNaN(F)||(M(F),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=F))}}),this.skipScreenSpaceErrorFactor=16;let O=xe.observable();xe.defineProperty(this,"baseScreenSpaceError",{get:function(){return O()},set:function(F){F=Number(F),isNaN(F)||(O(F),l(n._tileset)&&(n._tileset.baseScreenSpaceError=F))}}),this.baseScreenSpaceError=1024;let G=xe.observable();xe.defineProperty(this,"skipLevels",{get:function(){return G()},set:function(F){F=Number(F),isNaN(F)||(G(F),l(n._tileset)&&(n._tileset.skipLevels=F))}}),this.skipLevels=1;let k=xe.observable();xe.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return k()},set:function(F){k(F),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=F)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let z=xe.observable();xe.defineProperty(this,"loadSiblings",{get:function(){return z()},set:function(F){z(F),l(n._tileset)&&(n._tileset.loadSiblings=F)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||DDe(this,!0)}Object.defineProperties(uc.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 yNt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=eM(e,!1),this._pickStatisticsText=eM(e,!0),this._resourceCacheStatisticsText=vDe(),DDe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,CNt):U.WHITE:t.color=G9,this._scene.requestRender()),l(e)&&(U.clone(e.color,G9),e.color=BDe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!Dte(t.content)&&(t.color=G9,this._scene.requestRender()),l(e)&&!Dte(e.content)&&(U.clone(e.color,G9),e.color=BDe,this._scene.requestRender()),this._tile=e}}});function Dte(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!Dte(t[i]))return!1;return!0}return!1}uc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};uc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};uc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};uc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};uc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};uc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};uc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};uc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};uc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};uc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};uc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new sy(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};uc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,s=n.value.slice(i,o).split(`
|
|
`),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),r-=2):(s[u]=s[u].substr(1),r-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,r+=2;let f=s.join(`
|
|
`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};uc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=eM(e,!1),this._pickStatisticsText=eM(e,!0),this._resourceCacheStatisticsText=vDe())};uc.prototype.isDestroyed=function(){return!1};uc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),fe(this)};uc.getStatistics=eM;var V9=uc;function H9(e,t){e=zn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new V9(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 a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",n.appendChild(a);let s=Rf.createSection,c=Rf.createCheckbox,u=Rf.createRangeInput,f=Rf.createButton,h=s(a,"Tileset","tilesetVisible","toggleTileset"),p=s(a,"Display","displayVisible","toggleDisplay"),A=s(a,"Update","updateVisible","toggleUpdate"),m=s(a,"Logging","loggingVisible","toggleLogging"),_=s(a,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),y=s(a,"Style","styleVisible","toggleStyle"),C=s(a,"Optimization","optimizationVisible","toggleOptimization"),E=document.createElement("div");E.className="field-group";let I=document.createElement("label");I.className="field-label",I.appendChild(document.createTextNode("Properties: "));let x=document.createElement("div");x.setAttribute("data-bind","text: properties"),E.appendChild(I),E.appendChild(x),h.appendChild(E),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let S=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),w=document.createElement("p");w.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),w.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),w.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",S.appendChild(w),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let v=document.createElement("div");v.setAttribute("data-bind","visible: pointCloudShading"),v.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),v.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),v.appendChild(u("Base Resolution","baseResolution",0,1,.01)),v.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(v);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),v.appendChild(R),A.appendChild(c("Freeze Frame","freezeFrame")),A.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let N=document.createElement("div");N.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),A.appendChild(N);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),A.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(g),m.appendChild(c("Pick Statistics","showPickStatistics"));let b=document.createElement("div");b.className="cesium-3dTilesInspector-statistics",b.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(b),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let T=document.createElement("div");T.className="cesium-3dTilesInspector-statistics",T.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(T);let B=document.createElement("div");y.appendChild(B),B.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),B.appendChild(M);let O=document.createElement("textarea");O.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),B.className="cesium-cesiumInspector-styleEditor",B.appendChild(O);let G=f("Compile (Ctrl+Enter)","compileStyle");B.appendChild(G);let k=document.createElement("div");k.className="cesium-cesiumInspector-error",k.setAttribute("data-bind","text: editorError"),B.appendChild(k),_.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),_.appendChild(c("Geometric Error","showGeometricError")),_.appendChild(c("Rendering Statistics","showRenderingStatistics")),_.appendChild(c("Memory Usage (MB)","showMemoryUsage")),_.appendChild(c("Url","showUrl")),C.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let z=document.createElement("div");z.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),C.appendChild(z);let F=document.createElement("div");F.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),C.appendChild(F);let H=document.createElement("div");H.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),C.appendChild(H),C.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),C.appendChild(c("Load siblings of visible tiles","loadSiblings")),xe.applyBindings(o,n)}Object.defineProperties(H9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});H9.prototype.isDestroyed=function(){return!1};H9.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var W9=H9;function PDe(e){e=e??V.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??V.EMPTY_ARRAY,i=e.terrainProviderViewModels??V.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,xe.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=xe.getObservable(this,"imageryProviderViewModels"),r=xe.pureComputed(function(){let h=o(),p={},A;for(A=0;A<h.length;A++){let y=h[A],C=y.category;l(p[C])?p[C].push(y):p[C]=[y]}let m=Object.keys(p),_=[];for(A=0;A<m.length;A++){let y=m[A];_.push({name:y,providers:p[y]})}return _});this._imageryProviders=r;let a=xe.getObservable(this,"terrainProviderViewModels"),s=xe.pureComputed(function(){let h=a(),p={},A;for(A=0;A<h.length;A++){let y=h[A],C=y.category;l(p[C])?p[C].push(y):p[C]=[y]}let m=Object.keys(p),_=[];for(A=0;A<m.length;A++){let y=m[A];_.push({name:y,providers:p[y]})}return _});this._terrainProviders=s,this.buttonTooltip=void 0,xe.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,A=l(h)?h.name:void 0,m=l(p)?p.name:void 0;return l(A)&&l(m)?`${A}
|
|
${m}`:l(A)?A:m}),this.buttonImageUrl=void 0,xe.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(l(h))return h.iconUrl}),this.selectedImagery=void 0;let c=xe.observable();this.updateSelectedImageryViewModel=h=>{c(h),this.dropDownVisible=!1},this._currentImageryLayers=[],xe.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(h){if(c()===h){this.dropDownVisible=!1;return}let p=e.map,A,m=this._currentImageryLayers,_=m.length,y=this._globe.imageryLayers,C=!1;if(!p)for(A=0;A<_;A++){let E=y.length;for(let I=0;I<E;I++){let x=y.get(I);if(x===m[A]){y.remove(x),C=!0;break}}}if(l(h))if(p&&h.marsOptions)p.basemap=h.marsOptions.layerId;else if(p&&h.options&&h.isTile)p.basemap=h.options.id;else{let E=h.creationCommand();if(Array.isArray(E)){let I=E.length;for(this._currentImageryLayers=[],A=I-1;A>=0;A--){let x=Ta.fromProviderAsync(E[A]);y.add(x,0),this._currentImageryLayers.push(x)}}else{this._currentImageryLayers=[];let I=Ta.fromProviderAsync(E);if(I.name=h.name,C)y.add(I,0);else{let x=y.get(0);l(x)&&y.remove(x),y.add(I,0)}this._currentImageryLayers.push(I)}}else p&&(p.basemap=void 0);c(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=xe.observable();this.updateSelectedTerrainViewModel=h=>{u(h),this.dropDownVisible=!1},xe.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(l(h)&&(p=h.creationCommand()),l(p)&&!l(p.then)){if(e.map&&h.marsOptions){e.map.terrainProvider=p;return}this._globe.terrainProvider=p}else if(l(p)){let A=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{A=!0,m()}),y=new v9(p).readyEvent.addEventListener(C=>{if(!A){if(e.map&&h.marsOptions){e.map.terrainProvider=C;return}this._globe.terrainProvider=C,y()}})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Mn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel,this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(PDe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var j9=PDe;function Y9(e,t){e=zn(e);let n=new j9(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 a=document.createElement("div");a.className="cesium-baseLayerPicker-sectionTitle",a.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),a.innerHTML="Imagery",r.appendChild(a);let s=document.createElement("div");s.className="cesium-baseLayerPicker-section",s.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(s);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",s.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let A=document.createElement("div");A.className="cesium-baseLayerPicker-itemLabel",A.setAttribute("data-bind","text: name"),h.appendChild(A);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let _=document.createElement("div");_.className="cesium-baseLayerPicker-section",_.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(_);let y=document.createElement("div");y.className="cesium-baseLayerPicker-category",_.appendChild(y);let C=document.createElement("div");C.className="cesium-baseLayerPicker-categoryTitle",C.setAttribute("data-bind","text: name"),y.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-choices",E.setAttribute("data-bind","foreach: providers"),y.appendChild(E);let I=document.createElement("div");I.className="cesium-baseLayerPicker-item",I.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),E.appendChild(I);let x=document.createElement("img");x.className="cesium-baseLayerPicker-itemIcon",x.setAttribute("data-bind","attr: { src: iconUrl }"),x.setAttribute("draggable","false"),I.appendChild(x);let S=document.createElement("div");S.className="cesium-baseLayerPicker-itemLabel",S.setAttribute("data-bind","text: name"),I.appendChild(S),xe.applyBindings(n,i),xe.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(w){i.contains(w.target)||r.contains(w.target)||(n.dropDownVisible=!1)},hn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Y9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Y9.prototype.isDestroyed=function(){return!1};Y9.prototype.destroy=function(){return hn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._element),xe.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),fe(this)};var q9=Y9;function RDe(e){let t=e.creationFunction;l(t.canExecute)||(t=Mn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",this.marsOptions=e.marsOptions,xe.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(RDe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var mr=RDe;function ENt(){let e=[],t=devicePixelRatio>=2;return e.push(new mr({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return H_({style:V_.AERIAL})}})),e.push(new mr({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return H_({style:V_.AERIAL_WITH_LABELS})}})),e.push(new mr({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return H_({style:V_.ROAD})}})),e.push(new mr({name:"ArcGIS World Imagery",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at
|
|
https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return G_.fromBasemapType($m.SATELLITE,{enablePickFeatures:!1})}})),e.push(new mr({name:"ArcGIS World Hillshade",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at
|
|
https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return G_.fromBasemapType($m.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new mr({name:"Esri World Ocean",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at
|
|
https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return G_.fromBasemapType($m.OCEANS,{enablePickFeatures:!1})}})),e.push(new mr({name:"Open\xADStreet\xADMap",iconUrl:Zt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
|
|
http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new bC({url:"https://tile.openstreetmap.org/"})}})),e.push(new mr({name:"Stadia x Stamen Watercolor",iconUrl:Zt("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
|
|
https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new bC({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a>
|
|
© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
|
|
© <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
|
|
© <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia x Stamen Toner",iconUrl:Zt("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
|
|
https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new bC({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a>
|
|
© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
|
|
© <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
|
|
© <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia Alidade Smooth",iconUrl:Zt("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
|
|
https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new bC({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
|
|
© <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
|
|
© <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia Alidade Smooth Dark",iconUrl:Zt("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
|
|
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new bC({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
|
|
© <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
|
|
© <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Sentinel-2",iconUrl:Zt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3954)}})),e.push(new mr({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3845)}})),e.push(new mr({name:"Earth at night",iconUrl:Zt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3812)}})),e.push(new mr({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
|
|
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return BE.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new mr({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3830182)}})),e.push(new mr({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3830183)}})),e.push(new mr({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3830184)}})),e.push(new mr({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3830186)}})),e.push(new mr({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3891168)}})),e.push(new mr({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return du.fromAssetId(3891169)}})),e}var K9=ENt;function INt(){let e=[];return e.push(new mr({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new gS({ellipsoid:te.WGS84})}})),e.push(new mr({name:"Cesium World Terrain",iconUrl:Zt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return mS({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var X9=INt;function bNt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let a=[];for(let s=2;s>=0;s--){let c=Math.pow(2,s);o>=c&&(a.push(s+1),o-=c)}r=a.reverse().join(" and ")}t+=`<br> ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function vte(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var xNt=new In,TNt=new d;function tM(e,t){let n=this,i=e.canvas,o=new Ld(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",xe.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Mn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Mn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Mn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Mn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=xe.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=xe.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=xe.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new hC({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Mn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=xe.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Mn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new d9({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=xe.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Mn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=xe.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=xe.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=xe.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Mn(function(){let u=n.depthFrustum+1;return n.depthFrustum=vte(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Mn(function(){let u=n.depthFrustum-1;return n.depthFrustum=vte(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=xe.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let a;this._showTileCoordinates=Mn(function(){return n.tileCoordinates&&!l(a)?a=e.imageryLayers.addImageryProvider(new P9({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(a)&&(e.imageryLayers.remove(a),a=void 0),!0}),this._tileCoordinatesSubscription=xe.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=xe.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Mn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Mn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=xe.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function s(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Mn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=xe.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(s,Dn.LEFT_CLICK):o.removeInputAction(Dn.LEFT_CLICK)});function c(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,xNt),A=r.pick(p,n._scene,TNt);if(l(A)){let m=h.cartesianToCartographic(A),_=r._surface.tileProvider._tilesToRenderByTextureCount;for(let y=0;!f&&y<_.length;++y){let C=_[y];if(l(C))for(let E=0;!f&&E<C.length;++E){let I=C[E];ce.contains(I.rectangle,m)&&(f=I)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Mn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=xe.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(c,Dn.LEFT_CLICK):o.removeInputAction(Dn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(tM.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 Mn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Mn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Mn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Mn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Mn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});tM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=bNt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=vte(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}`};tM.prototype.isDestroyed=function(){return!1};tM.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),fe(this)};var J9=tM;function Z9(e,t){e=zn(e);let n=document.createElement("div"),i=new J9(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 a=document.createElement("div");a.className="cesium-cesiumInspector-dropDown",o.appendChild(a);let s=Rf.createSection,c=Rf.createCheckbox,u=s(a,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let A=document.createElement("div");u.appendChild(A);let m=document.createElement("span");m.setAttribute("data-bind",'html: " Frustum:"'),A.appendChild(m);let _=document.createElement("span");_.setAttribute("data-bind","text: depthFrustumText"),A.appendChild(_);let y=document.createElement("input");y.type="button",y.value="-",y.className="cesium-cesiumInspector-pickButton",y.setAttribute("data-bind","click: decrementDepthFrustum"),A.appendChild(y);let C=document.createElement("input");C.type="button",C.value="+",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: incrementDepthFrustum"),A.appendChild(C);let E=s(a,"Primitives","primitivesVisible","togglePrimitives"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",E.appendChild(I);let x=document.createElement("input");x.type="button",x.value="Pick a primitive",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let S=document.createElement("div");S.className="cesium-cesiumInspector-center",S.appendChild(x),I.appendChild(S),I.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),I.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),I.appendChild(this._primitiveOnly);let w=s(a,"Terrain","terrainVisible","toggleTerrain"),v=document.createElement("div");v.className="cesium-cesiumInspector-pickSection",w.appendChild(v);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),S=document.createElement("div"),S.appendChild(R),S.className="cesium-cesiumInspector-center",v.appendChild(S);let N=document.createElement("div");v.appendChild(N);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let b=document.createElement("input");b.type="button",b.value="NE",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: selectNE");let T=document.createElement("input");T.type="button",T.value="SW",T.className="cesium-cesiumInspector-pickButton",T.setAttribute("data-bind","click: selectSW");let B=document.createElement("input");B.type="button",B.value="SE",B.className="cesium-cesiumInspector-pickButton",B.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",N.className="cesium-cesiumInspector-frustumStatistics",N.appendChild(M),N.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let O=document.createElement("div");O.className="cesium-cesiumInspector-relativeText",O.textContent="Select relative:",N.appendChild(O);let G=document.createElement("table"),k=document.createElement("tr"),z=document.createElement("tr"),F=document.createElement("td");F.appendChild(L);let H=document.createElement("td");H.appendChild(g);let Y=document.createElement("td");Y.appendChild(b),k.appendChild(F),k.appendChild(H),k.appendChild(Y);let $=document.createElement("td"),W=document.createElement("td");W.appendChild(T);let K=document.createElement("td");K.appendChild(B),z.appendChild($),z.appendChild(W),z.appendChild(K),G.appendChild(k),G.appendChild(z),N.appendChild(G),v.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),v.appendChild(c("Show only selected","filterTile","hasPickedTile")),w.appendChild(c("Wireframe","wireframe")),w.appendChild(c("Suspend LOD update","suspendUpdates")),w.appendChild(c("Show tile coordinates","tileCoordinates")),xe.applyBindings(i,this._element)}Object.defineProperties(Z9.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Z9.prototype.isDestroyed=function(){return!1};Z9.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};var $9=Z9;function e5(e,t){l(t)||(t=document.body),t=zn(t);let n=this,i=xe.observable(Jr.fullscreen),o=xe.observable(Jr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,xe.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,xe.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(a){o(a&&Jr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Mn(function(){Jr.fullscreen?Jr.exitFullscreen():Jr.requestFullscreen(n._fullscreenElement)},xe.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=zn(e)??r.body,this._callback=function(){i(Jr.fullscreen)},r.addEventListener(Jr.changeEventName,this._callback)}Object.defineProperties(e5.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});e5.prototype.isDestroyed=function(){return!1};e5.prototype.destroy=function(){document.removeEventListener(Jr.changeEventName,this._callback),fe(this)};var t5=e5;var SNt="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",wNt="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 n5(e,t){e=zn(e);let n=new t5(t,e);n._exitFullScreenPath=wNt,n._enterFullScreenPath=SNt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),xe.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(n5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});n5.prototype.isDestroyed=function(){return!1};n5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var i5=n5;var MDe=1e3;function jd(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new CS({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new _e,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=LDe,this._handleArrowUp=NDe;let t=this;this._suggestionsVisible=xe.pureComputed(function(){let o=xe.getObservable(t,"_suggestions")().length>0,r=xe.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Mn(function(i){if(i=i??L0.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)MNt(t);else return PNt(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,a=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||a)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,a=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,s=o.key==="Enter"||o.keyCode===13;return a?NDe(t):r?LDe(t):s&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;QDe(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??jd.flyToDestination,this._focusTextbox=!1,xe.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=xe.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){jd._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,xe.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,xe.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,xe.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(jd.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}}});jd.prototype.destroy=function(){this._suggestionSubscription.dispose()};function NDe(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],jd._adjustSuggestionsScroll(e,n)}function LDe(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],jd._adjustSuggestionsScroll(e,i)}function BNt(e,t){let n=l(t)?t.availability:void 0;return l(n)?IS(t,[e]).then(function(i){return e=i[0],e.height+=MDe,e}):(e.height+=MDe,Promise.resolve(e))}function DNt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,a=t,s;return t instanceof ce?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ce.center(t):s=TS(t,n):t=i.cartesianToCartographic(t),l(s)||(s=BNt(t,r)),s.then(function(c){a=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:a,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:P.IDENTITY})})}async function vNt(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 PNt(e,t,n){let i=e._searchText;if(FDe(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 vNt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Rte(e);let a=r.value;if(r.state==="fulfilled"&&l(a)&&a.length>0){e._searchText=a[0].displayName,e.destinationFound(e,a[0].destination);let s=ODe(e,UP.getCreditsFromResult(a[0]));l(s)||Pte(e,t[o].credit);return}e._searchText=`${i} (not found)`}function Pte(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function ODe(e,t){return l(t)&&t.forEach(n=>Pte(e,n)),t}function Rte(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function RNt(e,t){let n=zn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let a=r.offsetTop;a+r.clientHeight>i.clientHeight?i.scrollTop=a+r.clientHeight:a<i.scrollTop&&(i.scrollTop=a)}function MNt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function FDe(e){return/^\s*$/.test(e)}function QDe(e){xe.getObservable(e,"_suggestions").removeAll()}async function NNt(e){if(!e.autoComplete)return;let t=e._searchText;if(QDe(e),Rte(e),!FDe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,L0.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let a=UP.getCreditsFromResult(r);o=o&&!l(a),ODe(e,a)}),o&&Pte(e,n.credit)}if(e._suggestions.length>=5)return}}jd.flyToDestination=DNt;jd._updateSearchSuggestions=NNt;jd._adjustSuggestionsScroll=RNt;jd.prototype.isDestroyed=function(){return!1};jd.prototype.destroy=function(){return Rte(this),fe(this)};var o5=jd;var LNt="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",ONt="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 r5(e){let t=zn(e.container),n=new o5(e);n._startSearchPath=LNt,n._stopSearchPath=ONt;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 a=document.createElement("div");a.className="search-results",a.setAttribute("data-bind","visible: _suggestionsVisible");let s=document.createElement("ul");s.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");s.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),a.appendChild(s),t.appendChild(a),xe.applyBindings(n,i),xe.applyBindings(n,a),this._container=t,this._searchSuggestionsContainer=a,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},hn.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(r5.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});r5.prototype.isDestroyed=function(){return!1};r5.prototype.destroy=function(){let e=this._container;return hn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),xe.cleanNode(this._form),xe.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),fe(this)};var a5=r5;function kDe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Mn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",xe.track(this,["tooltip"])}Object.defineProperties(kDe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var s5=kDe;function c5(e,t,n){e=zn(e);let i=new s5(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(c5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});c5.prototype.isDestroyed=function(){return!1};c5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var l5=c5;function FNt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function zDe(e,t){xe.track(e);for(let n=0;n<e.sublayers.length;n++)zDe(e.sublayers[n],t)}function u5(e){return e.modelName==="FullModel"}function GDe(e){return e.modelName==="Overview"}function VDe(e){return GDe(e)||u5(e)}function UDe(e,t){if(VDe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:xe.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function QNt(e,t){if(VDe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");u5(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function kNt(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 UNt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:xe.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:xe.observable(!0),index:-1}],currentLayer:xe.observable(),expandClickHandler:FNt,setOptionDisable:function(i,o){xe.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){QNt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){zDe(n[i],this.viewModel);let o=UDe(n[i],this.viewModel);l(o)&&(GDe(o)||!l(this.viewModel.defaultLayer)&&u5(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=UDe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=u5(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return kNt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var f5=UNt;function zNt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
|
|
<h3>Building explorer</h3>
|
|
<select
|
|
data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
|
|
></select>
|
|
<div id="bsl-wrapper">
|
|
<h3>Select Level</h3>
|
|
<select data-bind="options: levels, value: currentLevel"></select>
|
|
<h3>Disciplines & Categories</h3>
|
|
<ul class="layersList" data-bind="foreach: sublayers">
|
|
<ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
|
|
<li>
|
|
<div class="li-wrapper">
|
|
<span
|
|
class="expandItem"
|
|
data-bind="click: $root.expandClickHandler"
|
|
>+</span
|
|
>
|
|
<input
|
|
type="checkbox"
|
|
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
|
|
/>
|
|
<label data-bind="attr: { for: name}">
|
|
<span data-bind="text: name"></span>
|
|
</label>
|
|
</div>
|
|
<ul class="nested" data-bind="attr: { id: name + '-expander'}">
|
|
<li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
|
|
<div class="li-wrapper">
|
|
<input
|
|
type="checkbox"
|
|
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
|
|
/>
|
|
<label data-bind="attr: { for: name}">
|
|
<span data-bind="text: name"></span>
|
|
</label>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>`,n.appendChild(i);let o=new f5(t);xe.track(o),xe.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var HDe=zNt;var GNt="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",VNt="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 Mte(){this._cameraClicked=new _e,this._closeClicked=new _e,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",xe.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,xe.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?VNt:GNt}}),xe.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Mte.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Mte.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var d5=Mte;function h5(e){e=zn(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="×",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 a=new d5;xe.applyBindings(a,t),this._container=e,this._element=t,this._frame=r,this._viewModel=a,this._descriptionSubscription=void 0;let s=this;r.addEventListener("load",function(){let c=r.contentDocument,u=c.createElement("link");u.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=c.createElement("div");f.className="cesium-infoBox-description",c.head.appendChild(u),c.body.appendChild(f),s._descriptionSubscription=wc(a,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,A=f.firstElementChild;if(A!==null&&f.childNodes.length===1){let _=window.getComputedStyle(A);if(_!==null){let y=_["background-color"],C=U.fromCssColorString(y);l(C)&&C.alpha!==0&&(p=_["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(h5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});h5.prototype.isDestroyed=function(){return!1};h5.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),fe(this)};var m5=h5;function WDe(){this.showInstructions=!1;let e=this;this._command=Mn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Mn(function(){e._touch=!1}),this._showTouch=Mn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",xe.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(WDe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var p5=WDe;function A5(e){let t=zn(e.container),n=new p5,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 a=document.createElement("div");a.className="cesium-navigation-help",a.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(a);let s=document.createElement("button");s.type="button",s.className="cesium-navigation-button cesium-navigation-button-left",s.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Zt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",s.appendChild(c),s.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),a.appendChild(s),a.appendChild(u);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,a.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,a.appendChild(p),xe.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(A){o.contains(A.target)||(n.showInstructions=!1)},hn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(A5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});A5.prototype.isDestroyed=function(){return!1};A5.prototype.destroy=function(){return hn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var g5=A5;function Nte(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,xe.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Mn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=p9.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(Nte.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Nte.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),fe(this)};var _5=Nte;function y5(e){let t=zn(e.container),n=new _5(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="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),xe.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(y5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});y5.prototype.isDestroyed=function(){return!1};y5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var C5=y5;function E5(e){this._scene=e,this._orthographic=e.camera.frustum instanceof An,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,xe.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;xe.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Mn(function(){t.sceneMode===oe.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===oe.SCENE2D||t._scene.camera.frustum instanceof An}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Mn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Mn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(E5.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}}});E5.prototype.isDestroyed=function(){return!1};E5.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var I5=E5;var HNt="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",WNt="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 b5(e,t){e=zn(e);let n=new I5(t);n._perspectivePath=HNt,n._orthographicPath=WNt;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 a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(a),xe.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(s){i.contains(s.target)||(n.dropDownVisible=!1)},hn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(b5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});b5.prototype.isDestroyed=function(){return!1};b5.prototype.destroy=function(){return this._viewModel.destroy(),hn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var x5=b5;function T5(e,t){this._scene=e;let n=this,i=function(o,r,a,s){n.sceneMode=a,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",xe.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,xe.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Mn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Mn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Mn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Mn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(T5.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});T5.prototype.isDestroyed=function(){return!1};T5.prototype.destroy=function(){this._eventHelper.removeAll(),fe(this)};var S5=T5;var jNt="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",YNt="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",qNt="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 w5(e,t,n){e=zn(e);let i=new S5(t,n);i._globePath=jNt,i._flatMapPath=YNt,i._columbusViewPath=qNt;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 a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(a);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.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(s);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),xe.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},hn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(w5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});w5.prototype.isDestroyed=function(){return!1};w5.prototype.destroy=function(){return this._viewModel.destroy(),hn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),xe.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),fe(this)};var B5=w5;var KNt=new Q,D5="-1000px";function nM(e,t,n){this._scene=e,this._screenPositionX=D5,this._screenPositionY=D5,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,xe.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,xe.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),xe.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return co.worldToWindowCoordinates(e,i,o)}}nM.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,KNt);if(!l(e))this._screenPositionX=D5,this._screenPositionY=D5;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`}}};nM.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Pa.EXPONENTIAL_OUT})};nM.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Pa.EXPONENTIAL_OUT})};Object.defineProperties(nM.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var v5=nM;function P5(e,t){e=zn(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 a=document.createElementNS(i,"g");a.setAttribute("transform","translate(80,80)"),r.appendChild(a);let s=document.createElementNS(i,"path");s.setAttribute("data-bind","attr: { transform: _transform }"),s.setAttribute("d",o),a.appendChild(s),n.appendChild(r);let c=new v5(t,this._element,this._container);this._viewModel=c,xe.applyBindings(this._viewModel,this._element)}Object.defineProperties(P5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});P5.prototype.isDestroyed=function(){return!1};P5.prototype.destroy=function(){let e=this._container;return xe.cleanNode(this._element),e.removeChild(this._element),fe(this)};var R5=P5;function mI(e,t,n){this._color=e,this._height=t,this._base=n??0}mI.prototype.getHeight=function(){return this._height};mI.prototype.getBase=function(){return this._base};mI.prototype.getStartTime=function(){return this._start};mI.prototype.getStopTime=function(){return this._stop};mI.prototype.setRange=function(e,t){this._start=e,this._stop=t};mI.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=X.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=X.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 M5=mI;function jDe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new U(.5,.5,.5,1),this.backgroundColor=i||new U(0,0,0,0)}jDe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=X.addSeconds(t.startJulian,t.duration,new X);if(X.lessThan(n,o)&&X.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(X.lessThanOrEquals(n,r)&&X.greaterThanOrEquals(i,o)){let a,s,c;for(a=0;a<t.timeBarWidth;++a){let u=X.addSeconds(t.startJulian,a/t.timeBarWidth*t.duration,new X);!l(s)&&X.greaterThanOrEquals(u,n)?s=a:!l(c)&&X.greaterThanOrEquals(u,i)&&(c=a)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(s)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(s,t.y,Math.max(c-s,1),this.height))}};var N5=jDe;var Lte=1e12,Yd={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ul={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},SC=[.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],XNt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function zl(e,t){e=zn(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=Yd.none,this._touchMode=Ul.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=JNt(this),this._onMouseUp=ZNt(this),this._onMouseMove=$Nt(this),this._onMouseWheel=eLt(this),this._onTouchStart=tLt(this),this._onTouchMove=iLt(this),this._onTouchEnd=nLt(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()}zl.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};zl.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};zl.prototype.isDestroyed=function(){return!1};zl.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),fe(this)};zl.prototype.addHighlightRange=function(e,t,n){let i=new M5(e,t,n);return this._highlightRanges.push(i),this.resize(),i};zl.prototype.addTrack=function(e,t,n,i){let o=new N5(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};zl.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=X.secondsDifference(t,e),this._clock&&this._clock.clockRange!==va.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=X.secondsDifference(o,i),a=X.secondsDifference(i,this._startJulian),s=X.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):a>0?(this._endJulian=X.addSeconds(this._endJulian,a,new X),this._startJulian=i,this._timeBarSecondsSpan=X.secondsDifference(this._endJulian,this._startJulian)):s<0&&(this._startJulian=X.addSeconds(this._startJulian,s,new X),this._endJulian=o,this._timeBarSecondsSpan=X.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)};zl.prototype.zoomFrom=function(e){let t=X.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(X.addSeconds(this._startJulian,t-t*e,new X),X.addSeconds(this._endJulian,n*e-n,new X))};function Ote(e){return e<10?`0${e.toString()}`:e.toString()}zl.prototype.makeLabel=function(e){let t=X.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`${XNt[t.month-1]} ${t.day} ${t.year} ${Ote(t.hour)}:${Ote(t.minute)}:${Ote(t.second)}${i}`};zl.prototype.smallestTicInPixels=7;zl.prototype._makeTics=function(){let e=this._timeBarEle,t=X.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 a="",s=.01,c=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<s?(h=s,this._timeBarSecondsSpan=s,this._endJulian=X.addSeconds(this._startJulian,s,new X)):h>c&&(h=c,this._timeBarSecondsSpan=c,this._endJulian=X.addSeconds(this._startJulian,c,new X));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let A=this._startJulian,m=Math.min(h/p*1e-5,.4),_,y=X.toGregorianDate(A);h>31536e4?_=X.fromDate(new Date(Date.UTC(Math.floor(y.year/100)*100,0))):h>31536e3?_=X.fromDate(new Date(Date.UTC(Math.floor(y.year/10)*10,0))):h>86400?_=X.fromDate(new Date(Date.UTC(y.year,0))):_=X.fromDate(new Date(Date.UTC(y.year,y.month,y.day)));let C=X.secondsDifference(this._startJulian,X.addSeconds(_,m,new X)),E=C+h;this._epochJulian=_;function I(F){return Math.floor(C/F)*F}function x(F,H){return Math.ceil(F/H+.5)*H}function S(F){return(F-C)/h}function w(F,H){return F-H*Math.round(F/H)}this._rulerEle.innerHTML=this.makeLabel(X.addSeconds(this._endJulian,-s,new X));let v=this._rulerEle.offsetWidth+20;v<30&&(v=180);let R=f;f-=u;let N={startTime:C,startJulian:A,epochJulian:_,duration:h,timeBarWidth:p,getAlpha:S};this._highlightRanges.forEach(function(F){a+=F.render(N)});let L=0,g=0,b=0,T=v/p;T>1&&(T=1),T*=this._timeBarSecondsSpan;let B=-1,M=-1,O=SC.length,G;for(G=0;G<O;++G){let F=SC[G];if(++B,L=F,F>T&&F>f)break;M<0&&p*(F/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=B)}if(B>0){for(;B>0;)if(--B,Math.abs(w(L,SC[B]))<1e-5){SC[B]>=f&&(g=SC[B]);break}if(M>=0)for(;M<B;){if(Math.abs(w(g,SC[M]))<1e-5&&SC[M]>=f){b=SC[M];break}++M}}f=R,f>u&&b<1e-5&&Math.abs(f-L)>u&&(b=f,f<=L+u&&(g=0));let k=-999999,z;if(p*(b/this._timeBarSecondsSpan)>=3)for(o=I(b);o<=E;o=x(o,b))a+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=I(g);o<=E;o=x(o,g))a+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*S(o)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,E+=L,o=I(L);let F=X.computeTaiMinusUtc(_);for(;o<=E;){let H=X.addSeconds(A,o-C,new X);if(L>2.1){let K=X.computeTaiMinusUtc(H);Math.abs(K-F)>.1&&(o+=K-F,H=X.addSeconds(A,o-C,new X))}let Y=Math.round(p*S(o)),$=this.makeLabel(H);this._rulerEle.innerHTML=$,z=this._rulerEle.offsetWidth,z<10&&(z=v);let W=Y-(z/2-1);W>k?(k=W+z+5,a+=`<span class="cesium-timeline-ticMain" style="left: ${Y.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${$}</span>`):a+=`<span class="cesium-timeline-ticSub" style="left: ${Y.toString()}px;"></span>`,o=x(o,L)}}else this._mainTicSpan=-1;a+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=a,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),N.y=0,this._trackList.forEach(function(F){F.render(r._context,N),N.y+=F.height})};zl.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=X.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(X.addSeconds(this._startJulian,this._timelineDrag,new X),X.addSeconds(this._endJulian,this._timelineDrag,new X)))};zl.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=X.addSeconds(this._startJulian,t,new X),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 JNt(e){return function(t){e._mouseMode!==Yd.touchOnly&&(t.button===0?(e._mouseMode=Yd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Yd.zoom:e._mouseMode=Yd.slide)),t.preventDefault()}}function ZNt(e){return function(t){e._mouseMode=Yd.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function $Nt(e){return function(t){let n;if(e._mouseMode===Yd.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===Yd.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(X.addSeconds(e._startJulian,i,new X),X.addSeconds(e._endJulian,i,new X))}}else e._mouseMode===Yd.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function eLt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Lte=Math.max(Math.min(Math.abs(n),Lte),1),n/=Lte,e.zoomFrom(Math.pow(1.05,-n))}}function tLt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Yd.touchOnly,n===1?(i=X.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=Ul.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Ul.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=Ul.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=Ul.ignore}}function nLt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Ul.singleTap?(e._touchMode=Ul.scrub,e._onTouchMove(t)):e._touchMode===Ul.scrub&&e._onTouchMove(t),e._mouseMode=Yd.touchOnly,n!==1?e._touchMode=n>0?Ul.ignore:Ul.none:e._touchMode===Ul.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function iLt(e){return function(t){let n,i,o,r,a,s,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Ul.singleTap&&(e._touchMode=Ul.slideZoom),e._mouseMode=Yd.touchOnly,e._touchMode===Ul.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Ul.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,a=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,a=0),l(r)&&(a>0&&e._touchState.spanX>0?(c=e._touchState.spanX/a,s=X.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new X)):(n=e._touchState.centerX-r,s=X.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new X)),e.zoomTo(s,X.addSeconds(s,e._timeBarSecondsSpan*c,new X)),e._touchState.centerX=r,e._touchState.spanX=a))}}zl.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 L5=zl;var JDe=Na(XDe(),1);function aLt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function ZDe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function sLt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(ZDe(),e._locked=!1),e._noSleep.disable(),Jr.exitFullscreen(),n(!1)):(Jr.fullscreen||Jr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=aLt("landscape")),t.useWebVR=!0,n(!0)))}function O5(e,t){let n=this,i=xe.observable(Jr.enabled),o=xe.observable(!1);this.isVRMode=void 0,xe.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,xe.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(a){i(a&&Jr.enabled)}}),this.tooltip=void 0,xe.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=xe.observable(!1);this._isOrthographic=void 0,xe.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Hr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof An)}),this._locked=!1,this._noSleep=new JDe.default,this._command=Mn(function(){sLt(n,e,o,r)},xe.getObservable(this,"isVREnabled")),this._vrElement=zn(t)??document.body,this._callback=function(){!Jr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(ZDe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Jr.changeEventName,this._callback)}Object.defineProperties(O5.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});O5.prototype.isDestroyed=function(){return!1};O5.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Jr.changeEventName,this._callback),fe(this)};var F5=O5;var cLt="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",lLt="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 Q5(e,t,n){e=zn(e);let i=new F5(t,n);i._exitVRPath=lLt,i._enterVRPath=cLt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),xe.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(Q5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Q5.prototype.isDestroyed=function(){return!1};Q5.prototype.destroy=function(){return this._viewModel.destroy(),xe.cleanNode(this._element),this._container.removeChild(this._element),fe(this)};var k5=Q5;var $De=new le;function nve(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function uLt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function fLt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function eve(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof $o)return i;if(n instanceof Vs)return new $o({name:fLt(n),description:uLt(n),feature:n})}if(l(e.scene.globe))return mLt(e,t.position)}var dLt=new X;function Ute(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;X.equals(i,o)&&(o=X.addSeconds(i,D.EPSILON2,dLt)),e.updateFromClock(),e.zoomTo(i,o)}}}var hLt=new d;function mLt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!l(o))return;let r=new $o({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==r)return;if(!l(a)||a.length===0){e.selectedEntity=tve();return}let s=a[0],c=new $o({id:s.name,description:s.description});if(l(s.position)){let u=e.scene.ellipsoid.cartographicToCartesian(s.position,hLt);c.position=new eu(u)}e.selectedEntity=c},function(){e.selectedEntity===r&&(e.selectedEntity=tve())}),r}function tve(){return new $o({id:"None",description:"No features found."})}function pLt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,a=e._baseLayerPicker,s=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(h)&&(h.container.style.visibility=p),e._container){let A=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${A}px`,e.forceResize()}}function uo(e,t){e=zn(e),t=t??V.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let a=document.createElement("div");a.className="cesium-viewer-bottom",o.appendChild(a);let s=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new hp,u=new L9(c),f=!0);let h=new a9(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:a,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:s,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,A=new Hr;A.add(c.onTick,uo.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let H=document.createElement("div");H.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(H),m=new R5(H,p)}let _;if(!l(t.infoBox)||t.infoBox!==!1){let H=document.createElement("div");H.className="cesium-viewer-infoBoxContainer",o.appendChild(H),_=new m5(H);let Y=_.viewModel;A.add(Y.cameraClicked,uo.prototype._onInfoBoxCameraClicked,this),A.add(Y.closeClicked,uo.prototype._onInfoBoxClockClicked,this)}let y=document.createElement("div");y.className="cesium-viewer-toolbar",o.appendChild(y);let C;if(!l(t.geocoder)||t.geocoder!==!1){let H=document.createElement("div");H.className="cesium-viewer-geocoderContainer",y.appendChild(H);let Y;typeof t.geocoder=="string"?Y=[new CS({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(Y=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),C=new a5({container:H,geocoderServices:Y,scene:p}),A.add(C.viewModel.search.beforeExecute,uo.prototype._clearObjects,this)}let E;(!l(t.homeButton)||t.homeButton!==!1)&&(E=new l5(y,p),l(C)&&A.add(E.viewModel.command.afterExecute,function(){let H=C.viewModel;H.searchText="",H.isSearchInProgress&&H.search()}),A.add(E.viewModel.command.beforeExecute,uo.prototype._clearTrackedObject,this));let I;!s&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(I=new B5(y,p));let x;t.projectionPicker&&(x=new x5(y,p));let S,w;if(n){let H=t.imageryProviderViewModels??K9(),Y=t.terrainProviderViewModels??X9();S=new q9(y,{globe:p.globe,imageryProviderViewModels:H,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:Y,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),w=y.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(S.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(S.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let v;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let H=!0;try{if(l(window.localStorage)){let Y=window.localStorage.getItem("cesium-hasSeenNavHelp");l(Y)&&Y?H=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}v=new g5({container:y,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??H})}let R;if(!l(t.animation)||t.animation!==!1){let H=document.createElement("div");H.className="cesium-viewer-animationContainer",o.appendChild(H),R=new U9(H,new z9(u))}let N;if(!l(t.timeline)||t.timeline!==!1){let H=document.createElement("div");H.className="cesium-viewer-timelineContainer",o.appendChild(H),N=new L5(H,c),N.addEventListener("settime",nve,!1),N.zoomTo(c.startTime,c.stopTime)}let L,g,b;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(b=document.createElement("div"),b.className="cesium-viewer-fullscreenContainer",o.appendChild(b),L=new i5(b,t.fullscreenElement),g=wc(L.viewModel,"isFullscreenEnabled",function(H){b.style.display=H?"block":"none",l(N)&&(N.container.style.right=`${b.clientWidth}px`,N.resize())}));let T,B,M;if(t.vrButton){let H=document.createElement("div");H.className="cesium-viewer-vrContainer",o.appendChild(H),T=new k5(H,p,t.fullScreenElement),B=wc(T.viewModel,"isVREnabled",function(Y){H.style.display=Y?"block":"none",l(L)&&(H.style.right=`${b.clientWidth}px`),l(N)&&(N.container.style.right=`${H.clientWidth}px`,N.resize())}),M=wc(T.viewModel,"isVRMode",function(Y){pLt(i,Y)})}this._baseLayerPickerDropDown=w,this._fullscreenSubscription=g,this._vrSubscription=B,this._vrModeSubscription=M,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=a,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=_,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=y,this._homeButton=E,this._sceneModePicker=I,this._projectionPicker=x,this._baseLayerPicker=S,this._navigationHelpButton=v,this._animation=R,this._timeline=N,this._fullscreenButton=L,this._vrButton=T,this._geocoder=C,this._eventHelper=A,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(_)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new _e;let O=this._cesiumWidget.dataSources,G=this._cesiumWidget.dataSourceDisplay;A.add(O.dataSourceAdded,uo.prototype._onDataSourceAdded,this),A.add(O.dataSourceRemoved,uo.prototype._onDataSourceRemoved,this),A.add(p.postUpdate,uo.prototype.resize,this);let k=O.length;for(let H=0;H<k;H++)this._dataSourceAdded(O,O.get(H));this._dataSourceAdded(void 0,G.defaultDataSource),A.add(O.dataSourceAdded,uo.prototype._dataSourceAdded,this),A.add(O.dataSourceRemoved,uo.prototype._dataSourceRemoved,this);function z(H){let Y=eve(i,H);l(Y)?q.getValueOrUndefined(Y.position,i.clock.currentTime)?i.trackedEntity=Y:i.zoomTo(Y):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function F(H){i.selectedEntity=eve(i,H)}h.screenSpaceEventHandler.setInputAction(F,Dn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(z,Dn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(uo.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,Ute(this._timeline,e))}}});uo.prototype.extend=function(e,t){e(this,t)};uo.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let a=i-125,s=this._baseLayerPickerDropDown;if(l(s)&&(s.style.maxHeight=`${a}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${a}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=a);let c=this._timeline,u,f=0,h=5,p=3,A=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,_=this._vrButton,y=c.container,C=y.style;p=y.clientHeight+3,C.left=`${f}px`;let E=0;l(m)&&(E+=m.container.clientWidth),l(_)&&(E+=_.container.clientWidth),C.right=`${E}px`,c.resize()}!r&&l(this._fullscreenButton)&&(A=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${A}px`,this._lastWidth=n,this._lastHeight=i};uo.prototype.forceResize=function(){this._lastWidth=0,this.resize()};uo.prototype.render=function(){this._cesiumWidget.render()};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Dn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Dn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",nve,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),fe(this)};uo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(uo.prototype._onEntityCollectionChanged,this)};uo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(uo.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};uo.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};uo.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,$De)!==Ct.FAILED?n=$De.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let a=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(a)&&(a.position=d.clone(n,a.position),a.showSelection=r&&i,a.update());let s=l(this._infoBox)?this._infoBox.viewModel:void 0;l(s)&&(s.showInfo=r,s.enableCamera=i,s.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(s.titleText=o.name??o.id,s.description=q.getValueOrDefault(o.description,t,"")):(s.titleText="",s.description=""))};uo.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)}};uo.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};uo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};uo.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};uo.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};uo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Ute(this.timeline,e)};uo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Ute(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,uo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};uo.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};uo.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};uo.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var ive=uo;function ALt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new W9(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var ove=ALt;function gLt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new $9(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var rve=gLt;function _Lt(e,t){t=t??V.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new _e,r=t.clearOnDrop??!0,a=t.dropTarget??e.container,s=t.clampToGround??!0,c=t.proxy;a=zn(a),Object.defineProperties(e,{dropTarget:{get:function(){return a},set:function(f){ave(a,u),a=f,zte(a,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?zte(a,u):ave(a,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return s},set:function(f){s=f}}});function u(f){pI(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let A=0;A<p;A++){let m=h[A],_=new FileReader;_.onload=yLt(e,m,c,s),_.onerror=CLt(e,m),_.readAsText(m)}}zte(a,u),e.destroy=t8(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function pI(e){e.stopPropagation(),e.preventDefault()}function ave(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",pI,!1),n.removeEventListener("dragover",pI,!1),n.removeEventListener("dragexit",pI,!1))}function zte(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",pI,!1),e.addEventListener("dragover",pI,!1),e.addEventListener("dragexit",pI,!1)}function yLt(e,t,n,i){let o=e.scene;return function(r){let a=t.name;try{let s;if(/\.czml$/i.test(a))s=ZU.load(JSON.parse(r.target.result),{sourceUri:a});else if(/\.geojson$/i.test(a)||/\.json$/i.test(a)||/\.topojson$/i.test(a))s=v0.load(JSON.parse(r.target.result),{sourceUri:a,clampToGround:i});else if(/\.(kml|kmz)$/i.test(a))s=aS.load(t,{sourceUri:a,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(a))s=tV.load(t,{sourceUri:a,proxy:n});else{e.dropError.raiseEvent(e,a,`Unrecognized file: ${a}`);return}l(s)&&e.dataSources.add(s).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,a,c)})}catch(s){e.dropError.raiseEvent(e,a,s)}}}function CLt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var sve=_Lt;function ELt(e,t){t=t??V.EMPTY_OBJECT;let n=new C5({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var cve=ELt;function lve(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*/,a=t[n].match(o)[0].length;for(let s=n;s<t.length;s++){let c=t[s];c.match(o)[0].length>=a&&(c=c.slice(a)),i+=`${c}
|
|
`}return i}function qd(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:a}=o;t._definedProperties.push(r);let s=o.setPrimitiveFunction;s===!0&&(s=function(f){t._voxelPrimitive[r]=f});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=xe.observable();return xe.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof a=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=a)),typeof a=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(s)&&l(t._voxelPrimitive)&&(s(f),e.requestRender())}}),t[r]=a,u}function i(o,r){return function(a){let s=t._voxelPrimitive[o].clone();s[r]=a,t._voxelPrimitive[o]=s}}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=lve(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===Sc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Sc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Sc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)},getPrimitiveFunction:function(){t.translationX=P.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)},getPrimitiveFunction:function(){t.translationY=P.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)},getPrimitiveFunction:function(){t.translationZ=P.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)},getPrimitiveFunction:function(){t.scaleX=P.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)},getPrimitiveFunction:function(){t.scaleY=P.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)},getPrimitiveFunction:function(){t.scaleZ=P.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&Xp(t)}})}var ILt=new d,bLt=new d,xLt=new Rc,TLt=new J;function Xp(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,ILt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,bLt),i=xLt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=J.fromHeadingPitchRoll(i,TLt),r=J.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=P.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(qd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=lve(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,Xp(t)}}});qd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};qd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};qd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};qd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};qd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};qd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};qd.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new HS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};qd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,s=n.value.slice(i,o).split(`
|
|
`),c=s.length,u;if(t.shiftKey)for(u=0;u<c;++u)s[u][0]===" "&&(s[u][1]===" "?(s[u]=s[u].substr(2),r-=2):(s[u]=s[u].substr(1),r-=1));else for(u=0;u<c;++u)s[u]=` ${s[u]}`,r+=2;let f=s.join(`
|
|
`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};qd.prototype.isDestroyed=function(){return!1};qd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){xe.getObservable(e,t).dispose()}),fe(this)};var U5=qd;function z5(e,t){e=zn(e);let n=document.createElement("div"),i=new U5(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:a,createCheckbox:s,createRangeInput:c,createButton:u}=Rf,f=a(r,"Display","displayVisible","toggleDisplay"),h=a(r,"Transform","transformVisible","toggleTransform"),p=a(r,"Clipping","clippingVisible","toggleClipping"),A=a(r,"Shader","shaderVisible","toggleShader");f.appendChild(s("Depth Test","depthTest")),f.appendChild(s("Show","show")),f.appendChild(s("Disable Update","disableUpdate")),f.appendChild(s("Debug Draw","debugDraw")),f.appendChild(s("Jitter","jitter")),f.appendChild(s("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,_=10,y=D.PI;h.appendChild(c("Translation X","translationX",-m,+m)),h.appendChild(c("Translation Y","translationY",-m,+m)),h.appendChild(c("Translation Z","translationZ",-m,+m)),h.appendChild(c("Scale X","scaleX",0,+_)),h.appendChild(c("Scale Y","scaleY",0,+_)),h.appendChild(c("Scale Z","scaleZ",0,+_)),h.appendChild(c("Heading","angleX",-y,+y)),h.appendChild(c("Pitch","angleY",-y,+y)),h.appendChild(c("Roll","angleZ",-y,+y)),Gte("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Gte("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Gte("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let C=document.createElement("div");A.appendChild(C);let E=document.createElement("textarea");E.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),C.className="cesium-cesiumInspector-styleEditor",C.appendChild(E);let I=u("Compile (Ctrl+Enter)","compileShader");C.appendChild(I);let x=document.createElement("label");x.style.display="block",x.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),C.appendChild(x),xe.applyBindings(i,n)}Object.defineProperties(z5.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});z5.prototype.isDestroyed=function(){return!1};z5.prototype.destroy=function(){return xe.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),fe(this)};function Gte(e,t,n,i,o,r,a,s,c,u,f,h,p,A){let m=Rf.createRangeInputWithDynamicMinMax,_=A.appendChild(document.createElement("div"));_.setAttribute("data-bind",`if: ${p}`),_.appendChild(m(e,a)),_.appendChild(m(t,s)),_.appendChild(m(n,c)),_.appendChild(m(i,u)),_.appendChild(m(o,f)),_.appendChild(m(r,h))}var G5=z5;function SLt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new G5(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var uve=SLt;globalThis.CESIUM_VERSION="1.140.0";var ZDo="1.140.0";export{bA as AlphaMode,w2 as AlphaPipelineStage,wQ as AnchorPointDirect,BQ as AnchorPointIndirect,U9 as Animation,z9 as AnimationViewModel,xo as Appearance,vi as ApproximateTerrainHeights,iIe as ArcGISTiledElevationTerrainProvider,$m as ArcGisBaseMapType,G_ as ArcGisMapServerImageryProvider,nd as ArcGisMapService,un as ArcType,xl as ArticulationStageType,Ft as AssociativeArray,Wb as Atmosphere,a2 as AtmospherePipelineStage,tn as AttributeCompression,zt as AttributeType,t4 as AutoExposure,Og as AutomaticUniforms,so as Axis,Wf as AxisAlignedBoundingBox,fk as Azure2DImageryProvider,UQ as B3dmLoader,kQ as B3dmParser,q9 as BaseLayerPicker,j9 as BaseLayerPickerViewModel,nb as BatchTable,Sb as BatchTableHierarchy,ou as BatchTexture,B2 as BatchTexturePipelineStage,Ro as Billboard,fd as BillboardCollection,dl as BillboardGraphics,Ga as BillboardLoadState,q_ as BillboardTexture,p1 as BillboardVisualizer,rIe as BingMapsGeocoderService,Z2 as BingMapsImageryProvider,sD as BingMapsStyle,Lc as BlendEquation,Zo as BlendFunction,nr as BlendOption,sn as BlendingState,et as BoundingRectangle,le as BoundingSphere,Ct as BoundingSphereState,mE as BoundingVolumeSemantics,rBe as BoxEmitter,Nc as BoxGeometry,fF as BoxGeometryUpdater,ub as BoxGraphics,Sm as BoxOutlineGeometry,X8 as BrdfLutGenerator,tt as Buffer,Db as BufferLoader,tf as BufferPoint,ty as BufferPointCollection,ey as BufferPointMaterial,qs as BufferPolygon,oy as BufferPolygonCollection,ny as BufferPolygonMaterial,Au as BufferPolyline,WE as BufferPolylineCollection,ry as BufferPolylineMaterial,sa as BufferPrimitive,ss as BufferPrimitiveCollection,pu as BufferPrimitiveMaterial,Re as BufferUsage,R2 as CPUStylingPipelineStage,dF as CallbackPositionProperty,Mm as CallbackProperty,Bo as Camera,r4 as CameraEventAggregator,oo as CameraEventType,J8 as CameraFlightPath,Q as Cartesian2,d as Cartesian3,ie as Cartesian4,AD as CartesianRectangle,me as Cartographic,aIe as CartographicGeocoderService,cIe as CatmullRomSpline,Tb as Cesium3DContentGroup,Dh as Cesium3DTile,Um as Cesium3DTileBatchTable,Yu as Cesium3DTileColorBlendMode,aBe as Cesium3DTileContent,Nx as Cesium3DTileContentFactory,br as Cesium3DTileContentState,Bs as Cesium3DTileContentType,Vs as Cesium3DTileFeature,Km as Cesium3DTileFeatureTable,wh as Cesium3DTileOptimizationHint,fU as Cesium3DTileOptimizations,ur as Cesium3DTilePass,om as Cesium3DTilePassState,X_ as Cesium3DTilePointFeature,Cr as Cesium3DTileRefine,sy as Cesium3DTileStyle,AU as Cesium3DTileStyleEngine,W9 as Cesium3DTilesInspector,V9 as Cesium3DTilesInspectorViewModel,TV as Cesium3DTilesTerrainData,OP as Cesium3DTilesTerrainGeometryProcessor,bIe as Cesium3DTilesTerrainProvider,cBe as Cesium3DTilesVoxelProvider,cs as Cesium3DTileset,_U as Cesium3DTilesetBaseTraversal,hU as Cesium3DTilesetCache,gb as Cesium3DTilesetGraphics,pU as Cesium3DTilesetHeatmap,Yx as Cesium3DTilesetMetadata,gU as Cesium3DTilesetMostDetailedTraversal,CU as Cesium3DTilesetSkipTraversal,lp as Cesium3DTilesetStatistics,Zs as Cesium3DTilesetTraversal,bU as Cesium3DTilesetVisualizer,$9 as CesiumInspector,J9 as CesiumInspectorViewModel,dS as CesiumTerrainProvider,a9 as CesiumWidget,Wo as Check,sv as CheckerboardMaterialProperty,c9 as CircleEmitter,RIe as CircleGeometry,MIe as CircleOutlineGeometry,e3 as ClassificationModelDrawCommand,D2 as ClassificationPipelineStage,qw as ClassificationPrimitive,ei as ClassificationType,ui as ClearCommand,os as ClippingPlane,Ca as ClippingPlaneCollection,jB as ClippingPolygon,jm as ClippingPolygonCollection,hp as Clock,va as ClockRange,Qo as ClockStep,L9 as ClockViewModel,pBe as CloudCollection,OR as CloudType,U as Color,bl as ColorBlendMode,Jt as ColorGeometryInstanceAttribute,Kt as ColorMaterialProperty,IDe as Command,j as ComponentDatatype,_F as Composite3DTileContent,gpe as CompositeEntityCollection,fv as CompositeMaterialProperty,_c as CompositePositionProperty,vl as CompositeProperty,tN as CompressedTextureBuffer,Vl as ComputeCommand,eN as ComputeEngine,W3 as ConditionsExpression,ABe as ConeEmitter,eu as ConstantPositionProperty,hi as ConstantProperty,qQ as ConstantSpline,$3 as ContentMetadata,YI as Context,Nt as ContextLimits,gz as CoplanarPolygonGeometry,ly as CoplanarPolygonGeometryLibrary,Bh as CoplanarPolygonOutlineGeometry,no as CornerType,DQ as CorrelationGroup,tT as CorridorGeometry,lo as CorridorGeometryLibrary,MU as CorridorGeometryUpdater,db as CorridorGraphics,RU as CorridorOutlineGeometry,Et as Credit,sH as CreditDisplay,ta as CubeMap,pN as CubeMapFace,XS as CubeMapPanorama,kI as CubicRealPolynomial,Li as CullFace,ns as CullingVolume,Hd as CumulusCloud,QU as CustomDataSource,NIe as CustomHeightmapTerrainProvider,HS as CustomShader,U_ as CustomShaderMode,k2 as CustomShaderPipelineStage,SE as CustomShaderTranslucencyMode,kU as CylinderGeometry,iT as CylinderGeometryLibrary,zU as CylinderGeometryUpdater,hb as CylinderGraphics,UU as CylinderOutlineGeometry,ZU as CzmlDataSource,Da as DataSource,mp as DataSourceClock,ez as DataSourceCollection,Kz as DataSourceDisplay,TBe as DebugAppearance,_g as DebugCameraPrimitive,y4 as DebugInspector,d9 as DebugModelMatrixPrimitive,OIe as DefaultProxy,hc as DepthFunction,uH as DepthPlane,U2 as DequantizationPipelineStage,yg as DerivedCommand,de as DeveloperError,dH as DeviceOrientationCameraController,SBe as DirectionalLight,lD as DiscardEmptyTileImagePolicy,K2 as DiscardMissingTileImagePolicy,Gt as DistanceDisplayCondition,$n as DistanceDisplayConditionGeometryInstanceAttribute,eC as DoubleEndedPriorityQueue,dU as DoublyLinkedList,C_ as DracoLoader,it as DrawCommand,P_ as DynamicAtmosphereLightingType,R_ as DynamicEnvironmentMapManager,AT as DynamicGeometryBatch,xi as DynamicGeometryUpdater,FM as EarthOrientationParameters,DC as EarthOrientationParametersSample,Pa as EasingFunction,G2 as EdgeDetectionPipelineStage,EH as EdgeFramebuffer,W2 as EdgeVisibilityPipelineStage,Cu as EllipseGeometry,lf as EllipseGeometryLibrary,lz as EllipseGeometryUpdater,mb as EllipseGraphics,Dd as EllipseOutlineGeometry,te as Ellipsoid,i_ as EllipsoidGeodesic,nc as EllipsoidGeometry,uz as EllipsoidGeometryUpdater,pb as EllipsoidGraphics,Cd as EllipsoidOutlineGeometry,j8 as EllipsoidPrimitive,Oc as EllipsoidRhumbLine,wBe as EllipsoidSurfaceAppearance,Fa as EllipsoidTangentPlane,gS as EllipsoidTerrainProvider,dp as EllipsoidalOccluder,qD as Empty3DTileContent,xn as EncodedCartesian3,$o as Entity,xd as EntityCluster,$s as EntityCollection,Jz as EntityView,BBe as EquirectangularPanorama,_e as Event,Hr as EventHelper,uh as Expression,Bt as ExpressionNodeType,Td as ExtrapolationType,hn as FeatureDetection,TE as FeatureIdPipelineStage,hH as Fog,ze as ForEach,p9 as FrameRateMonitor,mH as FrameState,pa as Framebuffer,bi as FramebufferManager,V as Frozen,IH as FrustumCommands,yS as FrustumGeometry,MV as FrustumOutlineGeometry,Jr as Fullscreen,i5 as FullscreenButton,t5 as FullscreenButtonViewModel,YE as GaussianSplat3DTileContent,Z3 as GaussianSplatPrimitive,q3 as GaussianSplatRenderResources,Mx as GaussianSplatSorter,Y3 as GaussianSplatTextureGenerator,v0 as GeoJsonDataSource,GQ as GeoJsonLoader,L0 as GeocodeType,a5 as Geocoder,UP as GeocoderService,o5 as GeocoderViewModel,qi as GeographicProjection,Ji as GeographicTilingScheme,yt as Geometry,TF as Geometry3DTileContent,Me as GeometryAttribute,En as GeometryAttributes,GIe as GeometryFactory,Lt as GeometryInstance,hl as GeometryInstanceAttribute,mn as GeometryOffsetAttribute,jn as GeometryPipeline,q2 as GeometryPipelineStage,$d as GeometryType,Ti as GeometryUpdater,RT as GeometryUpdaterSet,Lz as GeometryVisualizer,tp as GetFeatureInfoFormat,H8 as Globe,bH as GlobeDepth,b8 as GlobeSurfaceShaderSet,nm as GlobeSurfaceTile,N8 as GlobeSurfaceTileProvider,L8 as GlobeTranslucency,xH as GlobeTranslucencyFramebuffer,pH as GlobeTranslucencyState,vB as GltfBufferViewLoader,PB as GltfDracoLoader,PQ as GltfGpmLoader,JB as GltfGpmLocal,MB as GltfImageLoader,NB as GltfIndexBufferLoader,OB as GltfJsonLoader,td as GltfLoader,Xu as GltfLoaderUtil,LQ as GltfMeshPrimitiveGpmLoader,$F as GltfSpzLoader,bQ as GltfStructuralMetadataLoader,FB as GltfTextureLoader,QB as GltfVertexBufferLoader,uk as Google2DImageryProvider,vBe as GoogleEarthEnterpriseImageryProvider,ok as GoogleEarthEnterpriseMapsProvider,iC as GoogleEarthEnterpriseMetadata,zP as GoogleEarthEnterpriseTerrainData,JIe as GoogleEarthEnterpriseTerrainProvider,OV as GoogleEarthEnterpriseTileInformation,$Ie as GoogleGeocoderService,Ss as GoogleMaps,PBe as GoogleStreetViewCubeMapPanoramaProvider,tV as GpxDataSource,Qg as GregorianDate,RBe as GridImageryProvider,gv as GridMaterialProperty,ri as GroundGeometryUpdater,sb as GroundPolylineGeometry,Bm as GroundPolylinePrimitive,Zl as GroundPrimitive,ZD as GroupMetadata,Vh as HeadingPitchRange,Rc as HeadingPitchRoll,RM as Heap,ot as HeightReference,Jh as HeightmapEncoding,Xc as HeightmapTerrainData,PP as HeightmapTessellator,VU as HermitePolynomialApproximation,IE as HermiteSpline,SB as HilbertOrder,l5 as HomeButton,s5 as HomeButtonViewModel,Ni as HorizontalOrigin,HDe as I3SBuildingSceneLayerExplorer,f5 as I3SBuildingSceneLayerExplorerViewModel,Kp as I3SDataProvider,A9 as I3SDecoder,g9 as I3SFeature,y9 as I3SField,zR as I3SGeometry,ew as I3SLayer,GR as I3SNode,x9 as I3SStatistics,T9 as I3SSublayer,I9 as I3SSymbology,YQ as I3dmLoader,HQ as I3dmParser,UBe as ITwinData,ds as ITwinPlatform,zV as Iau2000Orientation,UM as Iau2006XysData,MI as Iau2006XysSample,GV as IauOrientationAxes,UV as IauOrientationParameters,xb as ImageBasedLighting,c2 as ImageBasedLightingPipelineStage,$C as ImageMaterialProperty,mD as Imagery,u3 as ImageryConfiguration,gD as ImageryCoverage,Ak as ImageryFlags,_k as ImageryInput,Ta as ImageryLayer,Kx as ImageryLayerCollection,Zm as ImageryLayerFeatureInfo,yk as ImageryPipelineStage,id as ImageryProvider,Hn as ImageryState,GB as Implicit3DTileContent,wB as ImplicitAvailabilityBitstream,BB as ImplicitMetadataView,ka as ImplicitSubdivisionScheme,T_ as ImplicitSubtree,s9 as ImplicitSubtreeCache,DF as ImplicitSubtreeMetadata,YA as ImplicitTileCoordinates,jA as ImplicitTileset,Ue as IndexDatatype,m5 as InfoBox,d5 as InfoBoxViewModel,Rf as InspectorShared,Ua as InstanceAttributeSemantic,b2 as InstancingPipelineStage,pbe as InterpolationAlgorithm,qm as InterpolationType,Xt as Intersect,di as IntersectionTests,Op as Intersections2D,ea as Interval,lR as InvertClassification,Fm as Ion,rC as IonGeocodeProviderType,CS as IonGeocoderService,du as IonImageryProvider,hD as IonImageryProviderFactory,_a as IonResource,V_ as IonWorldImageryStyle,Ze as Iso8601,gH as JobScheduler,Uc as JobType,M_ as JsonMetadataTable,X as JulianDate,nN as KTX2Transcoder,ac as KeyboardEventModifier,Uo as KeyframeNode,nV as KmlCamera,aS as KmlDataSource,iV as KmlLookAt,rV as KmlTour,sV as KmlTourFlyTo,cV as KmlTourWait,FE as Label,NA as LabelCollection,vm as LabelGraphics,Ir as LabelStyle,Oz as LabelVisualizer,HU as LagrangePolynomialApproximation,ho as LeapSecond,GBe as Light,RA as LightingModel,Ek as LightingPipelineStage,sT as LinearApproximation,EE as LinearSpline,iu as ManagedArray,Bu as MapMode2D,gbe as MapProjection,rk as MapboxImageryProvider,HBe as MapboxStyleImageryProvider,gk as MappedPositions,Lg as Mars3DEx,Xi as Material,_o as MaterialAppearance,Tk as MaterialPipelineStage,vr as MaterialProperty,D as Math,Ki as Matrix2,J as Matrix3,P as Matrix4,V4 as Megatexture,NQ as MeshPrimitiveGpmLocal,Hm as MetadataClass,IA as MetadataClassProperty,Qt as MetadataComponentType,Kn as MetadataEntity,iQ as MetadataEnum,tQ as MetadataEnumValue,yH as MetadataPicking,rd as MetadataPickingPipelineStage,ph as MetadataPipelineStage,au as MetadataSchema,hE as MetadataSchemaLoader,mh as MetadataSemantic,dh as MetadataTable,PF as MetadataTableProperty,It as MetadataType,ih as MipmapHint,ad as Model,sd as Model3DTileContent,Ex as ModelAlphaOptions,ZQ as ModelAnimation,JQ as ModelAnimationChannel,e2 as ModelAnimationCollection,Ju as ModelAnimationLoop,Xm as ModelAnimationState,f2 as ModelArticulation,l2 as ModelArticulationStage,m2 as ModelClippingPlanesPipelineStage,g2 as ModelClippingPolygonsPipelineStage,xE as ModelColorPipelineStage,bn as ModelComponents,t3 as ModelDrawCommand,o3 as ModelDrawCommands,t2 as ModelFeature,n2 as ModelFeatureTable,a_ as ModelGraphics,f3 as ModelImagery,yx as ModelImageryMapping,Zk as ModelLightingOptions,x2 as ModelMatrixUpdateStage,_2 as ModelNode,Cx as ModelPrimitiveImagery,Sl as ModelReader,Vk as ModelRenderResources,S2 as ModelRuntimeNode,zk as ModelRuntimePrimitive,a3 as ModelSceneGraph,Yk as ModelSilhouettePipelineStage,Gk as ModelSkin,Xk as ModelSplitterPipelineStage,s3 as ModelStatistics,Vr as ModelType,Tt as ModelUtility,Qz as ModelVisualizer,K8 as Moon,wk as MorphTargetsPipelineStage,_be as MorphWeightSpline,t0 as MortonOrder,nU as Multiple3DTileContent,s1 as MultisampleFramebuffer,g5 as NavigationHelpButton,p5 as NavigationHelpButtonViewModel,Ht as NearFarScalar,WBe as NeverTileDiscardPolicy,Jk as NodeRenderResources,T2 as NodeStatisticsPipelineStage,Ab as NodeTransformationProperty,TH as OIT,qV as Occluder,go as OffsetGeometryInstanceAttribute,Ebe as OpenCageGeocoderService,bC as OpenStreetMapImageryProvider,nz as OrderedGroundPrimitiveCollection,en as OrientedBoundingBox,An as OrthographicFrustum,Aa as OrthographicOffCenterFrustum,Ibe as Packable,bbe as PackableForInterpolation,YBe as Panorama,qBe as PanoramaProvider,WR as Particle,JBe as ParticleBurst,$Be as ParticleEmitter,nDe as ParticleSystem,Be as Pass,ll as PassState,s_ as PathGraphics,Vz as PathVisualizer,VV as PeliasGeocoderService,gn as PerInstanceColorAppearance,hC as PerformanceDisplay,C5 as PerformanceWatchdog,_5 as PerformanceWatchdogViewModel,Wi as PerspectiveFrustum,Su as PerspectiveOffCenterFrustum,CH as PickDepth,SH as PickDepthFramebuffer,wH as PickFramebuffer,yN as PickId,q4 as PickedMetadataInfo,OH as Picking,Bk as PickingPipelineStage,Gy as PinBuilder,He as PixelDatatype,Ke as PixelFormat,cn as Plane,hz as PlaneGeometry,Az as PlaneGeometryUpdater,uF as PlaneGraphics,pz as PlaneOutlineGeometry,l3 as PntsLoader,Ix as PntsParser,r9 as PointCloud,O_ as PointCloudEyeDomeLighting,TA as PointCloudShading,vk as PointCloudStylingPipelineStage,_b as PointGraphics,Ps as PointPrimitive,Av as PointPrimitiveCollection,Hz as PointVisualizer,v_ as PolygonGeometry,ni as PolygonGeometryLibrary,Cz as PolygonGeometryUpdater,Pm as PolygonGraphics,Fc as PolygonHierarchy,yz as PolygonOutlineGeometry,wi as PolygonPipeline,Ch as Polyline,_v as PolylineArrowMaterialProperty,ap as PolylineCollection,Qa as PolylineColorAppearance,yv as PolylineDashMaterialProperty,Oy as PolylineGeometry,jz as PolylineGeometryUpdater,Cv as PolylineGlowMaterialProperty,pl as PolylineGraphics,mc as PolylineMaterialAppearance,s0 as PolylineOutlineMaterialProperty,to as PolylinePipeline,qz as PolylineVisualizer,Ez as PolylineVolumeGeometry,up as PolylineVolumeGeometryLibrary,bz as PolylineVolumeGeometryUpdater,yb as PolylineVolumeGraphics,Iz as PolylineVolumeOutlineGeometry,Dm as PositionProperty,Ey as PositionPropertyArray,Oo as PostProcessStage,n4 as PostProcessStageCollection,xf as PostProcessStageComposite,kd as PostProcessStageLibrary,Qd as PostProcessStageSampleMode,QS as PostProcessStageTextureCache,MQ as PpeMetadata,pDe as PpeSource,RQ as PpeTexture,Ln as Primitive,yu as PrimitiveCollection,Xb as PrimitiveLoadPlan,Kb as PrimitiveOutlineGenerator,Mk as PrimitiveOutlinePipelineStage,ib as PrimitivePipeline,$k as PrimitiveRenderResources,na as PrimitiveState,Nk as PrimitiveStatisticsPipelineStage,Pe as PrimitiveType,x5 as ProjectionPicker,I5 as ProjectionPickerViewModel,q as Property,Ev as PropertyArray,jb as PropertyAttribute,CQ as PropertyAttributeProperty,nu as PropertyBag,cu as PropertyTable,N_ as PropertyTexture,yQ as PropertyTextureProperty,mr as ProviderViewModel,Sbe as Proxy,Wl as QuadraticRealPolynomial,O8 as QuadtreeOccluders,V8 as QuadtreePrimitive,Q8 as QuadtreeTile,sc as QuadtreeTileLoadState,iDe as QuadtreeTileProvider,fS as QuantizedMeshTerrainData,oN as QuarticRealPolynomial,Qe as Quaternion,XQ as QuaternionSpline,AE as Queue,In as Ray,ce as Rectangle,FT as RectangleCollisionChecker,BT as RectangleGeometry,vs as RectangleGeometryLibrary,xz as RectangleGeometryUpdater,Rm as RectangleGraphics,kx as RectangleOutlineGeometry,Oi as ReferenceFrame,by as ReferenceProperty,Ve as RenderState,Gf as Renderbuffer,Kl as RenderbufferFormat,Br as Request,nA as RequestErrorEvent,sl as RequestScheduler,yi as RequestState,es as RequestType,De as Resource,Pi as ResourceCache,su as ResourceCacheKey,rQ as ResourceCacheStatistics,$i as ResourceLoader,gt as ResourceLoaderState,Mh as Rotation,ue as RuntimeError,__ as S2Cell,Ys as SDFSettings,yc as SampledPositionProperty,wd as SampledProperty,jt as Sampler,ag as ScaledPositionProperty,Z4 as Scene,NS as SceneFramebuffer,oe as SceneMode,Lk as SceneMode2DPipelineStage,B5 as SceneModePicker,S5 as SceneModePickerViewModel,co as SceneTransforms,o4 as SceneTransitioner,p4 as ScreenSpaceCameraController,Ld as ScreenSpaceEventHandler,Dn as ScreenSpaceEventType,wE as SelectedFeatureIdPipelineStage,R5 as SelectionIndicator,v5 as SelectionIndicatorViewModel,xv as SensorVolumePortionToDisplay,Xg as ShaderBuilder,e1 as ShaderCache,he as ShaderDestination,u1 as ShaderFunction,$t as ShaderProgram,We as ShaderSource,l1 as ShaderStruct,AC as ShadowMap,Ig as ShadowMapShader,Bn as ShadowMode,Yf as ShadowVolumeAppearance,d1 as SharedContext,wn as ShowGeometryInstanceAttribute,GC as Simon1994PlanetaryPositions,Hbe as SimplePolylineGeometry,ak as SingleTileImageryProvider,Fk as SkinningPipelineStage,$4 as SkyAtmosphere,e9 as SkyBox,H4 as SpatialNode,vQ as Spdcf,Om as SpecularEnvironmentCubeMap,oDe as SphereEmitter,$V as SphereGeometry,fy as SphereOutlineGeometry,WU as Spherical,So as Spline,Qr as SplitDirection,vR as Splitter,Qh as StaticGeometryColorBatch,Uh as StaticGeometryPerMaterialBatch,zv as StaticGroundGeometryColorBatch,Nz as StaticGroundGeometryPerMaterialBatch,Yz as StaticGroundPolylinePerMaterialBatch,Gv as StaticOutlineGeometryBatch,Yt as StencilConstants,ti as StencilFunction,wt as StencilOperation,KQ as SteppedSpline,Il as Stereographic,yE as StorageType,Iv as StripeMaterialProperty,pp as StripeOrientation,js as StructuralMetadata,Jm as StyleCommandsNeeded,rDe as StyleExpression,t9 as Sun,Kg as SunLight,_4 as SunPostProcess,SQ as SupportedImageFormats,N9 as SvgPathBindingHandler,h1 as Sync,Zn as TaskProcessor,v9 as Terrain,_f as TerrainData,Tr as TerrainEncoding,JP as TerrainFillMesh,bc as TerrainMesh,Ib as TerrainOffsetProperty,_V as TerrainPicker,Yo as TerrainProvider,rc as TerrainQuantization,Lo as TerrainState,vt as Texture,m1 as Texture3D,KI as TextureAtlas,n1 as TextureCache,si as TextureMagnificationFilter,U4 as TextureManager,Wt as TextureMinificationFilter,Fw as TexturePacker,hDe as TextureUniform,pn as TextureWrap,Lp as TileAvailability,yd as TileBoundingRegion,aU as TileBoundingS2Cell,dy as TileBoundingSphere,aDe as TileBoundingVolume,P9 as TileCoordinatesImageryProvider,sDe as TileDiscardPolicy,Tn as TileEdge,pD as TileImagery,BE as TileMapServiceImageryProvider,eU as TileMetadata,of as TileOrientedBoundingBox,tr as TileProviderError,U8 as TileReplacementQueue,li as TileSelectionResult,cDe as TileState,h3 as Tileset3DTileContent,uU as TilesetMetadata,i2 as TilesetPipelineStage,Wbe as TilingScheme,ci as TimeConstants,px as TimeDynamicImagery,RR as TimeDynamicPointCloud,Rn as TimeInterval,Ba as TimeIntervalCollection,Ty as TimeIntervalCollectionPositionProperty,Sy as TimeIntervalCollectionProperty,ai as TimeStandard,L5 as Timeline,M5 as TimelineHighlightRange,N5 as TimelineTrack,sN as Tipsify,dI as ToggleButtonViewModel,_C as Tonemapper,n_ as TrackingReferenceFrame,At as Transforms,tE as TranslationRotationScale,DH as TranslucentTileClassification,tD as TridiagonalSystemSolver,yw as TrustedServers,US as TweenCollection,r1 as UniformState,CR as UniformType,ba as UrlTemplateImageryProvider,ZDo as VERSION,k5 as VRButton,F5 as VRButtonViewModel,Kbe as VRTheWorldTerrainProvider,mDe as VaryingType,_A as Vector3DTileBatch,P3 as Vector3DTileClampedPolylines,M3 as Vector3DTileContent,m_ as Vector3DTileGeometry,S3 as Vector3DTilePoints,w3 as Vector3DTilePolygons,Bx as Vector3DTilePolylines,wb as Vector3DTilePrimitive,WD as VectorGltf3DTileContent,YU as VelocityOrientationProperty,wy as VelocityVectorProperty,Vn as VertexArray,Zg as VertexArrayFacade,at as VertexAttributeSemantic,ke as VertexFormat,To as VerticalExaggeration,kk as VerticalExaggerationPipelineStage,Yn as VerticalOrigin,jbe as VideoSynchronizer,OS as View,ive as Viewer,lDe as ViewportQuad,qr as Visibility,Y0e as Visualizer,CC as VoxelBoundsCollection,jS as VoxelBoxShape,C4 as VoxelCell,WS as VoxelContent,YS as VoxelCylinderShape,qS as VoxelEllipsoidShape,G5 as VoxelInspector,U5 as VoxelInspectorViewModel,Sg as VoxelMetadataOrder,nI as VoxelPrimitive,uDe as VoxelProvider,F4 as VoxelRenderResources,fDe as VoxelShape,Sc as VoxelShapeType,j4 as VoxelTraversal,Xbe as VulkanConstants,Sz as WallGeometry,vT as WallGeometryLibrary,Bz as WallGeometryUpdater,c_ as WallGraphics,wz as WallOutlineGeometry,ee as WebGLConstants,ck as WebMapServiceImageryProvider,lk as WebMapTileServiceImageryProvider,mi as WebMercatorProjection,za as WebMercatorTilingScheme,ts as WindingOrder,_D as WireframeIndexGenerator,Uk as WireframePipelineStage,FH as _shadersAcesTonemappingStage,A4 as _shadersAdditiveBlend,WP as _shadersAdjustTranslucentFS,g1 as _shadersAllMaterialAppearanceFS,_1 as _shadersAllMaterialAppearanceVS,QH as _shadersAmbientOcclusionGenerate,kH as _shadersAmbientOcclusionModulate,b1 as _shadersAspectRampMaterial,Ym as _shadersAtmosphereCommon,o2 as _shadersAtmosphereStageFS,r2 as _shadersAtmosphereStageVS,y1 as _shadersBasicMaterialAppearanceFS,C1 as _shadersBasicMaterialAppearanceVS,m3 as _shadersBillboardCollectionFS,p3 as _shadersBillboardCollectionVS,UH as _shadersBlackAndWhite,zH as _shadersBloomComposite,n8 as _shadersBrdfLutGeneratorFS,g4 as _shadersBrightPass,GH as _shadersBrightness,O3 as _shadersBufferPointMaterialFS,L3 as _shadersBufferPointMaterialVS,k3 as _shadersBufferPolygonMaterialFS,Q3 as _shadersBufferPolygonMaterialVS,V3 as _shadersBufferPolylineMaterialFS,G3 as _shadersBufferPolylineMaterialVS,x1 as _shadersBumpMapMaterial,P2 as _shadersCPUStylingStageFS,v2 as _shadersCPUStylingStageVS,T1 as _shadersCheckerboardMaterial,i8 as _shadersCloudCollectionFS,o8 as _shadersCloudCollectionVS,r8 as _shadersCloudNoiseFS,a8 as _shadersCloudNoiseVS,s8 as _shadersCompareAndPackTranslucentDepth,c8 as _shadersCompositeOITFS,LS as _shadersCompositeTranslucentClassification,pQ as _shadersComputeIrradianceFS,AQ as _shadersComputeRadianceMapFS,xk as _shadersConstantLodStageFS,bk as _shadersConstantLodStageVS,VH as _shadersContrastBias,gQ as _shadersConvolveSpecularMapFS,_Q as _shadersConvolveSpecularMapVS,l8 as _shadersCubeMapPanoramaVS,N2 as _shadersCustomShaderStageFS,M2 as _shadersCustomShaderStageVS,HI as _shadersCzmBuiltins,HH as _shadersDepthOfField,u8 as _shadersDepthPlaneFS,f8 as _shadersDepthPlaneVS,WH as _shadersDepthView,dDe as _shadersDepthViewPacked,S1 as _shadersDotMaterial,jH as _shadersEdgeDetection,z2 as _shadersEdgeDetectionStageFS,V2 as _shadersEdgeVisibilityStageFS,H2 as _shadersEdgeVisibilityStageVS,w1 as _shadersElevationBandMaterial,B1 as _shadersElevationContourMaterial,D1 as _shadersElevationRampMaterial,jP as _shadersEllipsoidFS,h9 as _shadersEllipsoidSurfaceAppearanceFS,m9 as _shadersEllipsoidSurfaceAppearanceVS,YP as _shadersEllipsoidVS,KH as _shadersFXAA,d8 as _shadersFXAA3_11,v1 as _shadersFadeMaterial,L2 as _shadersFeatureIdStageFS,O2 as _shadersFeatureIdStageVS,YH as _shadersFilmicTonemapping,Y0 as _shadersGaussianBlur1D,j2 as _shadersGeometryStageFS,Y2 as _shadersGeometryStageVS,h8 as _shadersGlobeFS,m8 as _shadersGlobeVS,P1 as _shadersGridMaterial,qP as _shadersGroundAtmosphere,ZL as _shadersHSBToRGB,$L as _shadersHSLToRGB,s2 as _shadersImageBasedLightingStageFS,y2 as _shadersInstancingStageCommon,C2 as _shadersInstancingStageVS,D4 as _shadersIntersectBox,v4 as _shadersIntersectCylinder,w4 as _shadersIntersectDepth,P4 as _shadersIntersectEllipsoid,yR as _shadersIntersectLongitude,B4 as _shadersIntersectPlane,GS as _shadersIntersection,S4 as _shadersIntersectionUtils,E2 as _shadersLegacyInstancingStageVS,XH as _shadersLensFlare,Ck as _shadersLightingStageFS,Ik as _shadersMaterialStageFS,O4 as _shadersMegatexture,F2 as _shadersMetadataStageFS,Q2 as _shadersMetadataStageVS,h2 as _shadersModelClippingPlanesStageFS,A2 as _shadersModelClippingPolygonsStageFS,p2 as _shadersModelClippingPolygonsStageVS,d2 as _shadersModelColorStageFS,i3 as _shadersModelFS,Hk as _shadersModelSilhouetteStageFS,Wk as _shadersModelSilhouetteStageVS,qk as _shadersModelSplitterStageFS,n3 as _shadersModelVS,JH as _shadersModifiedReinhardTonemapping,Sk as _shadersMorphTargetsStageVS,ZH as _shadersNightVision,R1 as _shadersNormalMapMaterial,L4 as _shadersOctree,bf as _shadersPassThrough,V0 as _shadersPassThroughDepth,qH as _shadersPbrNeutralTonemapping,G1 as _shadersPerInstanceColorAppearanceFS,V1 as _shadersPerInstanceColorAppearanceVS,eb as _shadersPerInstanceFlatColorAppearanceFS,H1 as _shadersPerInstanceFlatColorAppearanceVS,QQ as _shadersPointCloudEyeDomeLighting,Dk as _shadersPointCloudStylingStageVS,o0 as _shadersPointPrimitiveCollectionFS,OU as _shadersPointPrimitiveCollectionVS,mQ as _shadersPolygonSignedDistanceFS,M1 as _shadersPolylineArrowMaterial,cF as _shadersPolylineColorAppearanceVS,$l as _shadersPolylineCommon,N1 as _shadersPolylineDashMaterial,cb as _shadersPolylineFS,L1 as _shadersPolylineGlowMaterial,lF as _shadersPolylineMaterialAppearanceVS,O1 as _shadersPolylineOutlineMaterial,oF as _shadersPolylineShadowVolumeFS,rF as _shadersPolylineShadowVolumeMorphFS,aF as _shadersPolylineShadowVolumeMorphVS,sF as _shadersPolylineShadowVolumeVS,E3 as _shadersPolylineVS,X3 as _shadersPrimitiveGaussianSplatFS,K3 as _shadersPrimitiveGaussianSplatVS,Rk as _shadersPrimitiveOutlineStageFS,Pk as _shadersPrimitiveOutlineStageVS,TO as _shadersRGBToHSB,SO as _shadersRGBToHSL,wO as _shadersRGBToXYZ,$H as _shadersReinhardTonemapping,hk as _shadersReprojectWebMercatorFS,mk as _shadersReprojectWebMercatorVS,F1 as _shadersRimLightingMaterial,rD as _shadersSelectedFeatureIdStageCommon,Yw as _shadersShadowVolumeAppearanceFS,q1 as _shadersShadowVolumeAppearanceVS,qC as _shadersShadowVolumeFS,e4 as _shadersSilhouette,Ok as _shadersSkinningStageVS,KP as _shadersSkyAtmosphereCommon,p8 as _shadersSkyAtmosphereFS,A8 as _shadersSkyAtmosphereVS,g8 as _shadersSkyBoxFS,_8 as _shadersSkyBoxVS,Q1 as _shadersSlopeRampMaterial,k1 as _shadersStripeMaterial,y8 as _shadersSunFS,C8 as _shadersSunTextureFS,E8 as _shadersSunVS,E1 as _shadersTexturedMaterialAppearanceFS,I1 as _shadersTexturedMaterialAppearanceVS,v3 as _shadersVector3DTileClampedPolylinesFS,D3 as _shadersVector3DTileClampedPolylinesVS,B3 as _shadersVector3DTilePolylinesVS,xB as _shadersVectorTileVS,Qk as _shadersVerticalExaggerationStageVS,I8 as _shadersViewportQuadFS,OI as _shadersViewportQuadVS,x4 as _shadersVoxelFS,b4 as _shadersVoxelUtils,T4 as _shadersVoxelVS,z1 as _shadersWater,U1 as _shadersWaterMaskMaterial,ZO as _shadersXYZToRGB,mL as _shadersacesTonemapping,pL as _shadersalphaWeight,AL as _shadersantialias,gL as _shadersapplyHSBShift,_L as _shadersapproximateSphericalCoordinates,yL as _shadersapproximateTanh,CL as _shadersbackFacing,EL as _shadersbranchFreeTernary,IL as _shaderscascadeColor,bL as _shaderscascadeDistance,xL as _shaderscascadeMatrix,TL as _shaderscascadeWeights,SL as _shadersclipPolygons,wL as _shaderscolumbusViewMorph,BL as _shaderscomputeAtmosphereColor,DL as _shaderscomputeGroundAtmosphereScattering,vL as _shaderscomputePosition,PL as _shaderscomputeScattering,RL as _shaderscomputeTextureTransform,R4 as _shadersconvertLocalToBoxUv,M4 as _shadersconvertLocalToCylinderUv,N4 as _shadersconvertLocalToEllipsoidUv,ML as _shaderscosineAndSine,NL as _shadersdecodeRGB8,LL as _shadersdecompressTextureCoordinates,CN as _shadersdegreesPerRadian,OL as _shadersdepthClamp,EN as _shadersdepthRange,aL as _shadersdepthRangeStruct,FL as _shaderseastNorthUpToEyeCoordinates,QL as _shadersellipsoidContainsPoint,kL as _shadersellipsoidTextureCoordinates,IN as _shadersepsilon1,bN as _shadersepsilon2,xN as _shadersepsilon3,TN as _shadersepsilon4,SN as _shadersepsilon5,wN as _shadersepsilon6,BN as _shadersepsilon7,UL as _shadersequalsEpsilon,zL as _shaderseyeOffset,GL as _shaderseyeToWindowCoordinates,VL as _shadersfastApproximateAtan,HL as _shadersfog,WL as _shadersgammaCorrect,jL as _shadersgeodeticSurfaceNormal,YL as _shadersgetDefaultMaterial,qL as _shadersgetDynamicAtmosphereLightDirection,KL as _shadersgetLambertDiffuse,XL as _shadersgetSpecular,JL as _shadersgetWaterNoise,eO as _shadershue,DN as _shadersinfinity,tO as _shadersinverseGamma,nO as _shadersisEmpty,iO as _shadersisFull,oO as _shaderslatitudeToWebMercatorFraction,aO as _shaderslineDistance,rO as _shaderslinearToSrgb,sO as _shadersluminance,sL as _shadersmaterial,cL as _shadersmaterialInput,cO as _shadersmaximumComponent,lO as _shadersmetersPerPixel,lL as _shadersmodelMaterial,uO as _shadersmodelToWindowCoordinates,uL as _shadersmodelVertexOutput,fO as _shadersmultiplyWithColorBalance,dO as _shadersnearFarScalar,hO as _shadersoctDecode,vN as _shadersoneOverPi,PN as _shadersoneOverTwoPi,mO as _shaderspackDepth,RN as _shaderspassCesium3DTile,MN as _shaderspassCesium3DTileClassification,NN as _shaderspassCesium3DTileClassificationIgnoreShow,LN as _shaderspassCesium3DTileEdges,ON as _shaderspassClassification,FN as _shaderspassCompute,QN as _shaderspassEnvironment,kN as _shaderspassGaussianSplats,UN as _shaderspassGlobe,zN as _shaderspassOpaque,GN as _shaderspassOverlay,VN as _shaderspassTerrainClassification,HN as _shaderspassTranslucent,WN as _shaderspassVoxels,pO as _shaderspbrLighting,AO as _shaderspbrNeutralTonemapping,gO as _shadersphong,jN as _shaderspi,YN as _shaderspiOverFour,qN as _shaderspiOverSix,KN as _shaderspiOverThree,XN as _shaderspiOverTwo,_O as _shadersplaneDistance,yO as _shaderspointAlongRay,JN as _shadersradiansPerDegree,fL as _shadersray,CO as _shadersrayEllipsoidIntersectionInterval,dL as _shadersraySegment,EO as _shadersraySphereIntersectionInterval,IO as _shadersreadDepth,bO as _shadersreadNonPerspective,xO as _shadersreverseLogDepth,BO as _shadersround,DO as _shaderssaturation,ZN as _shaderssceneMode2D,$N as _shaderssceneMode3D,eL as _shaderssceneModeColumbusView,tL as _shaderssceneModeMorphing,vO as _shadersshadowDepthCompare,hL as _shadersshadowParameters,PO as _shadersshadowVisibility,RO as _shaderssignNotZero,nL as _shaderssolarRadius,MO as _shaderssphericalHarmonics,NO as _shaderssrgbToLinear,LO as _shaderstangentToEyeSpaceMatrix,OO as _shaderstextureCube,iL as _shadersthreePiOver2,FO as _shaderstransformPlane,QO as _shaderstranslateRelativeToEye,kO as _shaderstranslucentPhong,UO as _shaderstranspose,oL as _shaderstwoPi,zO as _shadersunpackClippingExtents,GO as _shadersunpackDepth,VO as _shadersunpackFloat,HO as _shadersunpackTexture,WO as _shadersunpackUint,jO as _shadersvalueTransform,YO as _shadersvertexLogDepth,rL as _shaderswebMercatorMaxLatitude,qO as _shaderswindowToEyeCoordinates,KO as _shaderswriteDepthClamp,XO as _shaderswriteLogDepth,JO as _shaderswriteNonPerspective,oi as addAllToArray,GF as addBuffer,MF as addDefaults,kF as addExtensionsRequired,hh as addExtensionsUsed,fE as addPipelineExtras,xs as addToArray,BM as appendForwardSlash,jo as arrayRemoveDuplicates,Loe as assert,QI as barycentricCoordinates,Io as binarySearch,Zt as buildModuleUrl,Q4 as buildVoxelDrawCommands,Ye as clone,Pt as combine,TS as computeFlyToLocationForRectangle,bx as createBillboardPointCallback,Mn as createCommand,K9 as createDefaultImageryProviderViewModels,X9 as createDefaultTerrainProviderViewModels,CBe as createElevationBandMaterial,IBe as createGooglePhotorealistic3DTileset,Jn as createGuid,ar as createMaterialPropertyDescriptor,bBe as createOsmBuildingsAsync,Ae as createPropertyDescriptor,tu as createRawPropertyDescriptor,xBe as createTangentSpaceDebugPrimitive,ADe as createTaskProcessorWorker,XM as createUniform,JM as createUniformArray,j3 as createVectorTileBuffersFromModelComponents,vV as createWorldBathymetryAsync,H_ as createWorldImageryAsync,mS as createWorldTerrainAsync,PV as decodeGoogleEarthEnterpriseData,R3 as decodeVectorPolylinePositions,Qu as defer,l as defined,$O as demodernizeShader,Gs as deprecationWarning,fe as destroyObject,oEe as exportKml,Rb as findAccessorMinMax,Lx as findContentMetadata,Ox as findGroupMetadata,tU as findTileMetadata,LB as forEachTextureInMaterial,vA as formatError,oie as freezeRenderState,tA as getAbsoluteUri,Ku as getAccessorByteStride,DM as getBaseUri,ch as getBinaryAccessor,n9 as getClipAndStyleCode,SS as getClippingFunction,I_ as getComponentReader,zn as getElement,Ug as getExtensionFromUri,Cy as getFilenameFromUri,LV as getImageFromTypedArray,mm as getImagePixels,Pr as getJsonFromTypedArray,km as getMagic,OQ as getMeshPrimitives,Y4 as getMetadataClassProperty,K4 as getMetadataProperty,ju as getStringFromTypedArray,ki as getTimestamp,Si as hasExtension,l_ as heightReferenceOnEntityPropertyChanged,Fl as isBitSet,wI as isBlobUri,vC as isCrossOriginUrl,Am as isDataUri,hm as isLeapYear,xe as knockout,ow as knockout_3_5_1,M9 as knockout_es5,BI as loadAndExecuteScript,c1 as loadCubeMap,E_ as loadImageFromTypedArray,ku as loadKTX2,Ag as mergeSort,QF as moveTechniqueRenderStates,UF as moveTechniquesToExtension,Jf as numberOfComponentsForType,DI as objectToQuery,bt as oneTimeWarning,F_ as parseBatchTable,IQ as parseFeatureMetadataLegacy,Pb as parseGlb,PM as parseResponseHeaders,EQ as parseStructuralMetadata,ID as pickModel,xbe as pointInsideTriangle,cy as preprocess3DTileContent,I4 as processVoxelProperties,Ff as queryToObject,VF as readAccessorPacked,Mb as removeExtension,LF as removeExtensionsRequired,vb as removeExtensionsUsed,FF as removePipelineExtras,zF as removeUnusedElements,F3 as renderBufferPointCollection,z3 as renderBufferPolygonCollection,H3 as renderBufferPolylineCollection,dE as resizeImageToNextPowerOfTwo,KV as sampleTerrain,IS as sampleTerrainMostDetailed,bI as scaleToGeodeticSurface,xS as srgbToLinear,K1 as subdivideArray,wc as subscribeAndEvaluate,WF as updateAccessorComponentTypes,YF as updateVersion,zr as usesExtension,ove as viewerCesium3DTilesInspectorMixin,rve as viewerCesiumInspectorMixin,sve as viewerDragDropMixin,cve as viewerPerformanceWatchdogMixin,uve as viewerVoxelInspectorMixin,Jbe as webGLConstantToGlslType,t8 as wrapFunction,Tx as writeTextToCanvas};
|